Waves codex
WAVES - Workers, Aggregate, Verify, Extend - wave-based orchestration for Codex. Decompose a big goal into independent slices, verify coverage, spawn Codex subagents in parallel as a bounded wave, collect evidence-backed handoffs, verify important claims, synthesize one deliverable, and extend into another wave only when warranted. Bounded by design to avoid runaway token loops; invoke deliberately. Formerly parallel-orchestrate-codex; also fan out, parallelize, spin up multiple agents, orchestrate workers, multi-stream research, audit a repo, split disjoint implementation work.
By- name:
- waves-codex
- description:
- WAVES - Workers, Aggregate, Verify, Extend - wave-based orchestration for Codex. Decompose a big goal into independent slices, verify coverage, spawn Codex subagents in parallel as a bounded wave, collect evidence-backed handoffs, verify important claims, synthesize one deliverable, and extend into another wave only when warranted. Bounded by design to avoid runaway token loops; invoke deliberately. Formerly parallel-orchestrate-codex; also fan out, parallelize, spin up multiple agents, orchestrate workers, multi-stream research, audit a repo, split disjoint implementation work.
WAVES — Workers · Aggregate · Verify · Extend (Codex)
Run wave-based orchestration with Codex subagents. A wave is a bounded round of isolated workers in parallel, then a round that verifies what came back, then a deliberate decision to build on it — not an open-ended loop. Use this skill when a task is too broad for one clean linear pass but can be split into independent slices. You are the manager: discover the problem shape, stage and verify coverage, decompose it, spawn bounded Codex workers, collect one structured handoff from each worker, verify important claims, and synthesize the final deliverable.
The shape of every wave — WAVE: Workers fan out across disjoint slices -> Aggregate their handoffs -> Verify the evidence (the moat) -> Extend into another wave only when warranted. A loop doesn't know when to stop; a wave does, because verification is the stop function. (Invoke deliberately - a run spawns more agents than usual.)
Current Codex docs checked on 2026-07-19: Codex subagents are enabled by default
in current releases, built-in roles include default, worker, and explorer,
custom agents live in ~/.codex/agents/ or .codex/agents/ (TOML; project
agents load in trusted projects only), and subagent limits live under [agents]
in config.toml. Official docs no longer enumerate the collaboration tool
names; the current (multi-agent V2) surface exposes spawn_agent,
send_message, followup_task, wait_agent, interrupt_agent, and
list_agents, while threads created before the V2 runtime resume on the legacy
V1 set (spawn_agent, send_input, resume_agent, wait_agent,
close_agent) — read the live tool registry rather than assuming one set.
Spawning an unknown agent_type fails with an error rather than silently
falling back (fallback in Step 2). V2 delegation payloads are encrypted between
model calls, so don't build workflows that inspect spawn prompts from rollout
history. spawn_agents_on_csv is documented as experimental; use it when it is
exposed in the active Codex surface, and fall back to normal subagent waves
when it is not. No current Codex doc confirms a general-purpose claim-verifier
or critic hook; use a verifier subagent, CSV verification pass, tests,
validators, or codex exec --output-schema instead.
Native delegation on GPT-5.6 (how this skill plugs in): Sol and Terra run the
V2 multi-agent runtime, and the delegation mode is derived from reasoning
effort per turn -- ultra means proactive (the model spawns on its own
judgment), every other effort means explicit-request-only, where the
documented triggers are direct user asks and "applicable AGENTS.md or skill
instructions" -- this skill's spawn instructions are that sanctioned
channel, at any effort, no ultra required. Avoid ultra for wave runs:
proactive spawning happens outside your manifest, and its children inherit the
parent's model and effort (an ultra parent breeds ultra children -- the
runaway-cost failure mode). Native V2 spawns also fork the parent's history
by default (fork_turns defaults to all; filtered, but the child sees
your conversation), and full-history forks inherit the parent's agent type /
model / effort and reject overrides -- so for disjoint wave slices, request
fresh-context workers (no history fork), which is also the only spawn
shape that can be routed to a different model or effort. V2 ignores
agents.max_depth; its binding limit is concurrent agent slots (4 including
the manager by default; agents.max_threads + 1 when set) -- batch wider
waves accordingly.
Read these references when using the skill:
references/handoff-format.mdfor the exact worker handoff contract.references/verification.mdfor verification gates and verifier-worker playbooks.references/examples.mdfor decomposition recipes.references/recommended-config.mdfor Codex config and custom agent snippets.references/adaptation-notes.mdfor Cursor-to-Codex translation notes.
When to Use
- The user explicitly asks to use multiple agents, subagents, parallel workers, fan-out, or orchestration.
- The task splits into independent slices: data ranges, research streams, repo modules, audit dimensions, verification rows, or disjoint code ownership.
- The main value is speed, context hygiene, and verification discipline: keep noisy exploration out of the manager thread, then check the claims that matter.
- A second or third wave may be useful after first-wave handoffs expose gaps, conflicts, narrowed scope, or high-stakes claims needing verification.
When to Skip
- The task is small, linear, or easy to do locally.
- The slices require constant cross-talk or shared mutable decisions.
- The next action is blocked on one immediate investigation; do that locally.
- Parallel code edits would overlap heavily and no worktree/isolation strategy is available.
Core Principles
- The manager plans, verifies, and synthesizes. Workers do heavy reading, research, tests, audits, bounded edits, or focused claim checks.
- Worker prompts are self-contained. Do not assume workers can infer the user's original request, your scratch reasoning, or sibling work unless you intentionally pass or fork that context. (On GPT-5.6's V2 runtime, native spawns fork parent history by default -- request fresh-context workers for disjoint slices, and keep prompts self-contained either way: a forked child sees a filtered history, not your reasoning, and fork behavior is version-sensitive.)
- One worker owns one slice and returns one handoff.
- Verify before you trust. A worker's
Status: successis a claim, not evidence. - Parallel reads are the default safe case.
- Parallel writes require disjoint ownership or isolated worktrees. Codex is safer than a shared local-only model when workers run in separate sandboxes or worktrees, but write conflicts are still a coordination problem.
- Continuous motion (within the stated budget). Handoffs reveal new work; treat each open question or suggested follow-up as a candidate second-wave task and spawn it. Keep going until every slice is terminal and the synthesis is complete -- stopping early while genuine follow-ups remain is the failure mode this skill guards against. (The manifest plus the stated budget is the stop function; see "Bounded Waves.")
- Decomposition is entropy reduction. A vague goal is high-entropy: many plausible plans still fit. Shrink that space -- dig locally, then pull from attached resources, then ask the user only if it pays -- before you slice it. See "Entropy-First Decomposition."
Bounded Waves - Size, Budget, and the Stop Function
A wave is bounded on purpose - but bounded by completion and budget, not by a wave count. Unbounded "loop-until-done" burns tokens for little gain: candidate generation is cheap, selection plateaus, and extra rounds are non-monotonic (more iterations can lower quality, not just cost). Equally real is the opposite failure: stopping while the manifest still has open slices. Keep the exploration, drop the runaway, never abandon un-terminal work.
- Width: 3-8 workers per wave (and within the concurrency limit: V2 allows 4
concurrent agent slots including the manager by default, or
agents.max_threads + 1when set -- withmax_threads = 6, that is 7 slots; batch wider waves). Size the wave so you can fully verify all of it. Go wider only with a cheap automatic check (tests,codex exec --output-schema, schema/exec) gating results. (Grounding: homogeneous-agent teams plateau around N~4-8 - added workers contribute redundant evidence, and diversity, not head count, escapes the ceiling - arXiv 2606.02646, 2602.03794.) - Depth: the manifest is the stop function. Keep extending while any manifest
slice is non-terminal AND the last wave added verified progress. Stop only on
one of three conditions: completion (every slice terminal, synthesis done),
stagnation (nothing new + outputs near-duplicate the last wave, or a quality
drop), or budget exhaustion. State the budget up front in the run-shape line
- a worker or token budget, not a wave count (e.g.
budget: ~20 workers). A realistic run is often12 + 3 + 1workers across three waves, and a decomposition cascade on a vague goal legitimately runs more. (Grounding: verification-driven replan loops stop on completeness thresholds, diminishing returns, and token budgets, not fixed iteration caps - VMAO, arXiv 2603.11445; convergence-based stopping beats fixedmax_iterationsat parity quality - arXiv 2606.27009.)
- a worker or token budget, not a wave count (e.g.
- Scouting is cheap - don't let it eat the budget. Entropy-reduction waves (scouting, decomposition) run on cheap models/low effort and count separately from the execution budget. Never end a run "out of waves" when the budget was consumed by discovery before execution started.
- Budget ~60% generation / 40% verification; selection is the scarce resource.
- Match width to difficulty: easy -> 1 + light refine; medium -> 3-5; hard/open-ended -> 5-8 for diversity; hardest/novel -> escalate reasoning/model, don't loop.
- Anti-poisoning: carry only a distilled, verified handoff (winner + short critique) into the next wave, never raw transcripts or losing candidates. Exception: constraints are pinned, never summarized - the manifest, stop conditions/budget, and safety/scope rules travel verbatim through every synthesis and compaction (compaction measurably drops in-context constraints; arXiv 2606.22528).
Loop-until-done is justified only when ALL hold: a cheap reliable ~ground-truth verifier exists; the signal is crisp/actionable (a failing test, not "try harder"); each iteration shows measurable progress; easy-medium difficulty; still hard-capped. Fits code-with-tests/exec-feedback; misfits open-ended research/writing/design.
Entropy-First Decomposition
Before you fan out, treat the goal as an entropy-reduction problem: shrink how many plausible interpretations and plans still fit what you know. A vague, high-entropy request ("build a Flappy Bird game", "make my app faster") does not slice cleanly yet -- reduce the uncertainty first, then decompose the low-entropy version. Name what is uncertain, because the two kinds resolve differently:
- Specification uncertainty -- what the user wants (ambiguous goal, missing acceptance criteria, unstated constraints). Resolve by stating an explicit assumption and proceeding, or -- only when a wrong guess is expensive -- by asking.
- Environment / knowledge uncertainty -- facts you do not have yet but can get (repo shape, schema, API behavior, current docs, data size). Resolve by gathering, not by asking.
Spend the cheapest action that buys the most certainty first -- an information-gain ladder -- and aim each probe at the unknown whose answer eliminates the most plans (the highest-information question splits the surviving interpretations roughly in half):
- Dig locally first (cheap): inspect local state in the manager thread (list, read schema/README, grep, sample data). This is Step 0; it often collapses most of the uncertainty for free.
- Then pull from attached resources: if local state lacks the answer, spawn a
small scouting wave of
explorer/research workers to fetch it (docs, MCP, web) on a fast low-cost configuration (gpt-5.6-terraor short-contextgpt-5.6-lunaatlow/medium; see Step 2). - Ask the user last, and only when it pays: when residual specification uncertainty is high and a question's expected information gain beats its cost. Most requests carry enough to proceed on a stated assumption.
Then cascade: one request becomes a decomposition wave (understand -> locate
unknowns -> draft the plan) -> verify -> an execution wave that builds the
subtasks least-to-most (each verified result lowering uncertainty for the next),
with more scouting sub-waves wherever entropy stays high. Track the living plan
with update_plan; stop reducing when entropy is low enough to act -- the
verification gate doubles as "is the uncertainty low enough to commit?" (Worked
example: references/examples.md.)
The Loop
Track the run with Codex's plan mechanism (update_plan) whenever the workflow
has more than a couple of moving parts.
Step 0 - Discover Serially
Do not fan out blind. First inspect enough local state to learn the natural shape of the work:
- List directories or data sources.
- Read schemas, manifests, READMEs, package boundaries, or route maps.
- Sample representative records/files.
- Count rows, files, modules, routes, messages, or scope size.
- Identify likely independent slices and risky overlap.
This manager-side discovery prevents duplicate worker scopes, blind spots, and mis-sized chunks.
Step 0.5 - Stage and Verify Coverage
Codex subagents inherit the current sandbox, approvals, MCP, and tool access, so remote or messy data does not always need to be staged locally first. Still stage data when it reduces risk or repeated work:
- Export remote/database data once if credentials, rate limits, or query cost would make every worker redo the same setup.
- Normalize noisy inputs once: strip wrappers, binary blobs, boilerplate, and irrelevant logs.
- Pre-chunk huge corpora into exact per-worker files or ranges.
- Keep one scratch dir per run (e.g.
.waves/<run>/withstaging/,handoffs/,synthesis-wave-N.md) so prompts cite paths instead of pasting content and later waves re-read files, not chat history.
Then run a pre-fan-out gate:
- Total rows, files, messages, modules, routes, or records.
- One line per slice with ID/range/path/date bounds and item count.
- Partition-sum check: slice counts add back to the total.
- Duplicate/gap check: no overlapping ranges, missing IDs, bad sort, or empty chunks.
- Central fix-and-recheck if any anomaly appears.
This serial prep is often the largest phase. The parallel fan-out is fast once inputs are clean and coverage is proven.
Step 1 - Decompose into Independent Slices
Size the run itself first, out loud: weigh breadth (how many independent
slices), depth (reasoning per slice), ambiguity (see "Entropy-First
Decomposition"), and stakes (this sets verification tiers), then state the
chosen shape in one line before spawning -- e.g. Run shape: one wave, 4 workers; second wave only if handoffs expose gaps. On the fence between two
shapes, pick the smaller and say so. If no wave is needed, do the task in the
manager thread and say that -- never present inline work as wave coverage.
Choose the split axis that gives each worker clear ownership:
- Data chunks: disjoint ID ranges, date ranges, files, or CSV rows.
- Workstreams: separate technologies, product areas, research questions.
- Repo modules: non-overlapping path sets or package boundaries.
- Audit dimensions: security, performance, correctness, tests, maintainability.
- Verification rows: one claim, citation group, or metric per verifier task.
- Code edits: disjoint file/module ownership, preferably in worktrees for heavier changes.
For a large wave, usually 5 or more workers, state the decomposition plan and the pre-fan-out coverage gate to the user before spawning so they can redirect cheaply.
Respect agents.max_threads. Current Codex docs say it defaults to 6 when
unset. If you need more slices than available threads, batch them into waves.
Then triage each slice on three axes (classify-and-act): the Codex role
(table in Step 2), its dependencies (which slices it needs verified output
from -- most have none; a real dependency edge is what separates waves), and a
verification tier - auto-accept (low-stakes, corroborated) ->
single verifier -> multi-model/multi-pass panel (high-stakes) -> debate
(contested, no ground truth). Spend verification where a wrong claim is expensive,
not uniformly.
Record the triage as a wave manifest - one row per slice (slice | scope | role | effort | depends_on | verification tier), written to the plan or
.waves/<run>/manifest.md before spawning. depends_on defines the wave
boundaries: a wave is every not-yet-run slice whose dependencies are all met,
and a dependency is met only when its handoff has been verified (Step 3),
not merely returned. Launch wave 1 (no dependencies) in parallel; launch each
dependent slice with the distilled, verified findings (or their
.waves/<run>/ path) folded into its self-contained prompt, and keep
unrelated slices parallel. The manifest doubles as the completion gate: N
rows spawned means N handoffs collected and checked off before synthesis
(Step 3). It is also the spawn-plan audit: V2 delegation payloads are
encrypted after dispatch, so the manifest review before spawning is the only
point where a human (or the manager) can inspect what each worker was asked
to do.
Step 2 - Fan Out with Codex Subagents
Spawn all workers whose dependencies are met (handoffs verified, not just
returned) in the same manager turn when possible. In Codex, the stable
interaction is explicit: "spawn one agent per
slice, wait for all of them, then summarize/synthesize." When the active tool
surface exposes direct subagent tools, use those. On the current (V2) surface
the names are spawn_agent, send_message, followup_task, wait_agent,
interrupt_agent, and list_agents; threads resumed from before the V2
runtime instead expose the legacy V1 set (spawn_agent, send_input,
resume_agent, wait_agent, close_agent). Read the live registry and use
whichever set is present.
Pick the smallest capable role:
| Slice | Codex role | Notes |
|---|---|---|
| Read-heavy code/data exploration | explorer |
Best for targeted codebase questions and evidence gathering. Use gpt-5.6-terra (or short-context gpt-5.6-luna) with low reasoning for fast file reads and scans. |
| General research, docs, MCP/web work | default or custom docs researcher |
Codex workers inherit available MCP/tooling. Use a custom agent when the research shape repeats. |
| Implementation or fixes | worker |
Give explicit ownership of files/modules and warn that other workers may be active. |
| Review/security/test-risk audit | custom reviewer | Use read-only sandbox and higher reasoning for correctness/security work. |
| Browser/UI investigation | custom browser debugger | Give browser tooling and ask for evidence, not broad edits. |
| Verification of important claims | custom verifier | Give claim + cited sources, not the generator's reasoning. |
| Many row-shaped tasks | spawn_agents_on_csv |
Experimental; use one CSV row per work item and require report_agent_job_result. |
A missing role is not permission to skip it. Spawning an unknown agent_type
fails with an error rather than falling back, and .codex/agents/ roles load
only in trusted projects -- so when a custom role you want is unavailable in
the active surface, spawn default (or worker/explorer) with that role's
instructions inlined in the worker prompt instead of dropping the role.
On GPT-5.6's V2 runtime, inlined role instructions are the primary pattern,
not the fallback: custom TOML role routing has been unreliable on Sol/Terra
(roles resolving to null, model/sandbox pins ignored -- openai/codex #31814,
#32587, #32782; per-spawn model/reasoning_effort overrides return in
0.145+, honored only when the user, AGENTS.md, or skill instructions
explicitly request them -- which this skill's routing instructions do). V2
also exposes agent_type only when custom agents are registered. So: put the
role in the prompt, state the intended model/effort explicitly per spawn, and
treat TOML as optional tuning to re-verify per release rather than required
setup.
Route both the model tier and the reasoning effort per slice. The GPT-5.6
family (GA 2026-07-09) is the current default: gpt-5.6 (alias for
gpt-5.6-sol, the flagship) for the manager, verifiers, synthesis, and hard
slices; gpt-5.6-terra for lighter/faster subagent work (the official Codex
guidance) and balanced long-context reads; gpt-5.6-luna as the cheapest
option for lightweight, short-context slices -- classification, row-shaped
work, small-chunk reads -- but never long-context reads (Luna's recall
collapses on 256K+ contexts per OpenAI's MRCR tables; note Codex clients
currently treat GPT-5.6 context as 272K anyway, so keep chunks well under
that). Spawn caveat: Luna is still on the V1 runtime, so Sol/Terra V2
parents currently cannot spawn Luna children -- Terra is the cheap tier for
spawned workers; use Luna from the main thread, codex exec fleets, or
CSV fan-out surfaces instead. Terra-vs-Luna is contested among independent
evals; the poles are not: lightweight -> Luna, hard/agentic -> Sol. gpt-5.3-codex-spark (research
preview) remains the near-instant text-only option, and gpt-5.5 /
gpt-5.4-mini remain available as older fallbacks.
Effort ladder (model-dependent at both ends): none, minimal, low,
medium, high, xhigh, max, plus ultra as a Codex product setting (not
an API effort) that runs max with proactive multi-agent (~4 parallel agents,
roughly 3-4x single-agent cost; Plus+ plans; Codex warns about its
concurrency). Use low/medium for scouting and all-around research, high
for coding and verifying, xhigh/max for orchestration, deep problem
solving, and pre-fan-out synthesis; escalate a stuck high-stakes slice to Sol
at max before considering ultra (which also flips delegation to proactive
-- see the native-delegation note above). The live per-spawn field is
reasoning_effort; the config / custom-agent TOML key is
model_reasoning_effort -- set effort on each worker, not only in config. On
0.144.x the V2 per-spawn model/reasoning_effort overrides were hidden
(children silently inherited the parent's model and effort); 0.145+ exposes
them by default, honored when the user, AGENTS.md, or skill instructions
explicitly request routing. Overrides work only on fresh-context spawns --
full-history forks always inherit. Verify what actually ran: children
inheriting the wrong model/effort was the top July-2026 failure mode, so
check each worker's reported model/effort (or judge by output quality)
instead of trusting the requested settings. Speed tier is a user preference:
honor /fast / service_tier if the user enabled it and don't force it;
honor any model/effort the user named, and if a requested model is
unavailable, say so rather than substituting.
Step 3 - Collect and Verify Handoffs
Codex handles spawning, routing follow-ups, waiting, and closing in the manager workflow. Current docs say when many agents are running, Codex waits until all requested results are available and returns a consolidated response.
Completion gate first: check every handoff off against the wave manifest -
N spawned means N accounted for. A worker that never returns, errors out, or
comes back partial/blocked is a hole in the wave. Worker failure
ladder: (1) re-task once, narrower -- steer or continue the same worker
(V2: send_message to pass info without triggering a turn, followup_task to
assign a new turn; legacy V1 threads: send_input, resume_agent) when the
slice just needs continuation, or re-spawn fresh with a narrower scope and a
note about what came back. Re-task the same worker only for continuation of
its own slice -- it keeps its prior context, which contaminates an unrelated
assignment; (2) if it fails again, do that slice in the manager thread; (3) if
it stays blocked, carry the slice into the synthesis explicitly as
not-covered - never average over a missing slice as if coverage were
complete.
Avoid manual polling loops. Continue non-overlapping local work while workers run; wait only when synthesis is blocked on their results. For each handoff:
- Check
Status. - Check
Coverageagainst the assigned slice. - Extract
Key findings, evidence, confidence tags, and source paths/URLs. - Preserve
SourcesandConfidence & verification. - Treat each
Open questionsandSuggested follow-upsbullet as a candidate second-wave task: accept, reject, or consolidate it. Spawning a focused follow-up wave for real gaps is the normal path, not an exception. - Reconcile contradictions across workers before presenting claims as settled.
Run cheap checks on every important finding:
- Evidence is present.
- Cited path/URL/range resolves.
- Evidence actually supports the claim.
- Scope matches the assigned slice.
- Headline counts can be re-counted from source.
- Confidence labels are preserved.
Accept only evidence-backed, scope-correct, non-contradicted findings. Demote,
re-task, or verify the rest. Then compress at the barrier: write the
distilled synthesis to .waves/<run>/synthesis-wave-N.md and work from that
file - next-wave prompts cite paths, never re-paste raw handoffs. Pin the
constraints through the compression: the manifest, stop conditions/budget, and
safety/scope rules are copied verbatim into every synthesis file, never
paraphrased (see "Bounded Waves" anti-poisoning note).
Step 3.5 - Spawn Verifier Passes When Needed
Verification is the manager's highest-leverage job: checking a claim is usually cheaper than generating it, and unchecked errors compound across waves.
Use a dedicated verifier when a claim is high-stakes, contested, surprising, citation-heavy, single-sourced, or low-confidence. Give the verifier:
- The atomic claim.
- The cited source paths/URLs/commands.
- The acceptance question.
- No generator reasoning, and no authorship labels (judges favor output marked as their own; blind them).
The verifier returns supported, partly-supported, unsupported, or
source-not-found per claim. For many claims, prefer spawn_agents_on_csv when
available: one claim per row, fixed JSON result via report_agent_job_result.
If the CSV tool is unavailable, spawn normal verifier subagents in waves under
agents.max_threads.
Step 4 - Second Waves (continuous motion)
Multi-wave is the normal shape, not an exception: a realistic run is often
12 + 3 + 1 workers across three waves rather than one giant burst. Spawn
another wave whenever first-wave handoffs expose:
- Missing coverage.
- Conflicting findings.
- A specialized follow-up that was out of scope.
- A verification task that can run while you synthesize.
- A dependent manifest slice whose
depends_onhandoffs just verified. - A bounded implementation task after research converged.
- A new user request that narrows or redirects the scope.
Repeat until no slice is pending and nothing new surfaces, within the stated budget (see "Bounded Waves" - the manifest is the stop function, not a wave count). Skipping a follow-up wave is legitimate in exactly three cases -- name which one applies when you decide: the remaining open items are primary-source-verified (a verifier can't improve on the evidence), time-gated (unresolvable until an external event; carry them as explicit open items), or genuinely contested (independent quality sources disagree; record the disagreement instead of sampling more).
Sequential second and third waves are spawned by the manager at depth 1 and are
encouraged -- they are NOT what max_depth limits. agents.max_depth (default
1) governs recursion only: a worker spawning its own sub-workers. Keep
recursion off by default and raise agents.max_depth deliberately and tightly
only if a recursive subplanner is truly needed; manager-driven waves need no
such change.
Step 5 - Deliver One Synthesized Artifact
Do not forward raw handoffs as the final answer. Produce the user's requested
artifact: report, roadmap, code patch, audit, decision memo, or implementation
plan. Cite worker evidence when it helps, especially file paths, line numbers,
data ranges, URLs, and unresolved uncertainties. Carry confidence into the final
output: verified, single-sourced, or unverified. Never turn a
low-confidence handoff into a confident sentence.
If implementation is required after the research wave, either:
- Make the edits yourself in the manager thread after reading all handoffs.
- Spawn a bounded implementation wave with disjoint file ownership.
- Use Codex app worktrees or
codex execin separate git worktrees for heavier parallel code attempts.
Verify the deliverable itself:
- Run tests, validators,
curl, screenshots, parsers, or smoke checks as appropriate. - Regression-check sibling routes/files touched by the work.
- Re-read or grep critical files you wrote before relying on them.
- For generated artifacts, prefer a deterministic validator script or schema.
Worker Prompt Contract
Every worker prompt includes:
- Overall goal as context only.
- The worker's exact slice and ownership.
- Where to look: paths, data ranges, URLs, MCP/docs sources, commands, or repo modules.
- Coverage rule: read the assigned slice completely when feasible, report
counts read such as
388/388, and call out skipped files/ranges. - Evidence rule: cite-or-drop every important claim, tag confidence
(
high|med|low), and say what would change the conclusion. - What not to do: avoid owning the whole task, avoid sibling scopes, avoid editing unless explicitly assigned.
- The required handoff format from
references/handoff-format.md- and keep it a digest: roughly 15 findings max with one-line evidence each; large artifacts (tables, logs, full lists) go to a file, cite the path.
End every worker prompt with the copy-paste ending for its worker type
(generic, research, implementation, or verifier) from
references/handoff-format.md § "Prompt endings per worker type".
CSV Fan-Out
Use spawn_agents_on_csv when the work is naturally one row per worker: files,
incidents, packages, PRs, migration targets, messages, customer records, or
claims to verify.
Manager responsibilities:
- Create a CSV with a stable
id_column. - Put enough per-row context in columns for a self-contained prompt.
- Provide an
instructiontemplate with{column_name}placeholders. - Provide an
output_schemawhen downstream synthesis needs machine-readable results. - Require each worker to call
report_agent_job_resultexactly once. - Set
output_csv_path; usemax_concurrencybelow or equal toagents.max_threads.
For a verifier pass, build claims.csv with claim_id, claim, sources,
acceptance_question, and optional stakes. Require JSON fields: verdict,
evidence, source_status, correction, confidence, and gaps.
If the CSV tool is unavailable in the active Codex surface, split the CSV into normal worker or verifier slices and use the handoff format.
Generate-and-Filter and Tournaments
For open-ended ideation or "produce the single best X", generate several candidates and filter rather than trusting one attempt:
- Cheap filter first: gate candidates through a near-ground-truth check (tests,
codex exec --output-schema, schema/exec, dedup/clustering) before spending judge tokens. Generation is cheap; judging is not. - Selection ladder, not all-pairs: dedup/cluster -> shortlist -> pairwise-judge only among finalists. A naive O(N^2) tournament wastes tokens on also-rans.
- Competing implementations: use Codex app Worktree mode or
git worktreeplus onecodex execper attempt, then inspect/test/merge the winner. - Budget check: at equal cost, k independent attempts plus a majority vote or cheap filter usually beats critique/debate loops -- benchmark any iterative loop against that baseline before paying for it.
Parallel Writes in Codex
Codex subagents are a good fit for parallel write work when you use worktrees, separate sandboxes, or disjoint ownership. Still treat write coordination as a real merge problem:
- Read/research/test/log analysis: safe default.
- Disjoint edits in one checkout: acceptable when ownership is explicit and paths do not overlap.
- Overlapping edits: avoid. Have workers propose handoffs, then implement serially.
- Competing implementations: use Codex app Worktree mode, or plain
git worktreeplus onecodex execrun per attempt. - Always inspect and test the merged result in the manager thread.
Native Verification Surfaces in Codex
Use these where they fit:
- Tests, validators, type checks, linters, browser checks, and direct source recounts are the strongest verification signals.
- Custom
verifieragents are the Codex-native replacement for a dedicated verifier worker. spawn_agents_on_csvis ideal for a verifier-per-row pass when exposed.codex exec --output-schemagives machine-readable verification in scripted fleets.- Codex
/review, GitHub code review, and reviewer custom agents help for code risk review. approvals_reviewer = "auto_review"is an approval/security reviewer only; it is not a general claim-verification hook.- Lifecycle hooks exist in config, but current public docs do not confirm a general eval/critic hook for arbitrary worker findings.
Escalating Beyond One Interactive Thread
Use this skill for interactive, bounded fan-out inside one Codex task.
Coordinator Thread Mode (long-horizon, Desktop only)
Codex Desktop threads can receive codex_app.* thread-management tools
(create_thread, list_threads, read_thread, send_message_to_thread,
fork_thread, handoff_thread, set_thread_title, set_thread_pinned,
set_thread_archived). When present, a long-lived coordinator thread can
run waves whose workers are visible, durable Desktop threads instead of
subagents -- useful when a run outlives one task, needs user-clickable worker
threads, or maintains persistent per-module "lanes."
Write it defensively; the tools are undocumented and gated (checked 2026-07-19):
- Availability: Desktop-local threads only, behind a feature flag. Remote,
mobile, and CLI-started threads miss the tools; threads created before the
tools existed resume without them. Probe before fan-out (
tool_searchforcreate_thread); if absent, fall back to normal subagent waves -- never fake thread orchestration. - The coordinator must be a fresh, Desktop-local thread.
codex exec-created threads don't appear in the sidebar orlist_threads. - Same handoff discipline as subagents: message a worker thread and require the
structured handoff back via
send_message_to_thread; neverread_threada full worker transcript into the coordinator -- that is the context pollution this skill exists to prevent. Threads accumulate context forever, so reuse a worker thread only for its own lane, never for an unrelated slice. - Run a heartbeat loop instead of busy-polling: on a fixed cadence check worker status, collect handoffs, re-task or replace stalled workers, and spawn follow-up threads until the manifest is terminal.
- Worktree hygiene: one branch + worktree per worker thread; pin the coordinator; archive workers when merged. Codex keeps ~15 managed worktrees and auto-deletes on archive; the sidebar hydrates only ~50 recent threads, so title workers consistently and track them in the manifest, not the sidebar.
For scripted or CI-style fleets, use codex exec with explicit sandbox and
model settings, often one process per git worktree. codex exec --json and
--output-schema are useful when another script needs stable events or
machine-readable results.
For always-on, team-scale orchestration, use the Symphony pattern: an issue tracker or queue as the control plane, one agent workspace per item, bounded concurrency, retries, observability, and human review. Treat Symphony as a reference/spec pattern, not a drop-in replacement for this interactive skill.
Checklist
- Used
update_planfor multi-wave work. - Discovered the shape of the problem before decomposing.
- Reduced entropy before slicing (dug locally -> pulled from attached resources -> asked the user only if it paid); sliced the low-entropy goal.
- Stated the run shape AND the budget (workers/tokens, not a wave count) in one line before spawning (on the fence -> the smaller shape); never presented inline work as wave coverage.
- Staged or normalized inputs when it materially helps.
- Verified coverage before spawning: counts, bounds, partition-sum, gaps/duplicates.
- Slices are independent (or their
depends_onedges recorded) and sized toagents.max_threads. - Wrote the wave manifest (slice / role / effort / depends_on / verification tier) before spawning; launched dependent slices only after their dependencies' handoffs were verified; checked every row off at collection (completion gate); ran the failure ladder on missing/blocked slices.
- Each worker prompt is self-contained and ends with the handoff contract.
- Picked
explorer,worker,default, custom agents, verifier agents, orspawn_agents_on_csvdeliberately. - Routed scouting / read-heavy waves to a fast low-cost configuration
(
gpt-5.6-terra, orgpt-5.6-lunafor short-context slices only, atlow/medium); reserved Sol + high/max effort for coding, verification, and synthesis; never gave Luna long-context reads. - Avoided manual polling loops; waited only when synthesis was blocked.
- Read every handoff and resolved conflicts.
- Preserved per-finding confidence labels.
- Carried only distilled, verified syntheses between waves (no raw transcripts or losing candidates); pinned the manifest, stop conditions, and budget verbatim through every synthesis/compaction.
- Treated each open question / follow-up bullet as a candidate second-wave task; spawned waves for the ones that change the deliverable, coverage, or confidence; stopped only on completion, stagnation, or budget -- and named which of the three no-second-wave cases applied when skipping a follow-up.
- Verified high-stakes, conflicting, low-confidence, or uncited findings before synthesizing.
- Verified the final deliverable: re-ran/validated and re-read critical writes.
- Produced one synthesized deliverable.
- For edits, verified disjoint ownership or used worktrees.
Open this reference as its own page
Adaptation Notes
These notes record how the Cursor skill was translated into Codex-native terms. They are part of the skill so future edits do not accidentally reintroduce Cursor plumbing.
Verified Codex Sources
Checked on 2026-06-14 with web search, Ref, Exa, current local codex exec --help, and the active tool registry:
- Codex Subagents:
https://developers.openai.com/codex/subagents - Codex Subagent Concepts:
https://developers.openai.com/codex/concepts/subagents - Codex Skills:
https://developers.openai.com/codex/skills - Codex Config Basics:
https://developers.openai.com/codex/config-basic - Codex Config Sample:
https://developers.openai.com/codex/config-sample - Codex App Worktrees:
https://developers.openai.com/codex/app/worktrees - Codex non-interactive mode /
codex exec:https://developers.openai.com/codex/noninteractive - Codex approvals and Auto-review:
https://developers.openai.com/codex/agent-approvals-security - Codex best practices:
https://developers.openai.com/codex/learn/best-practices - OpenAI Symphony post:
https://openai.com/index/open-source-codex-orchestration-symphony/
The active tool registry in this session exposed spawn_agent, wait_agent,
send_input, and close_agent, but not spawn_agents_on_csv, even though
official docs describe it as experimental.
Re-checked on 2026-07-03 against the Codex Config Reference
(https://developers.openai.com/codex/config-reference) and changelog
(https://developers.openai.com/codex/changelog):
features.multi_agentnow documents five collaboration tools:spawn_agent,send_input,resume_agent,wait_agent,close_agent(stable, on by default).resume_agentreopens a closed agent so it can receivesend_input/wait_agentagain.- Custom agents are standalone TOML files (one per file) under
~/.codex/agents/or.codex/agents/; project agents load in trusted projects only. Spawning an unknownagent_typefails with an error — there is no silent fallback (thedefaultrole is used only whenagent_typeis omitted). The skill's "spawndefault/worker/explorerwith the role's instructions inlined" fallback is our recommendation, not documented behavior. agents.max_threadsstill defaults to6,agents.max_depthto1;spawn_agents_on_csvis still experimental (now also documents a per-callmax_runtime_secondsoverride ofagents.job_max_runtime_seconds).
Re-checked on 2026-07-19 against the subagents doc, config reference, Codex changelog, the Responses API multi-agent guide, and the openai/codex source tree (a parallel verification wave with per-claim evidence):
- Official docs no longer enumerate the collaboration tool names. The current
multi-agent V2 surface (code + Responses API multi-agent guide) is
spawn_agent,send_message,followup_task,wait_agent,interrupt_agent,list_agents-- noteinterrupt_agent, notclose_agent. The V1 set (spawn_agent,send_input,resume_agent,wait_agent,close_agent) survives only on threads resumed from before the V2 runtime metadata existed ("Threads created before runtime metadata existed keep the legacy V1 tool surface" -- codex-rs session code). - The documented reasoning-effort ladder on the subagents page is now
none,minimal,low,medium,high,xhigh,max,ultra(higher/lower levels "when the selected model supports" them); the config-reference type string is stale (minimal..xhigh). For the GPT-5.6 API the ladder isnone..max;ultrais a product setting that converts tomaxplus proactive multi-agent. - GPT-5.6 family GA 2026-07-09 (
gpt-5.6aliasesgpt-5.6-sol;-terra,-lunatiers). Official Codex subagent guidance: start withgpt-5.6, usegpt-5.6-terrafor lighter subagent work,gpt-5.3-codex-sparkfor near-instant text-only (Pro). Luna is not recommended for subagents in official docs and has a measured long-context cliff (MRCR 41.3% at 256-512K vs Sol 91.5%). Codex CLI 0.144.4/5 corrected GPT-5.6 context to 272K in clients. - V2
spawn_agentexposes per-spawnmodel/reasoning_effortoverrides only behindmulti_agent_v2.expose_spawn_agent_model_overrides; custom-agent TOML routing always works. V1fork_context/ V2fork_turns(fork parent history into a child) exist in code but are undocumented -- don't build on them. - V2 delegation payloads (
spawn_agent/send_message/followup_taskmessages) are encrypted between model calls, so spawn prompts can no longer be audited from local rollout history. thread/start.multiAgentMode(app-server) shipped June 17 and is already deprecated ("Use Ultra reasoning effort for proactive multi-agent behavior").- Desktop threads can receive undocumented
codex_app.*thread-management tools (create_thread,list_threads,read_thread,send_message_to_thread,fork_thread,handoff_thread,set_thread_title,set_thread_pinned,set_thread_archived) -- Desktop-local + feature-flag gated; remote/mobile/CLI-started threads and pre-feature resumed threads miss them (openai/codex #26907, #25990, #25818 all open). Basis for the SKILL's "Coordinator Thread Mode" and its probe-then-fallback rule.
Native-delegation deep dive, checked 2026-07-19 against codex-rs source at main (commit-level evidence), official docs, and July field reports:
- Delegation mode is derived from reasoning effort per turn
(
core/src/session/multi_agents.rs):ultra-> Proactive, anything else -> ExplicitRequestOnly. The injected explicit-mode policy text is "Do not spawn sub-agents unless the user or applicable AGENTS.md/skill instructions explicitly ask" -- skill text is a first-class, documented delegation trigger;ultrais never required for waves. The deprecatedmultiAgentModeapp-server params are ignored. - V2 eligibility is model-catalog-driven:
gpt-5.6-solandgpt-5.6-terraare V2;gpt-5.6-lunais V1 (so V2 parents cannot spawn Luna children); maintainers state 5.6 roots can only spawn 5.6+ models. - Native V2 spawns default to a full-history fork (
fork_turnsdefaults toall; filtered -- keeps user/system/final-answer messages, drops reasoning and tool output). Full-history forks inherit the parent's agent type, model, and effort and REJECT overrides; fresh-context spawns (fork_turns: none) are the routable shape. Children inherit parent model/effort by default -- the July quota-burn failure mode (#31814: e.g. 888 model invocations / 103.6M input tokens across 3 tasks when Sol-Ultra bred Sol-Ultra children). - Custom TOML role routing was broken on 5.6 V2 at GA (roles ->
agent_role: null, model and sandbox pins ignored -- #31814, #32587, #32782). 0.145+ re-exposes per-spawnmodel/reasoning_effortwith baked guidance to honor them "only when explicitly requested by the user, applicable AGENTS.md instructions, or skill instructions" (maintainer: "the model is not good enough yet to judge"). V2 exposesagent_typeonly when custom agents are registered. Consequence: inlined role instructions + explicit per-spawn model/effort requests are the primary pattern; TOML is optional tuning. - V2 does not enforce
agents.max_depth; the binding limit ismulti_agent_v2.max_concurrent_threads_per_session(default 4 including the root;agents.max_threads + 1when set). V2 has noclose_agent; lifecycle verbs arefollowup_task,send_message,wait_agent,interrupt_agent,list_agents. - Codex CLI/app does NOT use the server-side Responses API multi-agent beta
(no
multi_agentrequest field anywhere in codex-rs); all orchestration is client-side. The hosted beta is a parallel implementation of the same six actions for API developers. - Encrypted V2 delegation payloads + children hidden from
/agentmean post-hoc transcript audits are gone; the wave manifest is the spawn-plan audit, reviewed before dispatch.
What Stayed Portable
- Mental model: discover -> stage -> verify coverage -> decompose -> fan out -> handoffs -> verify claims -> synthesize -> second waves.
- Manager/worker separation.
- Worker isolation as a prompting discipline: one slice, one handoff, no sibling assumptions.
- Parallel reads as the safest default.
- Fixed handoff format.
- Verification layer: pre-fan-out gate, cheap handoff checks, confidence labels, verifier workers, deliverable validation, and escalation.
- Decomposition recipes: data chunks, multi-stream research, repo audit, and parallel implementation with explicit ownership.
- Continuous motion until every slice is terminal or explicitly out of scope.
- Entropy-first decomposition: reduce uncertainty (dig locally, then attached resources, then ask the user only if it pays) before slicing; cascade a decomposition wave into an execution wave; order the plan least-to-most.
- Paper-grounded technique detail, mirrored with the Cursor skill: probe
selection that halves the surviving interpretations; ask-vs-act thresholds;
factored self-verification with open check questions; sample-and-vote with
agreement as a confidence flag; judge blinding (no authorship labels, both
orderings); disjoint-family judge panels; atomic-fact checks with
self-contained rewrites; citation URL-health passes. Sources listed in
references/verification.md("Grounding") andreferences/examples.md. - Skill evals: both variants ship
evals/evals.json+ fixtures following the Anthropic skill-creator format (prompt + expected_output + expectations, graded PASS/FAIL with evidence against with-skill vs baseline transcripts). - Run mechanics, mirrored with the Cursor skill: the wave manifest (slice /
role / effort / depends_on / verification tier) doubling as the completion
gate; the worker failure ladder (steer/resume or re-spawn narrower once ->
do it in the manager thread -> carry as
not-covered); the.waves/<run>/scratch-dir convention withsynthesis-wave-N.mdcompression at the barrier; handoff digest caps; and the SWE recipes (implement-a-reviewed-plan, row-shaped codemod, CI-failure triage) inreferences/examples.md. Codex keeps worker prompt endings inreferences/handoff-format.md§ "Prompt endings per worker type". - Run-shape triage (state the shape in one line before spawning; on the fence
pick the smaller; never present inline work as wave coverage) and
dependency-aware dispatch (
depends_onin the manifest; a wave is every slice whose dependencies are met, where met means the dependency's handoff has been verified, not merely returned; dependents launch with distilled findings folded into their prompts). Both portable as-is; adapted from reviewing Phillip Chaffee's publicdeep-researchCursor skill (github.com/PhillipChaffee/.cursor), then re-verified against current Cursor and Codex docs.
Cursor-to-Codex Swaps
| Cursor source idea | Codex-native replacement |
|---|---|
Task tool with subagent_type (backgrounded where the surface supports it) |
Explicit Codex subagent delegation: spawn one agent per slice, usually in one manager turn, then wait/synthesize. Current V2 tool names: spawn_agent, send_message, followup_task, wait_agent, interrupt_agent, list_agents (legacy V1 on old resumed threads: send_input, resume_agent, close_agent). The stable user-facing contract is "spawn N agents, wait for all, consolidate." |
| Parallel background Task fan-out (formerly labeled "Multitask Mode") | Codex subagent workflows in the app/CLI. Current docs say Codex waits for all requested subagent results and returns one consolidated response. |
explore |
Built-in explorer for read-heavy exploration. Unlike Cursor's original note, do not assume this is offline/no-MCP; Codex subagents inherit sandbox/tooling, and custom agents can set sandbox_mode = "read-only". |
generalPurpose |
Built-in default, built-in worker, or a custom agent such as docs_researcher depending on the task. |
shell |
Usually built-in worker with shell access inherited from the session, or a custom shell-heavy worker. |
best-of-n-runner |
Codex app Worktree mode, or plain git worktree plus one codex exec run per attempt. There is no exact local built-in named best-of-n-runner in the verified Codex docs. |
TodoWrite |
Codex update_plan. |
Frontmatter disable-model-invocation: true |
Included for the cross-vendor opt-in default (Cursor and Claude Code read it to require explicit /waves-codex invocation, since a run spawns more agents than usual). Codex itself discovers skills by metadata and only spawns subagents when explicitly asked, so the field is inert there but harmless. |
~/.cursor/skills/<name>/ |
Current Codex docs document repo .agents/skills, user $HOME/.agents/skills, admin /etc/codex/skills, and system bundled skills. Ray's local memory shows ~/.codex/skills may exist as a symlink/plugin compatibility path, but $HOME/.agents/skills is the better global authoring target. |
| "End your turn and wait for completion notifications" | Ask Codex to spawn, wait for all requested workers, and consolidate. In direct tool mode, continue useful manager-side work and wait only when blocked; do not busy-poll. |
| "Stage remote data because read-only workers are offline" | Reconciled. Codex workers may have full tool/MCP/network access depending on session config, so staging is an optimization and safety move, not always a requirement. |
| "Local workers share one filesystem, so parallel writes are dangerous" | Reconciled. Codex can use isolated sandboxes/worktrees and manager-mediated merging, making parallel writes safer. Still avoid overlapping edits unless using worktrees or isolated codex exec runs. |
/orchestrate cloud plugin via Cursor SDK |
codex exec fleets for scripts/CI, Codex app worktrees for local parallel code, and the Symphony pattern for always-on issue-tracker orchestration. |
Data-chunk fan-out by many background Task calls |
spawn_agents_on_csv when each row maps to one worker and the experimental tool is available; otherwise normal explorer waves. |
| Dedicated verifier worker | Custom Codex verifier agent, normal explorer/default verifier prompts, or spawn_agents_on_csv verifier-per-row batch when available. |
Missing subagent_type fallback: custom .cursor/agents/ files register only after a Cursor restart, so an unregistered role runs as generalPurpose with its instructions inlined |
Unknown agent_type fails the spawn (no silent fallback) and .codex/agents/ loads in trusted projects only, so an unavailable role runs as default/worker/explorer with its instructions inlined. Either way, a missing role is not permission to skip it. |
| Re-task a failed/partial worker by resuming its agent ID (context preserved) before re-spawning | V2: send_message to pass info without triggering a turn, followup_task to assign a new turn to the same worker (V1 threads: send_input / resume_agent); re-spawn fresh only when the context itself is the problem. Same-slice continuation only -- a re-tasked worker keeps its old context. |
| "Verify before you trust" | Codex manager runs pre-fan-out gates, cheap handoff checks, separate verifier waves, and final deliverable validation. |
| Recursive subplanner idea | Dropped from the default. Current docs say agents.max_depth defaults to 1; raise it only for explicit recursive delegation. |
| Entropy-first decomposition (dig locally then attached resources then ask only if it pays; scouting wave then execution wave; least-to-most) | Portable as-is; update_plan replaces TodoWrite for the living plan. |
"Route scouting/read waves to Composer 2.5 (fast) via the model field" |
Route scouting/read waves to gpt-5.6-terra at low effort (or short-context gpt-5.6-luna; gpt-5.3-codex-spark / gpt-5.4-mini as lighter fallbacks) via custom-agent TOML or the per-spawn reasoning_effort field. model_reasoning_effort is the config/TOML key. service_tier / /fast is a user-enabled speed tier, not a forced default. |
Things That Do Not Translate Exactly
- Codex docs do not present
exploreras a hard offline mode. It is a role, not an air-gapped worker. Use sandbox and MCP configuration to shape actual access. - Codex docs caution that write-heavy parallel workflows can still conflict. Worktrees are the reliable isolation boundary for serious parallel code attempts.
spawn_agents_on_csvis documented as experimental and may not be exposed in every Codex surface or session. Keep a non-CSV subagent fallback.- I did not find a current public Codex doc for a general arbitrary-claim
verifier/eval/critic hook. Codex Auto-review exists, but it evaluates approval
requests at the sandbox/security boundary only. Codex GitHub review and
/revieware code-review surfaces, not general handoff verification. - Custom agent TOML is documented, but the docs note the format may evolve as authoring and sharing mature.
~/.codex/skillsmay be present in local/plugin flows, but the current official skill authoring locations emphasize.agents/skillsand$HOME/.agents/skills.- Codex effort has two field names: the live per-spawn
spawn_agentfield isreasoning_effort, while the config / custom-agent TOML key ismodel_reasoning_effort.service_tier(fast/flex) and the/fasttoggle are user-facing speed levers, not general model routing. Reasoning levels arenone,minimal,low,medium,high,xhigh,max(model-dependent at both ends;ultrais a product setting layered onmax);gpt-5.6-terra,gpt-5.3-codex-spark, andgpt-5.4-miniare lighter/faster options for read-heavy subagent work.
Why the Final Skill Is Opinionated
This port keeps the original orchestration discipline, but changes the local gotchas:
- The safest default remains read-heavy fan-out.
- Staging remains useful for clean inputs and repeatability, not because every worker is offline.
- Verification is now a first-class step because unchecked worker errors compound across waves.
- Parallel implementation is allowed only with clear ownership or worktrees.
- The default config keeps
max_depth = 1to prevent accidental recursive explosion. max_depth = 1caps recursion only (a worker spawning its own workers). It does not cap manager-driven sequential waves: continuous motion across second and third waves at depth 1 is preserved from the Cursor skill and is the expected shape. Do not let the recursion cap leak into "spawn fewer waves" -- the gated "only important / if needed" phrasing was deliberately reverted to Cursor's "each bullet is a candidate second-wave task."
Open this reference as its own page
Worked Example and Decomposition Recipes
Worked Run: Analyze Messages and Build a Roadmap
Goal: read a user's message history, find patterns/goals/frustrations, research the relevant product stack, and produce a roadmap.
The upgraded reference pattern is multi-wave, not one burst: 16 workers across 3 waves.
- Wave 1: 8 message chunks, 1 workspace reader, 3 research streams.
- Wave 2: 3 focused Convex deep-dives after the user narrowed scope.
- Wave 3: 1 iOS MVP worker after synthesis exposed a concrete product slice.
The serial staging phase was the largest phase: export, clean, chunk, verify counts and date ranges, fix a timestamp-sort issue, then fan out.
Step 0 - Discover Serially
- Locate the data store: SQLite, JSONL, exports, or transcript files.
- Read schema and sample messages.
- Count rows and date coverage.
- Inspect nearby workspace memory/config if relevant.
- Verify the pre-fan-out gate: chunk counts sum to the total, each chunk has disjoint bounds, no duplicates/gaps, and date ranges make sense.
- Result: about 3,000 messages, chunked into 8 equal message-count ranges, plus 4 research or workspace streams.
Step 1 - Decompose
- 8 data-chunk workers: equal message-count ranges, not equal calendar time.
- 1 workspace reader: memory/config/workspace files.
- 3 research workers: realtime voice stack, Notion/platform SDK, iOS/on-device options.
Step 2 - Fan Out with Codex Subagents
Use explicit manager wording:
Spawn 12 Codex subagents in parallel and wait for all of them before synthesis.
Use explorer agents for the 8 read-only message chunks and workspace reader.
Use docs/research-capable agents for the 3 stack research streams. Each worker
must return the research/analysis handoff format from references/handoff-format.md,
including Coverage and Confidence & verification sections.
Example data worker prompt:
Overall goal, context only: find patterns, goals, frustrations, and recurring
workflows in a user's chat history with their assistant to inform an app roadmap.
Your slice: messages with id 1001-1500 only in /path/to/messages.sqlite.
Do: read only that disjoint range. Extract recurring topics, stated goals,
repeated pain points, and workflows the user performs often. Quote message id
and date as evidence.
Coverage rule: report messages read as <actual>/<assigned>. If you skip any
message, list why.
Verification rule: cite-or-drop every finding, tag confidence high|med|low, and
separate verified, inferred, single-sourced, and unresolved claims.
Do not: analyze other message ranges, write files, or produce the final roadmap.
Return exactly the research/analysis handoff format.
Example research worker prompt:
Overall goal, context only: build a low-latency realtime voice companion app.
Your slice: research realtime voice stack options only, including current OpenAI
Realtime APIs, proxy/SDK options, and latency tradeoffs. Use available docs/web
or MCP tools. Include source URLs and dates where relevant.
Verification rule: use live/current sources, not training data. Cite-or-drop
claims, tag confidence high|med|low, and say what could not be verified.
Do not: compare all roadmap options or write implementation code.
Return exactly the research/analysis handoff format.
Step 3-5 - Collect, Verify, Spawn Next Waves, Deliver
- Read all handoffs; check coverage against assigned slices; spot-check citations and source paths; recount headline numbers from the source data.
- Send contested, high-stakes, or citation-heavy claims to a verifier worker.
- Merge recurring themes across message chunks; separate evidence-backed patterns from one-off observations; reconcile stack-research conflicts by source quality and date.
- Spawn the next wave from what the handoffs surfaced -- treat each
Suggested follow-upsbullet as a candidate task. Here that is Wave 2 (3 Convex deep-dives once the user narrowed scope) and then Wave 3 (1 iOS-MVP worker once synthesis exposed a concrete slice). Planning for a second and third wave is the default, not the exception. - Synthesize the roadmap yourself from the merged, verified handoffs.
Recipe: Decomposition of a Vague Build
Use when a single high-level request ("build a Flappy Bird game") must expand into understanding + plan + subtasks.
- Locate the entropy. Specification unknowns (web or native? which engine/framework? scope -- one screen, score, difficulty curve?) vs environment unknowns (what is already in the repo? build tooling? asset pipeline?).
- Reduce it cheaply. Dig locally (read the repo, package manifest, existing
scaffolding). For anything the repo cannot answer, spawn a small scouting wave
(one
explorerper candidate engine/framework) on a fast low-effort model, and verify. State assumptions for specification gaps ("web canvas, vanilla TS, one screen + score") instead of blocking -- ask only the one question whose answer would change the whole plan. - Decompose least-to-most. The plan is now low-entropy: game loop -> render pipes/bird -> input + gravity -> collision -> score/state -> polish. First-order subtasks first; each verified piece lowers uncertainty for the next.
- Execute in waves. Build with disjoint-ownership
workers (or serially -- see "Parallel Writes in Codex"), verify the artifact, and open another scouting sub-wave only where a subtask is still high-entropy.
Recipe: Data-Chunk Fan-Out
Use for large corpora: messages, tickets, logs, transcripts, documents, or analytics rows.
- Discover total size and schema.
- Split into disjoint ranges or files.
- Verify total count, per-slice bounds, gaps/overlaps, and partition sum.
- Spawn one
explorerper chunk, or usespawn_agents_on_csvwhen one row maps cleanly to one worker. - Require coverage and evidence identifiers in every finding.
- Merge into themes, counts, outliers, and follow-ups; spawn a focused second wave for the follow-ups that change the deliverable.
CSV-shaped prompt:
Create /tmp/messages.csv with columns chunk_id, start_id, end_id, db_path.
Then use spawn_agents_on_csv if available:
- csv_path: /tmp/messages.csv
- id_column: chunk_id
- instruction: "Analyze messages {start_id}-{end_id} in {db_path}. Return JSON
with status, scope, coverage, key_findings, sources,
confidence_and_verification, open_questions, and suggested_follow_ups via
report_agent_job_result."
- output_csv_path: /tmp/message-analysis-results.csv
- max_concurrency: 6
Verifier pass:
Create /tmp/claims.csv with columns claim_id, claim, sources, acceptance_question.
Then use spawn_agents_on_csv if available:
- csv_path: /tmp/claims.csv
- id_column: claim_id
- instruction: "Verify claim {claim_id}: {claim}. Check only these sources:
{sources}. Answer this acceptance question: {acceptance_question}. Return JSON
with verdict, evidence, source_status, correction, confidence, and gaps via
report_agent_job_result."
- output_csv_path: /tmp/claim-verification-results.csv
- max_concurrency: 6
Recipe: Multi-Stream Research
Use for comparisons and roadmaps.
- Define one worker per technology, vendor, API, or approach.
- Workers research their own option only.
- Require source URLs, version/date notes, and confidence labels.
- Split huge topics when one question list would blow context.
- The manager performs the comparison and recommendation.
Good slices:
- "Research OpenAI Realtime and current SDK/proxy constraints."
- "Research Notion API/SDK fit for this workflow."
- "Research iOS background audio and on-device model constraints."
- "Research Convex auth and limits."
- "Research Convex core idioms."
- "Research Convex components and ecosystem fit."
Recipe: Whole-Repo Audit
Use for broad audits where one lens would be slow or noisy.
Split by dimension:
- Security and auth.
- Data correctness.
- Performance and concurrency.
- Dead code and dependency risk.
- Test coverage and CI gaps.
Or split by module:
apps/webapps/apipackages/dbpackages/ui
Default to read-only explorer or custom reviewer agents. The manager produces
a severity-ordered report with file references and confidence labels.
Recipe: Parallel Implementation
Use only when ownership is clear.
Safer patterns:
- One
workerowns frontend components, another owns backend API, another owns tests. - One worktree per competing implementation.
- One
codex execprocess per git worktree for scripted attempts. - One verifier or reviewer pass checks the merged result before final delivery.
Risky patterns:
- Multiple workers touching the same file family.
- Multiple workers changing shared contracts without a manager-owned design.
- Workers editing before discovery converges.
Recipe: Implement a Reviewed Plan (Plan -> Edit Wave -> Verify Wave)
The end-to-end SWE shape -- three waves with different jobs:
- Wave A -- spec. A small wave (or the manager alone) turns the goal into a
written plan: ordered subtasks, explicit file ownership per subtask,
Done when:criteria. Verify it (the artifact-then-bigger-wave shape); the verified plan is the contract every edit worker anchors to. - Wave B -- disjoint edits. One
workerper plan subtask with strictly disjoint path sets (or one worktree per competing design). Each prompt carries the plan excerpt for its subtask, its exact paths, the "you are not alone" warning, and the code/edit handoff format. Usehigheffort. - Wave C -- verify. Read-only workers run the oracles: tests, type checks, lint, a reviewer pass over the combined diff, regression checks on sibling routes. Route failures back as narrow fix tasks (bounded -- don't loop). The manager merges, re-reads critical files, and delivers.
Interleave cheaply: Wave C slices that only touch Wave B's finished subtasks
can start while slower edits finish. Keep the plan in update_plan and the
per-subtask status in the wave manifest.
Recipe: Codemod / Migration Across Many Files (Row-Shaped)
When the same mechanical change applies to N files/callsites (rename an API, swap a client, migrate a schema field):
- Stage the target list. Grep/list the exact targets into
.waves/<run>/targets.csv(path, symbol, line hints). Verify the count -- the list is the coverage gate. - Fan out the edits:
spawn_agents_on_csvwith one row per target (or batches of 3-8workers each owning a disjoint file subset when the CSV tool is unavailable); prompts point at list rows, not pasted code. - Verify by oracle, not prose: after each batch, re-run the grep (old pattern count must fall to the expected residue), then tests/type checks. A row-shaped run with a cheap oracle is the one place going wider than usual is safe.
Recipe: CI-Failure Triage (Diagnosis, Then One Fix Wave)
For a red CI run with several failing jobs: one read-only explorer per
failing job/log bundle (disjoint), each returning root-cause hypothesis +
evidence (log lines, commit range) + confidence. The manager dedupes root
causes across jobs (one bad commit often explains several failures), sends
contested diagnoses to a verifier, then runs a single fix wave with disjoint
ownership -- and re-runs CI as the deliverable check.
Wave Shapes
A wave is not one move - pick the shape from how much you know about the problem.
- Decomposition / scouting wave (reduce entropy before the big wave): when the goal is vague or high-entropy ("build a Flappy Bird game", "make it faster"), the first wave's job is to reduce uncertainty, not build. Dig locally, then fan a small scouting wave at the unknowns (stack, constraints, current APIs, repo shape) on a fast low-effort model, verify, and only then decompose the low-entropy version into the execution wave. See "Entropy-First Decomposition."
- Exploratory wave (you don't know the shape yet): when the space is unmapped (QA, an unfamiliar repo, "what's wrong here?"), send a broad first wave - many workers probing different surfaces/flows at once. Its job is to find the edges, not finish. Verify what's real; now you know the shape.
- Shaping wave (narrow as you learn): the next wave is more focused - kill dead ends, double down on what had teeth. Each wave spends the previous wave's findings instead of re-guessing.
- Artifact-then-bigger-wave: a small wave writes an architecture doc; verify it; then a much bigger wave builds against the verified spec. The small wave de-risks the big one; the artifact keeps the big wave from poisoning itself.
- Divergent research wave: send workers in genuinely different directions on the same question, let them return independently, then verify across them. High token value with no cross-contamination - separate contexts mean the directions don't poison each other.
Human-in-the-loop is optional by design: read the synthesis and shape the next wave yourself, or let the verifier gate it automatically.
Anti-Patterns
- Fan out before discovering the shape of the task.
- Slice a high-entropy goal before reducing its uncertainty. Vague goals decompose into overlapping, mis-sized slices; dig locally -> pull from attached resources -> ask only if it pays, then slice (see "Entropy-First Decomposition").
- Fan out before verifying coverage.
- Give workers vague prompts and hope they infer context.
- Ask workers to "figure out the whole thing" instead of owning one slice.
- Let workers compare across sibling options; the manager owns cross-cutting synthesis.
- Trust
Status: success; it is a claim, not evidence. - Embed giant verbatim artifacts in a handoff. Write large artifacts to disk and cite the path instead.
- Skip re-reading critical files you wrote.
- Stop after one wave when handoffs surfaced real, deliverable-changing
follow-ups. Multi-wave (
12 + 3 + 1) is the expected shape, not one burst. - Treat
agents.max_depth > 1as a default. Recursive fan-out (workers spawning their own workers) is expensive and unpredictable -- but this caps recursion only; the manager launching sequential second and third waves at depth 1 is encouraged, not capped. - Assume parallel writes automatically merge. Use disjoint ownership or worktrees.
- Forward raw handoffs as the final answer.
Grounding (Why Entropy-First Works)
Framing decomposition as uncertainty reduction is well-supported, and each source contributes a usable mechanism -- not just a citation:
- Prefer the probe that halves the surviving interpretations. Uncertainty of Thoughts (UoT, arXiv 2402.03271, NeurIPS 2024) scores candidate questions by expected information gain and shows the best probe is the one that splits the remaining hypotheses ~50/50 (binary-answer entropy peaks at an even split). Swapping that entropy reward into a tree search -- not the search itself -- carried most of its +38% average success gain. Manager use: aim scouts at the unknown whose answer eliminates the most plans, not the one easiest to look up.
- Ask only when the value of asking clears a threshold. SAGE-Agent (arXiv 2511.08798) prices each candidate question by expected value of perfect information minus a redundancy cost, asks only when that beats a fraction of its confidence in the best current interpretation, and acts once that confidence passes an execute threshold. Penalizing redundant questions cut questions asked ~18-27% with under 3% quality loss -- over-asking is measurably wasteful. This paper is also the explicit source of the specification-vs-model uncertainty split.
- Judge "is the goal fully specified?" before acting, and err toward asking. arXiv 2606.19559 gates clarification on a specification-uncertainty score emitted before choosing an action; a conservative ask-threshold silently failed (recall collapsed), while a generous one cost little. Two honest caveats it adds: every extra self-assessment channel taxed task success slightly, and verbalized confidence ran overconfident -- treat self-reported scores as rankings, not probabilities. ("Resolve environment unknowns by gathering via tools" is this skill's operational extension, not that paper's mechanism.)
- Order the plan least-to-most; invest in the decomposition itself. Least-to-Most (arXiv 2205.10625, ICLR 2023) solves subproblems in sequence, each answer feeding the next; its gains concentrate on deep problems (5+ dependent steps -- shallow tasks gain nothing), and its own error analysis shows the decomposition step, not the solving, is the bottleneck -- and that decompositions don't transfer across domains. Plan-and-Solve (arXiv 2305.04091, ACL 2023) shows plan-then-execute cuts missing-step errors but leaves misread-goal errors untouched -- which is exactly why the specification check above comes before planning.
These are single-model prompting results. The parallel fan-out, the
verification gates between waves, and "each verified result lowers uncertainty
for the next" are this skill's multi-agent adaptation -- the verification half
is grounded separately in references/verification.md.
Open this reference as its own page
Worker Handoff Format
A worker's final message is its handoff. Put everything important in it; intermediate output may be invisible, noisy, or too expensive for the manager to reconstruct. End every worker prompt by pasting one of these templates and saying "Use exactly this structure."
Research / Analysis Worker
Use this for data analysis, web/MCP research, code reading, audits, test triage, and design investigation.
## Status
success | partial | blocked
## Scope
<the exact slice this worker owned: data range / area / paths / question>
## Coverage
- Assigned: <expected rows/files/ranges/questions>
- Read: <actual rows/files/ranges/questions, e.g. 388/388 lines>
- Skipped: <anything not read and why, or "none">
## Key findings
- [high|med|low] <finding> -- evidence: <file:line | msg id+date | URL | metric | command output summary> -- sources agreeing: <N>
- [high|med|low] <finding> -- evidence: <...> -- sources agreeing: <N>
## Sources
- <paths read, data ranges covered, URLs/docs fetched, commands run>
## Confidence & verification
- Verified: <findings re-run, recounted, or cross-checked with >=2 independent sources>
- Single-sourced: <claims supported by one source only>
- Inferred: <claims not independently checked>
- Unresolved / could not verify: <claims or citations that did not resolve>
- Would change my conclusion: <missing evidence or falsifier>
## Open questions / gaps
- <anything ambiguous, missing, contradictory, or out of scope that the manager should resolve, often by spawning a follow-up task>
## Suggested follow-ups
- <concrete next tasks the orchestrator should consider spawning>
Code / Edit Worker
Use only when the worker has disjoint ownership, a separate worktree, or an explicit isolated workspace.
## Status
success | partial | blocked
## Changed
- <path>: <what changed and why>
## Verification
<one of: live-verified | test-verified | type-check-only | not-verified>
- <command run -> outcome / test pass-fail counts>
## Confidence & risk
- Verified: <what was directly checked>
- Unverified: <what still needs testing/review>
- Risk: low | med | high -- <why>
## Notes & deviations
- <assumptions, surprises, broken invariants, merge concerns, anything the parent must know>
## Suggested follow-ups
- <concrete next tasks the orchestrator should consider>
Verifier Worker
Use this when a worker's only job is to check another handoff's claims. Give it the claim and cited sources, but not the original worker's reasoning.
## Status
success | partial | blocked
## Scope
<claims checked, source set, and acceptance question>
## Verdict per claim
- <claim id or claim> -> supported | partly-supported | unsupported | source-not-found
- evidence: <quote, file:line, metric, command output, or "none">
- source checked: <URL/path/command> (resolved: yes/no)
- confidence: high | med | low
- correction: <corrected claim or "drop">
## Overall
accept | revise | reject -- <one line why>
## Gaps
- <sources unavailable, ambiguous wording, missing oracle, or checks not run>
CSV Batch Worker Result
When using spawn_agents_on_csv, each row worker should call
report_agent_job_result exactly once with JSON that mirrors the same contract.
Keep fields short enough to fit in the exported CSV.
{
"status": "success | partial | blocked",
"scope": "<row id and exact slice>",
"coverage": {
"assigned": "<expected>",
"read": "<actual>",
"skipped": "<none or details>"
},
"key_findings": ["<finding with evidence>", "<finding>"],
"sources": ["<path/url/range/command>"],
"confidence_and_verification": {
"verified": ["<claim>"],
"single_sourced": ["<claim>"],
"inferred": ["<claim>"],
"unresolved": ["<claim>"]
},
"open_questions": ["<gap>"],
"suggested_follow_ups": ["<task>"]
}
Verifier CSV rows should return JSON with:
{
"claim_id": "<id>",
"verdict": "supported | partly-supported | unsupported | source-not-found",
"evidence": "<quote, file:line, metric, command output, or none>",
"source_status": "<resolved yes/no plus notes>",
"correction": "<corrected claim or drop>",
"confidence": "high | med | low",
"gaps": ["<missing source/check>"]
}
Prompt Endings per Worker Type
End every worker prompt with the generic block, plus the add-on for its type:
Generic (all workers):
Return only the structured handoff from references/handoff-format.md. Use
exactly the headings. Include concrete evidence and confidence for every
important claim. Flag anything you could not verify.
Research workers, add:
Use live/current sources when the fact may have changed. Do not rely on training
data for versioned APIs, pricing, schedules, product behavior, or current docs.
Flag anything you could not verify.
Implementation workers, add:
You are not alone in the codebase. Other workers may be active. Own only the
files/modules listed above, do not revert changes you did not make, and adjust
to nearby changes if you encounter them.
Verifier workers, add:
Your job is verification, not generation. Check only the assigned claim(s)
against the provided source(s) or oracle(s). Do not use the original worker's
reasoning. Return supported, partly-supported, unsupported, or source-not-found
with exact evidence.
How the Manager Reads a Handoff
Statusis notsuccess: decide whether to retry, narrow scope, repair inputs, or mark the limitation in the final synthesis.Coverage: verify the worker covered exactly its slice.Key findings: every important claim needs evidence and a confidence tag. Claims without traceable evidence are unverified.Sources / Confidence & verification: preserve them so later waves and the final deliverable can trace evidence. Route low-confidence, single-sourced, contested, or unresolved citations to a verifier.Open questions / Suggested follow-ups: the richest section -- treat each bullet as a candidate second-wave task and accept, reject, or consolidate it. Spawning a focused follow-up wave for real gaps is the normal path, not an exception.
Why a Fixed Shape
Uniform handoffs let many isolated workers converge without cross-talk. The manager can merge evidence mechanically instead of re-deriving structure from freeform prose.
Carrying a Handoff Into the Next Wave
When one wave feeds another, pass forward only a distilled, verified handoff --
the accepted findings plus a one-line critique -- never raw transcripts or
rejected candidates. Long, irrelevant context measurably degrades the next
wave's reasoning; the synthesize barrier is where you compress. Multi-wave is
the normal shape, not an exception: a realistic run is often 12 + 3 + 1
workers across waves, each wave spending the previous wave's verified findings.
One exception to compression: constraints are pinned, never summarized. The wave manifest, stop conditions/budget, and safety/scope rules travel verbatim through every synthesis file and compaction -- measured compaction behavior silently drops in-context constraints (violations rising from 0% to 30-59% post-compaction; pinning restores 0% -- arXiv 2606.22528).
Open this reference as its own page
Recommended Codex Configuration
Use this as a starting point for the waves-codex workflow. Put shared
defaults in ~/.codex/config.toml or repo-specific settings in
.codex/config.toml for trusted projects.
Read First: Native Delegation on GPT-5.6 (config is optional now)
On GPT-5.6 Sol/Terra (the V2 multi-agent runtime), the primary steering surface is prompt and skill text, not config: delegation triggers on direct asks and "applicable AGENTS.md or skill instructions," and per-spawn model/effort routing is honored when explicitly requested the same way. Custom TOML role routing has been unreliable on V2 (roles resolving to null, model/sandbox pins ignored -- openai/codex #31814, #32587, #32782; per-spawn overrides restored in 0.145+ as explicit-only). Practical stance:
- Everything below still works for V1 surfaces,
codex execfleets, and as declarative documentation of your intended roles -- but on 5.6 V2, treat TOML as optional tuning and inline each role's instructions and intended model/effort in the worker prompt (the skill's default pattern). - Do not set
ultrafor wave runs: it flips delegation to proactive (spawns outside your manifest) and its children inherit ultra. - V2 ignores
agents.max_depth; the binding limit is concurrent agent slots (4 including the manager by default,agents.max_threads + 1when set -- keepingmax_threads = 6below yields 7 slots). - Luna is still V1: Sol/Terra parents cannot spawn Luna children. Terra is
the cheap tier for spawned workers; use Luna from the main thread or
codex exec. - After each Codex release, re-verify which spawn parameters
(
agent_type,model,reasoning_effort, fork behavior) are actually exposed before relying on them -- this surface has changed three times in July 2026 alone.
Default Manager/Worker Setup
# Manager default. gpt-5.6 is the alias for gpt-5.6-sol (flagship); route
# cheaper tiers (gpt-5.6-terra, gpt-5.6-luna) per worker role and scale
# depth with reasoning effort. Orchestration benefits from extra-high reasoning.
model = "gpt-5.6"
model_reasoning_effort = "xhigh"
[features]
# multi_agent enables the subagent collaboration tools. In current Codex it is
# Stable and defaults to true, so this line is optional -- keep it for clarity.
multi_agent = true
[agents]
# Current Codex default is 6 when unset. Keep it explicit for this workflow.
max_threads = 6
# Current default is 1: root can spawn direct children, children cannot recurse.
# This caps recursion only; manager-driven second/third waves at depth 1 are
# unaffected and encouraged (see SKILL "Step 4 - Second Waves").
max_depth = 1
# Default per-worker timeout for spawn_agents_on_csv jobs.
job_max_runtime_seconds = 1800
Recommended defaults (GPT-5.6 family, GA 2026-07-09; gpt-5.6 = Sol flagship,
gpt-5.6-terra = balanced/cheaper, gpt-5.6-luna = fastest/cheapest):
- Manager/orchestrator:
gpt-5.6withxhigheffort for complex problem solving, orchestration, deep thinking between steps, and synthesis before fan-out. Escalate tomaxfor the hardest quality-first passes; usemediumonly for simpler manager passes. - Read-heavy / scouting / decomposition workers:
gpt-5.6-terrawithloweffort for the fast reads, greps, counting, scans, and doc lookups that reduce entropy before you slice (this matches official Codex guidance for lighter subagent work).gpt-5.6-lunais even cheaper for short-context slices, but never give Luna long-context reads -- its recall collapses on 256K+ contexts (OpenAI MRCR tables).gpt-5.3-codex-spark(research preview) is the near-instant text-only option;gpt-5.4-miniremains an older lightweight fallback. - Research/all-around workers:
gpt-5.6-terrawithmediumeffort (step up togpt-5.6when the stream is ambiguous or high-stakes). - Implementation workers:
gpt-5.6withhigheffort. - Reviewer/security/verifier workers:
gpt-5.6withhigheffort. max_threads: keep6as the default. Raise only for simple read-heavy work on a machine and rate-limit budget that can handle it.max_depth: keep1. Raise to2only for deliberate recursive delegation with strict instructions and budget awareness.
Effort field names, ladder, and speed tier:
- The documented effort ladder is
none,minimal,low,medium,high,xhigh,max(model-dependent at both ends).ultrais a Codex product setting, not a config value: it runsmaxwith proactive multi-agent (~4 parallel agents, roughly 3-4x single-agent cost) -- reserve it for a single unresolved high-stakes slice, if ever. - The live per-spawn field is
reasoning_effort; the config / custom-agent TOML key ismodel_reasoning_effort. Set the effort on each spawned worker, not only in config. (V2 exposes per-spawnmodel/reasoning_effortoverrides only whenmulti_agent_v2.expose_spawn_agent_model_overridesis enabled; custom agent TOML always works.) - Context note: Codex clients currently treat GPT-5.6 context as 272K tokens (the API long-context billing threshold) -- size read slices well under that.
- Speed/priority is a user preference. If the user has enabled Codex fast /
priority processing (
/fast, orservice_tier = "fast"/"flex"), it applies; do not force a tier on the user.
Optional Custom Agents
Codex supports standalone custom agent TOML files under ~/.codex/agents/ for
personal agents or .codex/agents/ for project agents. Each file needs name,
description, and developer_instructions. Optional fields such as model,
model_reasoning_effort, sandbox_mode, mcp_servers, and skills.config
inherit from the parent when omitted.
.codex/agents/parallel-explorer.toml
name = "parallel_explorer"
description = "Fast read-heavy explorer for bounded codebase, data, and log slices."
model = "gpt-5.6-terra"
model_reasoning_effort = "low"
sandbox_mode = "read-only"
nickname_candidates = ["Atlas", "Kepler", "Noether", "Turing", "Hopper", "Lovelace"]
developer_instructions = """
Stay in exploration mode. Own only the assigned slice.
Prefer rg, targeted file reads, schema inspection, and concise evidence.
Do not edit files.
Return the requested structured handoff with coverage, confidence, and concrete sources.
"""
.codex/agents/docs-researcher.toml
name = "docs_researcher"
description = "Documentation researcher that verifies APIs, versions, and current behavior through available docs/MCP/web tools."
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Verify current API and framework behavior from primary documentation when possible.
Include source URLs and call out uncertainty or date-sensitive details.
Do not edit files unless explicitly assigned.
Return the requested structured handoff with confidence labels.
"""
[mcp_servers.openaiDeveloperDocs]
url = "https://developers.openai.com/mcp"
.codex/agents/parallel-worker.toml
name = "parallel_worker"
description = "Implementation worker for one explicitly owned file or module slice."
model = "gpt-5.6"
model_reasoning_effort = "high"
developer_instructions = """
Own only the assigned files/modules.
You are not alone in the codebase: other workers may be active.
Do not revert changes you did not make. Keep unrelated files untouched.
Run focused verification for your slice and return the code/edit handoff.
"""
.codex/agents/reviewer.toml
name = "reviewer"
description = "Read-only reviewer for correctness, security, regressions, and missing tests."
model = "gpt-5.6"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Review like an owner.
Prioritize correctness, security, behavioral regressions, and missing tests.
Lead with concrete findings and evidence.
Avoid style-only comments unless they hide a real bug.
Return the requested structured handoff.
"""
.codex/agents/verifier.toml
name = "verifier"
description = "Read-only verifier for checking claims against cited sources, commands, counts, or current docs."
model = "gpt-5.6"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
nickname_candidates = ["Verifier", "Crosscheck", "Evidence"]
developer_instructions = """
Your job is verification, not generation.
Check only the assigned claims against the provided sources, commands, or docs.
Do not inspect the generator's reasoning unless explicitly asked.
Return supported, partly-supported, unsupported, or source-not-found per claim.
Quote or cite the exact evidence that settles each verdict.
If evidence is missing or ambiguous, say so and mark confidence low.
Do not edit files.
"""
Registering Custom Agents from Config
Standalone files in .codex/agents/ are the simplest convention. If you want a
config file to declare roles explicitly, Codex's sample config also supports:
[agents]
max_threads = 6
max_depth = 1
[agents.parallel_explorer]
description = "Fast read-heavy explorer for bounded slices."
config_file = "./agents/parallel-explorer.toml"
nickname_candidates = ["Atlas", "Kepler", "Noether"]
[agents.reviewer]
description = "Find correctness, security, and test risks."
config_file = "./agents/reviewer.toml"
nickname_candidates = ["Ada", "Grace"]
[agents.verifier]
description = "Verify claims against cited evidence without seeing generator reasoning."
config_file = "./agents/verifier.toml"
nickname_candidates = ["Verifier", "Crosscheck"]
Paths in config_file are relative to the config.toml that defines them.
Verification Defaults
Recommended acceptance bars for this workflow:
- Pre-fan-out: counts, slice bounds, partition-sum, gaps/duplicates.
- Every handoff: evidence resolves, scope matches, confidence labels preserved.
- High-stakes claims: verifier worker or CSV verifier pass.
- Code edits: tests or type checks plus a diff review.
- Generated files: parser/schema/validator where possible.
- Final response: keep
verified,single-sourced, andunverifieddistinct.
Codex-native helpers:
spawn_agents_on_csvfor row-shaped verification when available.codex exec --output-schemafor scripted claim-check outputs.approvals_reviewer = "auto_review"only for approval/security review; do not treat it as a general verifier.web_search = "live"or MCP docs tools when current sources are required.
codex exec Fleet Pattern
For scriptable parallel writes, create one git worktree per attempt/slice and
run one codex exec per worktree:
git worktree add ../repo-auth-audit -b audit/auth
git worktree add ../repo-api-audit -b audit/api
codex exec --cd ../repo-auth-audit --sandbox workspace-write \
--model gpt-5.6 -c 'model_reasoning_effort="high"' \
"Audit and fix auth slice only. Return a code/edit handoff."
codex exec --cd ../repo-api-audit --sandbox workspace-write \
--model gpt-5.6 -c 'model_reasoning_effort="high"' \
"Audit and fix API slice only. Return a code/edit handoff."
Use --json for event streams and --output-schema when a script needs
machine-readable results.
Skill Location Guidance
Current official Codex skill authoring locations:
- Repo-local:
.agents/skills/<skill-name>/ - User-global:
$HOME/.agents/skills/<skill-name>/ - Admin/system:
/etc/codex/skills/ - Bundled system skills: shipped with Codex
Ray's local setup has previously used a ~/.codex/skills to $HOME/.agents
symlink/plugin path, so ~/.codex/skills/<skill-name>/ may work on this
machine. For a portable Codex-native skill, prefer $HOME/.agents/skills or
repo .agents/skills.
Open this reference as its own page
Verification Playbook
Verification is the manager's highest-leverage job in a multi-agent run.
Workers generate candidate findings; the manager decides what is allowed into
the synthesis. A worker's Status: success is a claim, not evidence.
The core idea: capability is roughly base capability x gradeable signal.
Checking a claim is often much cheaper than producing it, and multi-wave work
compounds errors. One unchecked bad handoff can contaminate every later
decision.
This playbook is strongest on objective, checkable work: counts, code, tests, facts with sources, citations, generated files, deployments, and metrics. For taste or judgment, verify the sub-claims and evidence; do not fake a crisp grade for subjective preference.
1. Verify Before You Spawn
Run a pre-fan-out gate after discovery/staging and before delegation:
- Count total rows, messages, files, routes, modules, or records.
- Print each slice's bounds: ID range, date range, path set, or question set.
- Confirm partition sums: all slice counts add back to the total.
- Check gaps and overlaps: no duplicate ranges, missing rows, empty chunks, or bad sort order.
- Fix centrally, then re-run the gate.
Example:
total messages: 3097
chunk-1: ids 1-388, 388 msgs, 2026-03-10..2026-03-22
chunk-2: ids 389-776, 388 msgs, 2026-03-22..2026-04-03
...
partition sum: 3097/3097
duplicates: 0
gaps: 0
If the gate does not reconcile, do not spawn workers yet.
2. Cheap Checks on Every Handoff
Every handoff gets a fast manager-side pass:
- Evidence exists for each key finding.
- File paths, URLs, message IDs, commands, or metrics resolve. Research workers hallucinate roughly 3-13% of citation URLs and 5-18% don't resolve at all; a cheap URL-health pass before trusting links cuts non-resolving citations to under 1%.
- The cited evidence actually supports the claim.
- Scope matches the assigned slice.
- Headline numbers can be re-counted or queried.
- Findings do not contradict another worker without being marked contested.
- The worker carried confidence tags and unresolved gaps.
Accept only findings that are evidence-backed, scope-correct, and not contradicted. Re-task or verify the rest (often a quick follow-up wave); demote only when re-checking isn't worth it.
3. Push Self-Checks Into Worker Prompts
Make every worker do cheap verification before returning:
- Cite-or-drop every important claim.
- Mark per-finding confidence:
high,med, orlow. - Report coverage:
read 388/388,checked 12/12 files, or explain skips. - Use live/current sources for versioned APIs, pricing, schedules, product behavior, laws, and docs.
- Flag anything it could not verify.
- For a single important number, pick, or label (not prose), re-derive it independently several times (5-10 samples with real sampling variation, not repeated greedy calls) and report the majority plus how many agreed. Most of the gain arrives in the first handful; low agreement is itself a low-confidence flag.
- For a top claim, factored self-verification: draft, list open check questions ("When did X ship?", not yes/no -- models tend to agree with whatever a yes/no question asserts), answer each in a fresh context without the draft, cross-check the answers against the draft, then revise.
Avoid vague "double-check yourself" prompts. Self-correction without an external signal degrades reasoning -- models flip correct answers to wrong more often than the reverse. Give the worker an external check: a test, query, source URL, schema, command, count, or separate verifier. Never let a retry loop's stop condition peek at the expected answer (that measures the answer key, not the worker). Budget rule: at equal cost, k independent samples plus a majority vote usually beats critique/debate loops -- benchmark any added loop against that baseline.
4. Use Dedicated Verifier Workers
Verification is a narrower job than generation. Spawn a verifier when a claim is:
- High-stakes or user-actionable.
- Citation-heavy.
- Surprising, contested, or contradictory.
- Low-confidence or single-sourced.
- A number, benchmark, count, or pass/fail claim the synthesis depends on.
Give the verifier:
- Atomic claim(s).
- Cited sources or commands.
- Acceptance question.
- Any required current-doc lookup.
Do not give it the generator's reasoning. That makes it less likely to inherit the same mistake.
Make the verifier's job robust:
- Reference-guided + chain-of-thought: give it a rubric or reference and have it reason step-by-step before the verdict. Removing the reference is the biggest judge-accuracy drop; CoT-before-verdict helps broadly.
- Anti-gaming: never show the generator the verifier's rubric, and prefer a verifier that can re-derive/execute over one that re-reads prose (verifiers get gamed; over-optimizing a weak proxy verifier makes true quality fall).
- Hide authorship and order: never tell the verifier which worker or model produced a claim -- judges strongly prefer whatever is labeled as their own, and swapping the label flips the preference. For pairwise comparisons, run both orderings and average; paraphrasing a candidate before judging also blunts self-preference.
- Keep the judge on task: for reference-matching checks ("does the answer match the staged data?"), instruct the verifier to match against the reference only and not inject outside knowledge -- strong models over-reason on what is essentially entailment checking.
- Different model (optional, strongest): a same-model verifier can self-prefer even with an isolated context -- models recognize and favor their own output, and the more capable the model, the stronger the effect. For the highest-stakes calls, ask the user for a different model family as the verifier; a small panel of judges from disjoint model families (majority vote on binary verdicts, average on scores) beat a single frontier judge on human agreement while cutting intra-model bias and cost. (Planned as a default in a later version pending testing; for now an opt-in escalation - don't guess model slugs.)
The verifier returns:
supportedpartly-supportedunsupportedsource-not-found
For many claims, prefer spawn_agents_on_csv when available: one row per claim,
fixed JSON result via report_agent_job_result. If unavailable, spawn normal
custom verifier agents in bounded waves.
5. Measure and Cross-Check
Prefer direct oracles over prose review:
- Run tests, type checks, linters, validators, parsers, or smoke scripts.
- Recount from source data rather than trusting a summary.
- Re-run queries or regexes for headline numbers.
- Use at least two independent sources that ENTAIL the claim before treating it as verified - check entailment, don't just count citations (a citation being present is not the claim being supported; even strong models lack full citation support on roughly half of long-form answers). Agreement compounds only under real independence: three independent ~90%-accurate checks give ~97% by majority vote, but a shared model family or shared search results breaks the assumption - diversify both.
- Split long claims into atomic facts, rewrite each to be self-contained (resolve pronouns and vague references - the step most retellings skip), and verify each separately. Sentence-level checks are too coarse: a large share of sentences mix supported and unsupported facts. A cheap model with search access is a strong fact-rater (it beat crowdworker annotators at a fraction of the cost); the verifier does not need to be frontier-class when it has an oracle to consult.
- Panel / multi-pass cross-check: for a high-stakes or contested claim, run it across several independent passes (or different models, if the user approves) and synthesize consensus vs lone-result. That extra spawning is worth it for claims the deliverable hinges on.
For docs/current behavior, use primary sources first. For Codex/OpenAI details,
prefer developers.openai.com/codex and current local CLI/tool behavior.
6. Verify the Deliverable
Before declaring done:
- Run or validate the thing produced.
- For web/UI, check local routes, status codes, console errors, screenshots, and sibling-route regressions.
- For documents/configs/diagrams, run parsers or schema validators when possible.
- Re-read or grep critical files you wrote; do not assume a write landed.
- Confirm deployment or infra state after command success.
- Keep unverified claims labeled in the final output.
7. Acceptance and Escalation
Use this ladder:
- Auto-accept: high-confidence, evidence-backed, source-resolving, corroborated.
- Verify: medium confidence, single source, important citation, contested.
- Escalate: low confidence, unresolved, contradictory, high-stakes.
Escalation order:
- Re-task narrower.
- Spawn a verifier.
- Use a higher-reasoning verifier.
- Ask the user (who may pick a stronger model). Mark the limitation explicitly only as a last resort, after re-tasking and verifier passes are exhausted.
Never launder low confidence into confident prose. Final claims should be marked
verified, single-sourced, or unverified when the distinction matters.
Codex-Native Verification Surfaces
exploreror a custom read-onlyverifieragent for local source checks.defaultor custom docs researcher for current docs/web/MCP source checks.spawn_agents_on_csvfor verifier-per-row batches when available.codex exec --output-schemafor scripted verification artifacts.- Tests, validators, shell commands, browser checks, and direct file reads.
- Codex
/reviewand GitHub code review for code-risk review. approvals_reviewer = "auto_review"for approval/security review only. It does not verify arbitrary claims.
Current public docs checked on 2026-06-14 do not confirm a general Codex claim-verification, eval, or critic hook that automatically grades subagent handoffs. Treat verifier agents and external oracles as the portable path.
Grounding (Sources for the Techniques Above)
- Factored self-verification and open-not-yes/no check questions: Chain-of-Verification, arXiv 2309.11495 (Findings of ACL 2024).
- Sample-and-majority-vote with agreement as a confidence flag: Self-Consistency, arXiv 2203.11171 (ICLR 2023).
- Intrinsic self-correction degrades reasoning; debate loses to self-consistency at matched budget; never gate a loop on the answer key: arXiv 2310.01798 (ICLR 2024).
- Atomic-fact decomposition with self-contained rewrites and search-backed rating: SAFE / LongFact, arXiv 2403.18802 (NeurIPS 2024).
- Judges recognize and favor their own output; hide authorship, swap orderings: arXiv 2404.13076 (NeurIPS 2024).
- Panel of judges from disjoint model families beats one big judge on human agreement, bias, and cost: PoLL, arXiv 2404.18796 (industry preprint).
- Citation presence is not claim support; check entailment: FActScore, arXiv 2305.14251; ALCE, arXiv 2305.14627 (both EMNLP 2023).
- Research agents fabricate 3-13% of citation URLs; URL-health passes fix most: arXiv 2604.03173.
- Verification-driven replanning as the orchestration-level coordination signal; stop on completeness / diminishing returns / budget, not fixed iteration caps; most replans are retries of incomplete slices: VMAO, arXiv 2603.11445.
- Verification as a scaling axis (continuous verifier scores improving along score granularity, repeated evaluation, criteria decomposition): LLM-as-a-Verifier, arXiv 2607.05391.
- Centralized verification contains error amplification (4.4x under a coordinator bottleneck vs 17.2x for unchecked independent agents; multi-agent hurts sequential-reasoning tasks): arXiv 2512.08296.
- Compaction silently drops in-context constraints (0% -> 30-59% violations post-compaction; pin constraints verbatim through summaries): Governance Decay, arXiv 2606.22528.
- Team-size scaling: homogeneous teams plateau (hard ceiling for instruct-class models on bounded tasks, correctness level; diversity is the lever; an N<=5 pilot identifies the regime): arXiv 2606.02646; 2 diverse agents can match 16 homogeneous: arXiv 2602.03794.
- Convergence-based early stopping beats fixed
max_iterationsat parity quality; per-round judge gating is counterproductive: arXiv 2606.27009.
More in this playbook
Sf ai agentforce
Agentforce Builder metadata path for Builder-managed topics/actions, Prompt Builder templates, GenAiFunction/GenAiPlugin, Models API, and custom Lightning types. TRIGGER when: user maintains or configures Builder metadata agents, creates topics/actions, works with Prompt Builder templates, or touches .genAiFunction, .genAiPlugin, or .genAiPromptTemplate metadata XML files. DO NOT TRIGGER when: Agent Script DSL .agent files (use sf-ai-agentscript), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).
Agentic workflowsMITSf ai agentforce grid
Use this skill whenever users want to build, inspect, debug, automate, or publish workflows in Agentforce Grid (AI Workbench) using Salesforce plus the Grid MCP or direct Grid REST calls. Trigger it for Grid workbook creation, worksheet setup, Object/Reference/AI/Agent/AgentTest/Evaluation/PromptTemplate/InvocableAction column design, prompt drafting inside Grid, worksheet execution troubleshooting, Grid YAML `apply_grid` specs, and Windows-specific Grid setup issues. Also use it when users mention AI Workbench, Grid Studio, workbook IDs, worksheet IDs, Grid Connect, or ask for recipes like "top opportunities with AI email drafts", "agent test suite in Grid", or "build this worksheet from YAML". Do not use it for generic Salesforce work unrelated to Agentforce Grid.
Agentic workflowsMITSf ai agentforce observability
Agentforce session tracing extraction and analysis. TRIGGER when: user extracts STDM data from Data Cloud, analyzes agent session traces, debugs agent conversations via telemetry, or works with .parquet files from Agentforce. DO NOT TRIGGER when: testing agents (use sf-ai-agentforce-testing), Apex debug logs (use sf-debug), or building agents (use sf-ai-agentforce).
