Before following this workflow, read the Codex runtime contract. It defines plugin paths, model configuration, delegation, and persistence.
Swarm
Resolve the named role line in ~/.codex/pstack-models.md before each spawn, following CODEX.md: missing lines use the default, auto and inherit-parent omit both overrides, and unavailable choices are reported with inheritance as the explicit fallback. Split model @ effort into separate host fields.
Start
Open a todolist with one entry per phase before launching anything.
- Frame
- Fan out
- Aggregate
- Report
Phase A: Frame
- State the done predicate and the artifact or report the swarm must return.
- Choose the shape. Partition into slices, race N workers on identical briefs, or mix both. For a race or mixed shape, declare
first pass,rank all, orbest-ofbefore spawning. - Set N from the user or derive it from the shape. N is total workers, not the host concurrency limit.
- Pick the worker model from
swarm workersin~/.codex/pstack-models.mdwhen present. Otherwise usegpt-6-luna @ xhigh. For a model race, name each arm's model up front. Pick reasoning effort for the job under the Subagents section of poteto-mode, using only the active execution tool’s supported values. - Give each worker its own writable output when it writes. When workers verify or measure commits, each brief names the exact SHAs. A measurement brief also names the method (sample count, what one sample is, order). The worker records both in its result.
Phase B: Fan out
Spawn workers with the available Codex collaboration tools and configured model and reasoning effort. Keep at most the host's available worker capacity in flight, refilling as workers finish until all N have run. Use the default agent only if the current schema exposes an agent selector. All workers use the current host; authenticated tools, browser state, and simulator access follow its permissions.
For concurrent writers, create separate git worktrees at the requested branch and pass their absolute directories in the briefs. Read-only workers can share the checkout; independent report files outside a checkout do not require worktrees. Serialize workers that need the same browser or simulator state.
Every brief stands alone. Include the goal, scope, exact slice or race arm, how to verify, and what to report. Reports use PASS, ISSUES, or BLOCKED with evidence. A worker that can prove a defect reports ISSUES and lists every issue it can prove, not only the first.
If a worker drops out, proceed with N-1 and note it.
Phase C: Aggregate
Read the terminal results. Drop a result that does not record the SHAs and method its brief names, and respawn that worker once. After a second miss, record a gap. A gap does not count as a pass. For coverage, every required slice needs a result. For a race, apply the selection rule declared up front. Use first pass, rank all, or best-of. Do not paste raw worker dumps.
Phase D: Report
Return one consolidated in-chat report with a result table, issue one-liners, gaps or dropouts, and the race rule when used.


