What you will be able to do
- Describe the hub-and-spoke shape of a coordinator-subagent system and what the coordinator owns
- Explain why a subagent does not see the coordinator's conversation and what it must be given in its prompt
- Justify routing all subagent results, errors and follow-ups through the coordinator
- Describe the coordinator's role in task decomposition, delegation and result aggregation, and scale the number of subagents to query complexity
- Design a coordinator that analyzes each query's requirements and selects only the subagents it needs instead of running the full pipeline every time
Key concept
Hub-and-spoke coordinator — One lead agent sits at the centre. It splits the work, hands each piece to a specialised subagent, and receives every result. Subagents do not talk to each other. Each one works in its own context and reports back only to the hub.
1.The coordinator is the hub
Anthropic's Research feature is built on what its engineering post calls an orchestrator-worker pattern. A lead agent receives the user's query, plans the work, and spawns subagents to explore different parts of it. When a query arrives, the lead agent "analyzes it, develops a strategy, and spawns subagents to explore different aspects simultaneously." The subagents act as filters. They run searches and return condensed findings, and the lead agent compiles the final answer from them.
Picture this as a hub with spokes. The coordinator is the hub, and each subagent sits at the end of a spoke. Work goes out from the hub and results come back to it. The coordinator therefore has four jobs: decompose the task, delegate the pieces, aggregate the results, and decide what happens next. No subagent needs to know that the other subagents exist.
Claude Managed Agents makes this shape explicit in configuration. You "set multiagent to declare the roster of agents the coordinator can delegate to." The coordinator lists its spokes, and each roster member keeps its own model, system prompt and tools. In Managed Agents the hierarchy is also capped: "The coordinator can only delegate to one level of agents". If you reference an agent that has its own roster, the create or update request fails with a validation error. A roster can list at most 20 unique agents, but the coordinator can call several copies of each one.
name: Engineering Lead
model: claude-opus-5-5
tools:
- type: agent_toolset_20260401
multiagent:
type: coordinator
agents: # paths: ant apply substitutes {type: agent, id, version}
- ./reviewer.md
- ./test-writer.md
---
You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.Checkpoint 1 of 6· Check yourself
In Claude Managed Agents, you add an agent to a coordinator's roster, and that agent has its own multiagent.agents roster. What happens?
Managed Agents allows only one level of delegation below the coordinator. A roster member that has its own roster is rejected when you create or update the coordinator.
“The coordinator can only delegate to one level of agents”Source: platform.claude.com
2.Subagents start with a clean context
Isolation runs in both directions. In the Agent SDK, each subagent "runs in its own conversation, which starts fresh unless the subagent is a fork." The subagent does not inherit what the coordinator has discussed or read. The coordinator also does not receive the subagent's working. The docs say "intermediate tool calls and results stay inside the subagent; only its final message returns to the parent." A research subagent can read dozens of files, and the parent gets back a concise summary instead of every file.
Managed Agents works the same way. All agents share the sandbox and filesystem, but each one runs in "its own session thread, a context-isolated event stream with its own conversation history." The docs are blunt about it: "Tools, MCP servers, and context are not shared."
This has a design consequence. Whatever a subagent needs to know has to be written into the task the coordinator gives it. The orchestrator-workers cookbook builds this in: "Workers receive both the original task AND their specific instructions for better context." A coordinator that sends only "handle part 3" has handed the subagent a task it cannot understand.
This isolation is also the reason to use subagents in the first place. Anthropic's guidance on multi-agent systems names context pollution as a core reason to split work. If one subtask fills the context with material that later subtasks don't need, response quality can degrade. A subagent absorbs that material and passes back only the part that matters.
Checkpoint 2 of 6· Check yourself
An Agent SDK subagent reads 40 files while it investigates a bug. What reaches the parent agent's conversation?
The subagent's intermediate tool calls and their results stay inside it. Only its final message returns to the parent, so the parent's context stays small.
“intermediate tool calls and results stay inside the subagent; only its final message returns to the parent.”Source: code.claude.com
3.Route everything through the hub
Since each subagent hands back exactly one result to its parent, the coordinator is the natural place for all communication to meet. Routing every exchange through it gives you three things.
Observability. In Managed Agents, "The coordinator reports activity in the primary thread", which is the same stream as the session-level events. Any further threads are created only when the coordinator delegates work. To follow what the system did, you watch one stream.
Consistent error handling. The coordinator checks what comes back before using it. In the orchestrator-workers cookbook, the coordinator's "Error handling validates that workers return non-empty responses". A failed or empty result reaches one decision-maker, which can retry, re-delegate or carry on without that piece. The decision belongs to the component that can see the whole task, not to the spoke that hit the error.
Controlled information flow. Anthropic lists early failures of its research system, including "distracting each other with excessive updates." When subagents chat freely among themselves, context fills up and coordination costs grow. The coordinator decides which facts go to which agent.
Checkpoint 3 of 6· Exam question
A platform team is building a research assistant using Claude Agent SDK subagents. During code review, they notice that two subagents pass results directly to each other through a shared file that the coordinator never inspects, and when one subagent fails, the coordinator has no visibility into what happened. Which architectural change should the team make to align with the hub-and-spoke coordinator pattern?
Correct answer: B — Route all inter-subagent communication through the coordinator so it can log outcomes and handle failures consistently
- A. A shared database still lets subagents exchange results without the coordinator observing or mediating the exchange, so failures remain invisible to the hub.
- B. Correct. Hub-and-spoke requires the coordinator to mediate all inter-subagent communication and information routing, giving it visibility to log outcomes and handle errors centrally.
- C. Merging the subagents removes the specialization benefit of separate subagents and doesn't address the underlying issue of bypassing the coordinator for communication.
- D. Polling a shared queue directly still routes communication outside the coordinator during execution, only surfacing results after the fact rather than giving the coordinator real-time control.
Checkpoint 4 of 6· Check yourself
Two research subagents report different figures for the same fact, each citing a different source. Under hub-and-spoke, where should the discrepancy be resolved?
Subagents report only to their parent, so the coordinator is the one place that sees both results. It aggregates and decides, for example by re-delegating a targeted check, before it presents an answer.
“the subagents act as intelligent filters by iteratively using search tools to gather information”Source: www.anthropic.com
4.What the coordinator decides: decompose, delegate, aggregate, scale
The coordinator's role comes down to four decisions, and no subagent can make any of them.
Task decomposition. The coordinator splits the query into subtasks. In Anthropic's research system, "the lead agent decomposes queries into subtasks and describes them to subagents." Anthropic's building-effective-agents post describes the same orchestrator-workers workflow: "a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results."
Delegation. Each piece the coordinator hands off needs a proper brief. According to the research post, every subagent needs "an objective, an output format, guidance on the tools and sources to use, and clear task boundaries." Without detailed task descriptions, agents duplicate work, leave gaps, or fail to find necessary information.
Result aggregation. Subagents return findings, and the coordinator combines them. In the Managed Agents parallelization pattern, you fan out independent subtasks "and have the coordinator synthesize the results." In the research system, "The LeadResearcher synthesizes these results and decides whether more research is needed". If more is needed, it can create additional subagents or refine its strategy.
Deciding how many subagents to invoke. The coordinator has to match its effort to query complexity. Agents struggle to judge the right effort for different tasks, so Anthropic embedded scaling rules in the lead agent's prompt. Simple fact-finding gets 1 agent with 3-10 tool calls. Direct comparisons might need 2-4 subagents with 10-15 calls each. Complex research might use more than 10 subagents with clearly divided responsibilities. These rules exist because overinvestment in simple queries was a common failure mode in early versions. Anthropic's prompting guidance for Claude Opus 5 says the same: delegation "pays off on genuinely independent, sizeable tracks of work, but it multiplies cost and time when applied to small tasks."
Checkpoint 5 of 6· Match them up
Match each kind of query to the scale of delegation that Anthropic's research system embedded in its lead agent's prompt.
Tap a term, then the definition that fits it.
The coordinator scales the number of subagents to query complexity. Explicit scaling rules stop it from overinvesting in simple queries.
“Simple fact-finding requires just 1 agent with 3-10 tool calls, direct comparisons might need 2-4 subagents with 10-15 calls each”Source: www.anthropic.com
5.Select subagents per query, not a fixed pipeline
A fixed pipeline runs every query through every stage, whether or not the query needs it. A better coordinator analyzes the query's requirements first. It then dynamically selects only the subagents that this query calls for.
The orchestrator-workers cookbook says this is what separates the pattern from hardcoded parallelization. A central LLM analyzes each task and works out the best subtasks to delegate: "subtasks aren't pre-defined, but determined by the orchestrator based on the specific input." The same cookbook also says when to skip the pattern. If the subtasks are predictable and can be defined in advance, use simpler parallelization. In Anthropic's research system, the lead agent uses extended thinking to plan. It assesses which tools fit the task, determines query complexity and subagent count, and defines each subagent's role.
In the Agent SDK, the coordinator chooses subagents by reading their descriptions. description is a required field on every subagent definition, and the SDK example comments that the "description tells Claude when to use this subagent". The Claude Code docs say the same: "Claude uses the description to decide when to delegate." Make each description specific enough to route to the right subagent. Distinct descriptions let the coordinator call the one spoke a query needs and skip the others.
The coordinator can also decide to call no subagent at all. Anthropic's example delegation instruction for Claude Opus 5 reads: "Do not delegate work you can finish yourself in a handful of tool calls" and "If one subagent can complete the task, use one rather than several, and keep spawn counts low." In Claude Code and the Agent SDK, you can also set hard limits: the CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH and CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS environment variables, and the SDK's max_budget_usd option.
Checkpoint 6 of 6· Check yourself
A research coordinator sends every query through its search, analysis and synthesis subagents, even a single-fact lookup like a company's founding year. What is the better design?
Delegation multiplies cost and time on small tasks. The coordinator should match the subagents it invokes to the query's requirements and not delegate work it can finish in a few tool calls.
“Do not delegate work you can finish yourself in a handful of tool calls”Source: platform.claude.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.A subagent automatically inherits the coordinator's conversation history, so the delegation message can be brief.Why is that wrong?
Unless it is a fork, a subagent starts with a fresh conversation. Anything it needs from the coordinator's context must be written into the task it receives.
Covered in Subagents start with a clean context
2.The subagent that hits an error should decide for itself whether to retry or fall back, without reporting to the coordinator.Why is that wrong?
Each subagent's result returns only to its parent. The coordinator therefore owns validation and recovery decisions, which keeps error handling consistent across all subagents.
Covered in Route everything through the hub
3.More subagents always means better results, so the coordinator should send every query through the full pipeline.Why is that wrong?
Over-delegation is a documented failure mode. The coordinator should analyze each query and scale the subagents it invokes to the query's complexity.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“set multiagent to declare the roster of agents the coordinator can delegate to”
↩︎ The coordinator is the hub“Tools, MCP servers, and context are not shared.”
↩︎ Subagents start with a clean context“The coordinator reports activity in the primary thread”
↩︎ Route everything through the hub“and have the coordinator synthesize the results.”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale“The coordinator can only delegate to one level of agents”
↩︎ Checkpoint - 2.
“the lead agent analyzes it, develops a strategy, and spawns subagents to explore different aspects simultaneously.”
↩︎ The coordinator is the hub“distracting each other with excessive updates.”
↩︎ Route everything through the hub“the lead agent decomposes queries into subtasks and describes them to subagents.”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale“an objective, an output format, guidance on the tools and sources to use, and clear task boundaries.”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale“The LeadResearcher synthesizes these results and decides whether more research is needed”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale“determining query complexity and subagent count”
↩︎ Select subagents per query, not a fixed pipeline“a lead agent coordinates the process while delegating to specialized subagents that operate in parallel.”
↩︎ Key concept“Early agents made errors like spawning 50 subagents for simple queries”
↩︎ Exam trap 3“the subagents act as intelligent filters by iteratively using search tools to gather information”
↩︎ Checkpoint“Simple fact-finding requires just 1 agent with 3-10 tool calls, direct comparisons might need 2-4 subagents with 10-15 calls each”
↩︎ Checkpoint - 3.https://code.claude.com/docs/en/agent-sdk/subagentsOfficial docs
“intermediate tool calls and results stay inside the subagent; only its final message returns to the parent.”
↩︎ Subagents start with a clean context“description tells Claude when to use this subagent”
↩︎ Select subagents per query, not a fixed pipeline“each subagent runs in its own conversation, which starts fresh unless the subagent is a fork”
↩︎ Exam trap 1“each subagent runs in its own conversation, which starts fresh unless the subagent is a fork”
↩︎ Prediction - 4.
“Workers receive both the original task AND their specific instructions for better context”
↩︎ Subagents start with a clean context“subtasks aren't pre-defined, but determined by the orchestrator based on the specific input.”
↩︎ Select subagents per query, not a fixed pipeline“dynamically determine the best subtasks to delegate to specialized worker LLMs”
↩︎ Select subagents per query, not a fixed pipeline“Error handling validates that workers return non-empty responses”
↩︎ Exam trap 2 - 5.https://www.anthropic.com/engineering/building-effective-agentsSecondary source
“a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results.”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale - 6.https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5Official docs
“Delegation pays off on genuinely independent, sizeable tracks of work, but it multiplies cost and time when applied to small tasks.”
↩︎ What the coordinator decides: decompose, delegate, aggregate, scale“If one subagent can complete the task, use one rather than several, and keep spawn counts low.”
↩︎ Select subagents per query, not a fixed pipeline“Do not delegate work you can finish yourself in a handful of tool calls”
↩︎ Checkpoint - 7.https://code.claude.com/docs/en/sub-agentsOfficial docs
“Claude uses the description to decide when to delegate.”
↩︎ Select subagents per query, not a fixed pipeline