Coordinate heterogeneous MultiAgentV2 task trees with `update_plan`, `spawn_agent`, `assign_task`, `send_message`, `list_agents`, and built-in `explorer`/`worker` roles. Hand only homogeneous leaf batches to `$mesh`.
Use $teams when a task is still composite and parallelism helps, but keep the workflow aligned with how Codex actually works:
update_plan tracks the shared checklist.spawn_agent handles heterogeneous delegation and should use explicit task_name values when the teammate will receive follow-up work.assign_task and send_message are the live task-handoff tools; keep both available and choose based on whether the target should run now or queue the note.list_agents, wait_agent, and close_agent manage the live task tree after it exists.explorer answers specific codebase questions.worker owns bounded execution with explicit ownership.codex/agents/ are specialist edges only: selector, coder, fixer, prover, integrator, and peripheral joiner.reducer, , , ) are compatibility-only and should not receive new work.mentorlocksmithapplier$st should hold the claimed wave and runtime/proof metadata before workers start.Canonical name: use $teams in policy text and examples.
Plan first, execute second: use $teams to shape or challenge the work, then delegate bounded leaf tasks.
Use $teams for composite work:
Do not reach for $teams just because multiple tools exist. If the work is already one repeated row template, use $mesh instead.
$teamsUse $teams when:
Stay local instead when:
Use $mesh instead when:
$mesh.spawn_agents_on_csv is a better fit than long-lived teammates.thread/start, thread/resume, thread/fork, and turn/start.collabToolCall items, not as a separate public teams protocol.worker or /root/worker.$teams should therefore stay close to the native collab tools and roles instead of inventing a second orchestration stack.update_plan and identify the current ready set, not just the next critical-path step.
$st is the default handoff: import the OrchPlan and claim the ready wave in $st first.$st handoff. If a helper still exists, it must auto-route into the same durable path internally.wait_agent.explorer for specific repository questionsworker for bounded edits or verification with explicit ownershipselector only for explicit $select-class source shapingcoder only for parse-first author/judge orchestration when specialist output is actually neededfixer for mandatory winner review/repair when you would otherwise chain reviewer + mentor behaviorprover for apply-plus-proof in a temp worktreeintegrator for scoped delivery packaging after proofjoiner only for GH-only PR routing workflowscodex/skills/select/references/lock-roots.md.task_name values for teammates that will receive follow-up work, and use task paths rather than raw thread ids when the path is stable.wait_agent only when you are actually blocked, prefer longer waits over polling, and do not immediately call wait_agent after the first spawn if more ready branches remain.assign_task and send_message with equal weight when reusing context: assign_task wakes the target now, while send_message queues a note without forcing immediate execution.list_agents when you need to confirm the live task tree or filter by task-path prefix before routing a follow-up.Request:
Compare the thread API with the collab tool surface. Have one teammate inspect docs and another inspect runtime code, then recommend the native path.
Good $teams execution:
explorer with a stable task name such as docs_scan to inspect API docs and examplesexplorer with a stable task name such as runtime_scan to inspect runtime handlers and tool specswait_agent only when blocked, then combine both findings into one recommendationWhy $teams:
Request:
Add a new config-backed CLI flag that touches parser wiring, config loading, help/completion output, and focused validation. Use teammates where helpful.
Good $teams execution:
worker with a stable task name for parser/flag wiring in a disjoint CLI scopeworker with a stable task name for config loading changes in a disjoint config scopeworker with a stable task name for help/completion output in a disjoint shell/help scopeworker with a stable task name for focused validation in a disjoint test scopelist_agents if you need to verify the live tree before sending follow-up work by task pathwait_agent only after the full ready wave is in flight, then integrate and close the agentsWhy $teams:
$mesh would be the wrong tool$teams to $meshRequest:
Audit 300 markdown files for missing frontmatter and export one result row per file.
Good split:
$teams or local work first to decide the audit rule, CSV columns, and output fields$mesh$mesh run one audit per row and review the output CSV locallyWhy the handoff:
$mesh.fork_context: false for fresh-eyes research or review.$parse once in the parent, freeze the worker packet, and keep fork_context=false unless a specific child truly needs the same history, constraints, or diff.fork_context: true only when the child truly needs the same history, constraints, or diff.assign_task, send_message, wait_agent, and close_agent calls can target paths cleanly.worker agents they are not alone in the repo and must not revert other edits.$st before any spawn and record runtime/proof back into that ledger.thread/fork branches a conversation; it is not a substitute for worker delegation.wait_agent immediately after the first spawn when additional ready branches remain.$teams as a hidden batch engine; once the work is a uniform row job, hand it to $mesh.reducer with coder approach=reduce, mentor with fixer, applier with prover, and keep write coordination local instead of using locksmith.Close a $teams run only when:
If you cannot meet one of these, report what is missing.
When teams actually ran, include a short Orchestration Ledger section in prose.
Use concise event-only lines such as:
Skills usedSubagentsArtifacts producedCleanup statusOmit the section entirely when no team orchestration ran.
$meshIf teams discovers that the remaining work is a uniform batch job, hand off narrowly:
Do not invent extra lane, quorum, or state-machine protocols unless the runtime actually provides them.