Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • Claude.ai Interface Tour: Every Control You Need on One Screen
  • The AI Fluency Model: Delegation, Description, Discernment and Diligence
  • Working With Claude: Pick the Surface, Match the Model, Keep the Context Clear
  • Claude's Four Entry Points: Choose Chat, Projects, Artifacts or Research Before You Type
  • What Claude Can Do: Extended Thinking, Web Search, Artifacts and File Analysis
  • Getting More From a Claude Chat: Steer the Conversation Instead of Starting Over
  • Claude Research Mode End to End: From One Prompt to a Cited Briefing
  • Claude's Capability Layer: When to Use Skills, Code Execution or Memory
  • Code Execution and File Creation in Claude: Calculated Numbers and a Real Excel File
  • Adding and Using Skills in Claude: Let Claude Pick the Skill, Then Teach It Your Format
  • Claude Memory, Curation and Incognito: Keep What Helps, Remove What Has Gone Stale
  • Claude Styles, Preferences and Project Instructions: Three Dials, Three Scopes
  • Claude Projects: Knowledge, Instructions and a Real Workspace You Set Up Once
  • Keeping a Claude Project Current and Connected: Refresh, Prune and Grant the Least
  • Claude Scheduled Tasks: Let Claude Work on a Schedule and Email You the Result
  • Claude Code and Claude for Chrome: What They Are and Who They Are For
  • Anatomy of a Good Prompt: Role, Context, Task, Format and Examples
  • Shaping Claude's Output: Format, Tone and Length in a Few Words
  • Iterating and Refining a Prompt: Read, Diagnose, Adjust, Repeat
  • Five Prompting Patterns for Work: Summarise, Extract, Rewrite, Classify and Draft
  • Why Evaluating AI Output Matters Most: Trust, Then Verify
  • Spotting AI Hallucinations and Fabrications: Four Tells and Where Risk Spikes
  • Fact-Checking Claude's Answers: Four Techniques and a Line-by-Line Claim Log
  • Judging AI Output Quality: Four Questions That Score Any Answer
  • Adapting AI Output for Your Audience: One Answer, Three Readers
  • When a Human Must Review AI Output Before It Ships
  • A Personal Validation Checklist for AI Output: Six Lines, Any Draft
  • Fitting Claude Into Real Work: Where It Helps and Where It Never Should
  • Breaking Big Tasks Into Steps With Claude: Small Asks, Checked Hand-offs
  • Designing a Repeatable Claude Workflow: A Reusable Weekly Report Template
  • Measuring If Claude Is Actually Working: One Number, Before and After
  • Communicating AI Value and Limitations to Stakeholders: The Honest Pitch
  • Data Privacy With Claude: What Never Goes in a Prompt, and How to Redact a Document Before You Paste It
  • Responsible AI Use and Transparency: Helpful, Honest, Harmless, and One Honest Line
  • Troubleshooting a Weak Claude Answer: Name the Cause, Fix One Thing, Then Make It Cheaper
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • Claude Code's Built-in Tools: Read, Write, Edit, Bash, Grep and Glob, and When Each One Is the Right Pick
  • The CLAUDE.md Hierarchy: User, Project and Directory Files, How They Stack, and the Team Rule Stuck on One Laptop
  • Split a 600-Line CLAUDE.md: @import Lines, .claude/rules Files and Which One to Pick
  • Path-Specific Rules in Claude Code: paths Globs, When a Rule Loads and the Glob That Matches Nothing
  • Claude Code Slash Commands and Skills: Project vs User Scope, $ARGUMENTS, context: fork and allowed-tools
  • Iterative Refinement with Claude Code: Input/Output Examples, Tests First and the Interview Pattern
  • Claude Code Sessions: Resume by Name, Fork From a Baseline, or Start Fresh With a Summary Card
  • CI Reviews That Don't Repeat Themselves: Prior Findings, Existing Tests and Test Standards in CLAUDE.md
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  • Validation-Retry Loops for Claude Extraction: Send Back the Exact Errors, and Stop When a Retry Cannot Help
  • Multi-Pass and Multi-Instance Code Review with Claude: A Fresh Reviewer, Per-File Passes and an Integration Pass
  • When a Claude Support Agent Should Escalate: Three Clear Triggers, Not Mood or a Confidence Score
  • Error Propagation Across Subagents: Retry Locally, Then Report the Failure, the Attempts and What You Found
  • Human Review and Confidence Calibration: Check Accuracy by Type and Field Before You Stop Looking
  • Provenance in Multi-Source Research: Keep Every Claim With Its Source and Date, and Show Conflicts Instead of Settling Them
  • Lab: An Extraction Pipeline With a Nullable Schema, Validation-Retry, a 100-Request Batch and Human Review
  • Lab: A Research Pipeline With Parallel Subagents, a Timeout That Keeps Its Partial Results, and a Report With Its Trail
  • Coordinator and Subagents: Decompose, Delegate, Check Coverage, and Call Only the Spokes You Need
  • Passing Context to Subagents: Nothing Is Inherited, So Put Findings, Goal and Criteria in the Prompt
  • Parallel Subagents: Several Task Calls in One Response, Every Result Back in One User Turn
  • Task Decomposition: a Fixed Prompt Chain With an Integration Pass, or a Dynamic Plan That Adapts
  • Prompt Guidance vs Programmatic Gates: Block the Refund Until the Customer Is Verified, Then Hand Off a Card That Stands Alone
  • Scoped Tools per Agent and tool_choice: Three to Five Tools per Role, a Shared One, and auto, any or a Forced Tool
  1. Blog
  2. /
  3. Claude
  4. /
  5. Building with the Claude API

Coordinator and Subagents: Decompose, Delegate, Check Coverage, and Call Only the Spokes You Need

A research question about chat or email support goes to a coordinator with four subagents. The coordinator splits the question into distinct slices, calls only the spokes it needs, checks the draft for gaps and re-delegates. A plan that is too narrow gives a report that covers a third of the question.

Chaand Sheikh

·27 November 2026Building with the Claude API

What you will learn

  • Name the coordinator's four jobs: decompose, delegate, aggregate and decide which spokes to call
  • Give each subagent a distinct slice so no two search the same pages
  • Run a coverage check on the draft and re-delegate a targeted query to fill a gap
  • Define four subagents with AgentDefinition and give the coordinator Task in allowed_tools

Before you start

  • The Claude Agent SDK: query and ClaudeAgentOptions
  • Context isolation through subagents

Your boss asks: do customers prefer chat or email support? That isn't one lookup. It's a research job with several parts: search the web, read documents, merge the findings, write a report. Give all of that to one agent and its context fills with every page it reads and every note it keeps. Roles get mixed, details get lost, and the answer drifts.

So we split the work and give the splitting to one manager, the coordinator. The general hub-and-spoke shape (a hub in the middle, spokes that never talk to each other) is covered in hub and spoke in LangGraph, and why each spoke gets a clean context is covered in context isolation through subagents. This article is about what the coordinator itself has to get right, with the Claude Agent SDK.

The coordinator's four jobs

Think of a newsroom editor. The editor owns the whole story, gives each reporter a different topic, and every story comes back to the editor. Reporters never phone each other. The coordinator works the same way, and it has four jobs:

  1. Decompose. Split the question into distinct subtopics.
  2. Delegate. Send each piece to the right subagent.
  3. Aggregate. Collect the results into one picture.
  4. Decide. Choose which spokes to call for this query.

The subagents do the work. The coordinator does the thinking about the work. And because every message goes through the hub, the coordinator also owns routing, error handling and what information goes where.

Call only the spokes the query needs

The fourth job is the one people skip. Compare two questions.

A simple one: how fast does one vendor say its chat replies are? One search is enough. The coordinator calls web search and skips the rest.

A broad one: chat, email or phone, what do customers prefer? Now the full pipeline makes sense: search, document analysis, synthesis, report.

The coordinator decides which spokes to call Simple: one vendor's chat reply speed? Coordinator Web search Doc analysis Synthesis Report skipped: one spoke is enough Broad: chat, email or phone, what do customers prefer? Coordinator Web search Doc analysis Synthesis Report wide question: the full pipeline, every step routed through the coordinator
Don't send every question through every subagent. The coordinator picks the spokes for this query.

Give each subagent a distinct slice

Next, scope. Suppose three search agents all get the same brief: customer support preferences. They find the same pages three times. That's wasted work, and the merge step now has to remove duplicates.

Partition instead. Agent 1 owns chat support, agent 2 owns email, agent 3 owns phone. Each part of the question has exactly one owner. You can also split by source type: surveys, forums, reports. Either way, distinct subtopics or source types cut duplicated work.

Check the draft, fill the gap, synthesise again

First drafts have holes, so the coordinator refines:

The coverage loop Synthesis first draft Coordinator checks coverage Gap found no phone data Search + analysis phone support only Coverage OK: report targeted query new findings, synthesise again no gap left
The loop runs until coverage is sufficient. Only then does the report spoke run.

Synthesis writes a first draft. The draft goes back to the coordinator, which checks it against the question. It finds a gap: there's no phone support data. So it re-delegates a targeted query, phone support only, to search and analysis, rather than rerunning the whole research. The new findings go back into synthesis, the coordinator checks again, and now coverage is fine. Only now is the report written.

research_team.py: four spokes, one hub

Here it is with the Claude Agent SDK: four AgentDefinitions and one set of coordinator options. The lecture shows this file but doesn't run it (it needs the SDK and a Claude login or API key), so there's no output to show.

"""Hub and spoke: one coordinator, four specialist subagents."""
import asyncio
from claude_agent_sdk import (AgentDefinition, ClaudeAgentOptions,
                              query)

AGENTS = {
    "web_search": AgentDefinition(
        description="Finds web sources on ONE assigned subtopic.",
        prompt="Search the web for your subtopic. Return sources.",
        tools=["WebSearch"]),
    "doc_analysis": AgentDefinition(
        description="Reads given documents and lists key findings.",
        prompt="Read the documents you are given. List findings.",
        tools=["Read"]),
    "synthesis": AgentDefinition(
        description="Merges findings into one cited summary.",
        prompt="Combine the findings you are given. Cite each.",
        tools=[]),
    "report": AgentDefinition(
        description="Writes the final report from a summary.",
        prompt="Write a short report from the summary you get.",
        tools=["Write"]),
}

COORDINATOR = """You lead a research team.
Split the question into distinct subtopics and source types.
Call only the subagents the question needs.
Subagents see only what you send them, so pass the facts.
Check the draft for gaps and re-delegate before the report."""

OPTIONS = ClaudeAgentOptions(
    system_prompt=COORDINATOR,
    allowed_tools=["Task"],      # the coordinator may spawn subagents
    agents=AGENTS,
)


async def main():
    question = "Do customers prefer chat or email support?"
    async for message in query(prompt=question, options=OPTIONS):
        print(message)

asyncio.run(main())

What to notice:

  • description tells the coordinator when to call each subagent. "Finds web sources on ONE assigned subtopic" also nudges it to hand out one slice per call.
  • tools gives each spoke only its own tools. Web search gets WebSearch and nothing else, document analysis gets Read, and report gets Write.
  • The COORDINATOR prompt carries the four jobs as five plain lines: distinct subtopics and source types, only the subagents needed, pass the facts (a subagent sees only what the coordinator sends), and check for gaps before the report. The coverage loop lives here, as an instruction. There's no loop in the Python; the coordinator runs it through its own Task calls.
  • allowed_tools=["Task"] is what lets the coordinator spawn a subagent at all. Without Task, it cannot spawn one. The exam guide calls this tool Task; newer Agent SDK docs may list it as Agent, so check the docs for your SDK version.

For the SDK basics (query, ClaudeAgentOptions) see the Claude Agent SDK. The project file and README for this lesson are in the community, free to join.

Break it: a plan that is too narrow

The lecture's failure case. The coordinator plans only one subtopic, chatbots. It calls web search once and writes the report.

The report covers chat. Email is missing. Phone is missing. It reads fine and covers a third of the question.

Every spoke did its job perfectly. The decomposition was the problem, so the fix goes in the coordinator's instructions: name every channel in the question, list the source types, and check the draft for gaps before the report. Lines two and five of COORDINATOR point the same way: distinct subtopics and source types, then a gap check before the report.

How this shows up in a question

A scenario describes a report that misses part of a broad topic, then offers causes like a missing tool, spokes running in the wrong order, or spokes that can't message each other. None of those produces missing coverage. When a broad question comes back incomplete, look at the decomposition first.

SymptomWhere to lookFix
Report covers chat only, email and phone missingCoordinator's plan (decompose)Name every channel and source type; check for gaps
Three agents return the same pagesOverlapping scope (delegate)One distinct slice per subagent
A one-fact question runs the whole pipelineSpoke selection (decide)"Call only the subagents the question needs"
Coordinator never spawns a subagentallowed_toolsAdd Task (or Agent in newer docs)

Common mistakes

  • Blaming the spokes for a narrow report. A narrow plan gives an incomplete report, however good each spoke is.
  • Giving every subagent the same brief. They duplicate each other's work. Partition by subtopic or source type.
  • Letting spokes talk directly. Everything goes through the hub, which is what keeps routing, errors and information flow in one place.
  • Assuming the subagent knows the question. It starts with a blank page and knows only what the coordinator sends. The next lesson, passing context to subagents, is about exactly that.
  • Writing the report straight after the first draft. Check coverage first, re-delegate the gap with a targeted query, then report.

Quick recap

Coordinator jobWhat it means here
DecomposeChat, email, phone (or surveys, forums, reports), one owner each
DelegateEach slice to the subagent whose description fits
AggregateEvery result comes back to the hub, then to synthesis
DecideOne spoke for a simple query, the full pipeline for a broad one
RefineCheck the draft, re-delegate the gap, synthesise again

Try it yourself

Add a fifth subagent to AGENTS, for example one that reads survey results only, and give it a description that says when to use it. Then ask a narrower question, such as one vendor's chat reply speed, and watch which spokes the coordinator calls. Finally remove the last line of COORDINATOR and see whether the coverage check still happens.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Claude · 118 of 123

Previous
Lab: A Research Pipeline With Parallel Subagents, a Timeout That Keeps Its Partial Results, and a Report With Its Trail
Next post
Passing Context to Subagents: Nothing Is Inherited, So Put Findings, Goal and Criteria in the Prompt

Related course on Udemy

Claude Certified Architect - Foundations (CCAR-F) Exam Prep

Agentic loops, tools, MCP, Claude Code, prompts, structured output and context.View on Udemy ↗: Claude Certified Architect - Foundations (CCAR-F) Exam Prep (paid course, opens in a new tab)

Related posts

The Claude Messages API: Your First Call, Field by Field

One request in, one Message out. The four fields of a Messages API call (model, max_tokens, system, messages), how to read content blocks, stop_reason and usage, and why every turn resends the history.

Claude Tool Use: How tool_use and tool_result Work in the Messages API

Follow one order question through Claude's tool round trip: define a tool, read the tool_use block, run your own function and send a matching tool_result back, including parallel calls and is_error.

Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared

Every Claude client SDK wraps the same REST request: a POST to /v1/messages with a JSON body. See it built by hand, through the Python and TypeScript SDKs, as typed errors, and as async calls that wait together.

Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move

Configure the Anthropic SDK client (timeout, max_retries, with_options, async, pagination), see which errors it retries by itself, then repair a retry wrapper so a 429, a 529, a 400 and a timeout each get the move the docs support.

On this page

  • The coordinator's four jobs
  • Call only the spokes the query needs
  • Give each subagent a distinct slice
  • Check the draft, fill the gap, synthesise again
  • research_team.py: four spokes, one hub
  • Break it: a plan that is too narrow
  • How this shows up in a question
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Architect - Foundations (CCAR-F) Exam Prep

Agentic loops, tools, MCP, Claude Code, prompts, structured output and context.View on Udemy ↗: Claude Certified Architect - Foundations (CCAR-F) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.