PROMPT · multi-agent-orchestration
Orchestrator dispatch prompts
The dispatch-prompt anatomy for spawning agent teammates: scope, context the teammate cannot inherit, deliverable shape, and the adversarial-debate variant for competing hypotheses.
✓ verified 2026-07-18 · stack: claude-code · source
Teammates load project context (CLAUDE.md, MCP servers, skills) but not the lead’s conversation history, so the spawn prompt is the only channel for everything the session has learned (agent teams). Most team failures are dispatch failures: a vague spawn prompt produces a teammate that rediscovers context, drifts scope, or reports in a shape the lead cannot synthesise. These templates make the four load-bearing parts explicit.
Spawn three teammates to review PR #142:- "security": review ONLY security implications. The app uses JWT in httpOnly cookies; token handling and session management are the hot spots. Report findings with severity ratings.- "performance": review ONLY performance impact. The hot path is the /search endpoint; we budget 50ms p99.- "coverage": validate ONLY test coverage for the changed behaviour.Each teammate: report at most five findings, file:line references,one-sentence rationale each. Do not fix anything. The lead synthesisesafter all three report.Users report the app exits after one message instead of stayingconnected. Spawn 5 teammates to investigate different hypotheses. Havethem talk to each other to try to disprove each other's theories, like ascientific debate. Update findings.md with whatever consensus emerges.Only theories that survive active disproof attempts go in the doc.Spawn an "architect" teammate to refactor the authentication module.Require plan approval before they make any changes. Only approve plansthat include test coverage for the changed paths and leave the publicAPI untouched. Context the teammate needs: we are mid-migration fromsession cookies to JWT; src/auth/legacy/ is frozen and must not change.What it does
- One lens per teammate. A single reviewer gravitates to one issue class; splitting criteria into independent lenses means each gets thorough attention, and non-overlapping scopes stop teammates repeating each other. This mirrors the docs’ parallel-review example.
- Context the teammate cannot inherit, stated inline. Stack facts, budgets, frozen paths: everything the lead knows that CLAUDE.md does not say. The docs’ best-practice example does exactly this (“The app uses JWT tokens stored in httpOnly cookies”).
- Deliverable shape and a finding cap. “At most five findings with file:line references” makes synthesis mechanical and stops the thoroughness spiral.
- Adversarial structure where anchoring is the risk. Sequential investigation biases toward the first plausible theory; making teammates actively disprove each other means “the theory that survives is much more likely to be the actual root cause”.
- Plan approval as a gate, with criteria. The lead approves teammate plans autonomously; giving it criteria in the dispatch (“only approve plans that include test coverage”) is how you steer that judgement.
Failure modes
- Named teammates or unaddressable teammates. Name them in the dispatch (“security”, “architect”); names are how you message a specific teammate later and how the ledger of who-found-what stays legible.
- Same-file scopes collide. Two teammates editing one file overwrite each other; divide by file ownership, not by topic, for implementation work.
- Team size creep. Start with three to five teammates; “three focused teammates often outperform five scattered ones”, and token cost scales linearly with teammates.
- The lead does the work itself. A known failure: tell it “wait for your teammates to complete their tasks before proceeding”.
- Experimental surface. Agent teams are experimental and disabled by default; see the agent-teams settings artifact for the flag, hooks, and limitations that come with it.
Verified against the dispatch examples, context-inheritance rules, plan approval, and team-sizing guidance at code.claude.com/docs/en/agent-teams, 2026-07-18.