Log in

Codex operating guide · September 13, 2026

Codex Subagents: Parallel Work Without Token Waste

Use a strong primary agent for decisions, cheaper bounded workers for independent evidence, and one verification gate before the work ships.

TM
Tony MartinsSeptember 13, 2026
16 min read
Build the workflow
codex://subagent-orchestration3 bounded lanes
PrimaryDecide
ExploreTerra · read-only
evidence
InventoryLuna · read-only
evidence
VerifyTerra · read-only
evidence
PrimarySynthesize + verify
Independent lanes · compact handoffs · one integrated result

Direct answer

Parallel agents change three different numbers.

Elapsed timecan fall
Total tokensusually rise
Creditsdepend on routing

Codex subagents can finish independent work sooner while consuming more total tokens. The economic win is not free computation: it is the option to buy bounded evidence on cheaper worker models while the strongest model keeps the decisions.

01

The three ledgers

Separate speed, tokens, and cost

OpenAI's current Codex documentation says subagent workflows consume more tokens than comparable single-agent runs because every child performs its own model and tool work. At the same time, independent lanes can run concurrently and can use a different model from the primary agent.

Serial elapsed time
A + B + C

Every lane waits for the previous one.

Parallel elapsed time
split + max(A, B, C) + merge + proof

The slowest independent lane plus coordination.

Parallelism wins only when the lanes are genuinely independent and the cost of decomposition, coordination, and integration is lower than waiting for their sum. A fleet can make all three metrics worse when scopes overlap or every worker needs the previous answer.

Workflow creditsorchestrator+Σ workers+coordination + retries
02

The spawn decision

Pass the delegation gate before spawning anything

The first two answers are mandatory. If either is no, keep the work in the primary thread.

01

Independent?

Can this lane proceed without frequent synchronization?

mandatory
02

Checkable?

Can it return a concrete result the primary agent can verify?

mandatory
03

Read-heavy?

Is it read-only or isolated by file, module, branch, or worktree?

strong preference
04

Worth it?

Does the likely benefit exceed explanation, merge, and review overhead?

strong preference

Good first lanes include codebase mapping, documentation research, log triage, independent test investigation, and focused review. Keep ambiguous requirements, sequential work, and changes in one hot file together.

If the task is not understood well enough to split, establish its boundaries first with an implementation-ready Codex Plan Mode workflow. Delegation should execute a decision-complete task graph, not multiply an unresolved prompt.

03

The control plane

The orchestrator keeps every cross-cutting decision

Primary agent owns
  • User goal, constraints, and non-goals
  • Architecture and product trade-offs
  • Task graph and ownership boundaries
  • Contradictions, integration, and acceptance
Worker owns
  • One bounded question
  • A concrete evidence trail
  • Known risks or contradictions
  • One recommended next action

The primary agent should not repeat the same investigation “just in case.” It waits for the required evidence, checks it, resolves disagreements, and asks a focused follow-up only when the result is incomplete.

Compact worker result

  1. Answer
  2. Evidence: files, symbols, commands, or primary sources
  3. Risks or contradictions
  4. Recommended next action
04

The useful shapes

Parallelize breadth, not dependency chains

01

Exploration fan-out

Split an unfamiliar system by non-overlapping questions and return one evidence map per lane.

02

Independent review lenses

Assign correctness, security, regression, and test-gap questions—not several generic reviewers.

03

Test and log sharding

Investigate independent suites, packages, logs, or time ranges with objective deliverables.

Keep these serial

  • each lane needs the previous answer
  • several writers touch the same hot files
  • the task is “look around and improve things”
  • workers can recursively create an unbounded review tree

Avoid having every worker rerun the entire repository build. Give each lane targeted checks, then run the required integrated validation once after the findings or changes are combined.

05

The model router

Match the subagent model to the shape of the lane

Without explicit configuration, Codex subagents inherit the parent model and reasoning effort. That is convenient, but it can make a fleet of simple workers as expensive as the orchestrator.

Starting model-routing policy—not a capability guarantee
RoleSuitable workStarting modelBoundary
Primary decision-makerAmbiguity, architecture, synthesis, acceptanceStrongest justifiedTask-level
Judgment-heavy workerExploration, debugging evidence, focused reviewGPT-5.6 TerraRead-only
Mechanical workerInventory, extraction, classification, test shardingGPT-5.6 LunaRead-only
Primary writerCoherent implementation and integrated fixesMatch complexityOne owner

Escalate a worker when its lane needs broader context or difficult judgment. Do not save credits by routing a security decision or cross-cutting architecture choice to a model that cannot reliably close it.

06

The rate card

Cheaper workers reduce rates—not the amount of work

OpenAI's September 12, 2026 credit rate card makes the routing opportunity visible, but it does not predict the cost of a complete task.

Credits per million tokens · reviewed September 12, 2026
ModelInputCached inputOutput
GPT-5.6 Sol10010500
GPT-5.6 Terra505300
GPT-5.6 Luna50.530
20×Luna versus Sol input rate
≈16.7×Luna versus Sol output rate
not 95%a whole-task saving cannot be derived from one rate cell

A weaker worker may need more context, more attempts, or expensive recovery. A vague fan-out can also multiply the same repository scan across every child. Compare the measured cost and outcome of the complete workflow, not one cell in the table.

The goal is not fewer tokens at any cost. It is cheaper evidence, less duplication, and faster decisions where parallel work actually fits.

07

The operating contract

Start with one explicit prompt, then make routing durable

You do not need a large catalog of personas. Start with the smallest fan-out that maps to real independent questions. Add another worker only when it owns a new lane.

One-shot delegationThree bounded lanes
Use up to three Codex subagents only for independent work.

- explorer: map the affected code paths; read-only; return file and symbol evidence.
- test analyst: find relevant tests and gaps; read-only; return exact commands and risks.
- docs researcher: verify current external APIs; read-only; return primary-source links.

Keep requirements, architecture, implementation, synthesis, and final verification in the primary
thread. Do not duplicate a worker's task. Wait for all required results, resolve conflicts, then
return one integrated plan. Workers must not spawn more workers.

The number three is an example, not an ideal fleet size. The active task boundary matters more than the role name, so each worker still receives a full contract.

Worker contractRead-only evidence lane
Role: read-only API compatibility researcher.
Question: which endpoints and fields change in the target framework version?
Scope: official framework documentation and the repository's API adapter only.
Non-goals: no implementation, dependency updates, or broad architecture proposal.
Evidence: primary-source links plus exact adapter files and symbols.
Output: answer, evidence, contradictions, recommended next action; under 500 words.
Stop: report a blocker if the version or target adapter cannot be established.
Do not spawn subagents.

Global defaults

Bound concurrency and inheritance

The value four below is a conservative example, not an official default. It caps open worker threads; it does not tell Codex to use all four.

Codex configurationExample [agents] defaults
[agents]
max_concurrent_threads_per_session = 4
default_subagent_model = "gpt-5.6-terra"
default_subagent_reasoning_effort = "medium"
Fast explorerNarrow mechanical work
# .codex/agents/fast-explorer.toml
name = "fast_explorer"
description = "Read-only inventory, extraction, and targeted code searches."
model = "gpt-5.6-luna"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Answer only the delegated question. Return concise file and symbol evidence.
Do not edit files, expand scope, or spawn subagents.
"""
Focused reviewerJudgment-heavy evidence
# .codex/agents/reviewer.toml
name = "reviewer"
description = "Focused correctness and regression review with concrete evidence."
model = "gpt-5.6-terra"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Prioritize real correctness and regression risks. Cite files, symbols, and reproduction steps.
Return findings only; do not modify code or spawn subagents.
"""

Project agents live under .codex/agents/; personal agents live under ~/.codex/agents/. Current Codex precedence considers explicit spawn choices,[agents] defaults, parent values, and the selected custom-agent file. Specify both model and reasoning effort when the pairing matters.

08

The write boundary

Context isolation is not file isolation

Subagents inherit the active sandbox and permission mode and may observe the same mutable checkout. Separate conversation threads therefore do not protect files from concurrent edits.

01Agent context

Separate exploration thread and compact return value.

not file isolation
02Shared checkout

Workers may observe the same mutable files and branch.

read-only by default
03Disjoint ownership

Writing lanes own explicit files or modules.

stop outside scope
04Separate worktree

Branch-level isolation for truly concurrent writers.

verify cwd + branch

One current Codex issue reports parent and subagent threads observing different branch state in a shared checkout. It is one report, not proof of universal behavior. The guardrail is still cheap: every writing lane states its expected working directory and branch, verifies both, and stops instead of guessing when they disagree.

09

The correction matrix

Fix the economic failure, not just the prompt

Codex subagent symptom-to-correction matrix
SymptomWorkflow failureBounded correction
Primary and worker inspect the same filesDuplicate ownershipAssign one owner; wait for evidence.
Every child inherits the strongest modelMissing model routingSet defaults or an explicit agent model.
Workers return pages of logsWeak result contractReturn answer, evidence, risks, next action.
A worker continues the parent taskRole driftRestate role, question, non-goals, and no implementation.
Several workers edit the same codeShared write boundaryUse one writer, disjoint ownership, or worktrees.
Reviews create more reviewsUnbounded delegation treeForbid nested agents and cap concurrency.
Tokens or compactions grow abnormallyRuntime or scope failureStop workers, inspect status, preserve evidence.
Worker findings conflictMissing synthesis ruleCompare evidence; primary agent decides.

Public reports include role drift, shared-checkout branch drift, abnormal token amplification, and duplicated local rollout history. They justify monitoring and stop conditions, but they do not establish normal Codex behavior or a universal token multiplier.

An external Anthropic engineering report reaches a compatible architectural conclusion: its orchestrator-worker research system fit breadth-first independent work, consumed substantially more tokens, and fit dependent coding work less well. Those measurements apply to that research system—not Codex.

10

The adjacent layer

Use Supercode at the two adjacent bottlenecks

Native Codex provides subagents, model routing, thread controls, and custom-agent configuration. Supercode is not the source of that orchestration.

Before fan-out

Make the handoff durable

Supercode Specs & Docs can keep boundaries, acceptance criteria, and ownership visible across agents and sessions.

During tool work

Reduce a separate noise layer

Token Optimization targets noisy or repetitive command output; Max also targets redundant exploration and avoidable rework.

11

The release gate

Run this preflight before the primary agent accepts the work

  • Every worker owns an independent question with a checkable deliverable.
  • The primary thread retains requirements, decisions, synthesis, and acceptance.
  • The model and reasoning effort match the lane instead of inheriting accidentally.
  • Read-only is the default; writing lanes are isolated.
  • Every writing lane checks cwd, branch, and status before editing.
  • Worker prompts include scope, non-goals, evidence, output, and stop conditions.
  • Nested delegation is forbidden unless it is explicitly bounded.
  • Workers return compact evidence rather than raw exploration history.
  • The primary agent resolves contradictions and runs integrated validation.
  • Token and credit usage are observed after the run instead of assumed.

If the task cannot pass the independence and deliverable gates, use one Codex thread. The cheapest subagent is the one you did not need to spawn.

Evidence boundary

Sources and version notes

Reviewed September 12, 2026 against current first-party documentation, independent context research, and directional user reports. Codex behavior, model names, configuration, and rates are version-sensitive.

Build the operating layer

Keep the expensive model focused on decisions

Add durable handoffs and a separate tool-output optimization layer around native Codex orchestration.

Install Supercode for Codex