Multi-agent orchestration

Sometimes one agent isn't the right unit. Splitting work across multiple agents, with isolated context and specialized roles, can outperform a monolith. It can also be over-engineering. Know which is which.

The basic pattern: orchestrator-worker

One "orchestrator" agent decomposes a task into sub-tasks. Each sub-task is handed off to a "worker" agent with its own fresh context. Workers return results; the orchestrator synthesizes the final answer.

User goal → Orchestrator plans → spawn Worker 1, Worker 2, Worker 3
        ↓
Orchestrator collects results → synthesizes → returns

Why it helps

Where it backfires

When to use it

Good fits:

Bad fits:

Delegation discipline

If you're spawning a sub-agent, the parent must:

  1. Write a complete task description. The worker has no memory of the parent's thinking.
  2. Specify the return format. Unstructured worker output is a pain to consume.
  3. Set a time/turn budget. Workers can spin forever.
  4. Handle worker failure. Assume it will fail; decide what happens.

Claude Code sub-agents

Claude Code has built-in support for sub-agents. You can invoke specialized agents (Explore, Plan, general-purpose) that run with isolated context and return a single message back to the parent. For research-heavy or branching work, sub-agents are a major productivity unlock.

Peer-to-peer (usually avoid)

Two agents that chat directly, no orchestrator. Popular in demos. Rarely worth it in production, most "P2P agent" setups are better modeled as orchestrator-worker with one role delegating.

Watch out: multi-agent architectures are fashionable. That doesn't make them right. The single-agent ReAct baseline is often faster, cheaper, and more debuggable.