Lesson 23 of 36 · Track 3: Build with AI

Multi-agent systems and subagents, explained simply

Intermediate13 min6 steps1 videoFree · no login
The short answer

A multi-agent system splits one big job across several AI agents. Usually a lead agent (the orchestrator) plans the work, sends pieces to helper agents (subagents or workers), each with its own fresh context, and combines what they return. It helps most when the pieces can run in parallel, like broad research, and it hurts when the pieces depend on each other, because it costs many more tokens and the agents can miss each other’s decisions.

  1. 1

    What is a multi-agent system?

    In the last lessons, an AI agent was one model using tools in a loop until a task is done. A multi-agent system uses several of these agents on one task. Each agent has its own instructions, its own tools and its own context window (the text it can keep in view).

    A subagent is a helper that a main agent starts for one piece of work. In Claude Code’s docs, a subagent "does that work in its own context and returns only the summary". That is the core trick: the messy middle (fifty search results, a thousand lines of code) stays inside the helper, and the main agent gets a short, clean answer.

    Key idea

    Subagents are mostly about context: each one gets a fresh, focused workspace and hands back a summary.

  2. 2

    How does the orchestrator–worker pattern work?

    The most common shape is orchestrator–worker. Anthropic’s "Building effective agents" (December 2024) describes it as a central model that breaks a task into subtasks, delegates them to worker models and combines the results. The difference from simple parallel calls is that the orchestrator decides the subtasks on the fly, based on the question.

    Think of a newspaper editor. The editor reads the brief, sends three reporters to cover different angles at the same time, then edits their notes into one story. The reporters never see each other’s notes. Only the editor sees everything.

    1. Your question
    2. Lead agent makes a plan
    3. Subagents work in parallel
    4. Each returns a short summary
    5. Lead combines and checks
    6. Final answer
  3. 3

    What did Anthropic learn building its multi-agent research system?

    In June 2025, Anthropic’s engineers described how Claude’s Research feature works. A lead agent plans the research and starts subagents that search in parallel. A separate citation agent then matches each claim in the report to its source.

    On Anthropic’s internal research eval, a Claude Opus 4 lead with Claude Sonnet 4 subagents scored 90.2% higher than a single Claude Opus 4 agent. The biggest wins were broad questions, such as finding the board members of every IT company in the S&P 500. Running 3–5 subagents at once, each calling tools in parallel, cut research time by up to 90% on complex questions.

    • Teach the lead how to delegate: each subagent needs a clear goal, an output format, which tools to use and where its task ends.
    • Scale effort to the question: early versions started 50 subagents for simple queries. Simple fact-finding now uses one agent with 3–10 tool calls.
    • Start wide, then narrow: short broad searches first, then drill down.
  4. 4

    When do multiple agents hurt?

    The same Anthropic post is honest about the price. Agents use about 4 times more tokens than a normal chat, and multi-agent systems about 15 times more. Tokens are what you pay for, so this only makes sense for valuable tasks. In their tests, how many tokens were spent explained 80% of the difference in results on a hard browsing benchmark.

    Splitting also breaks shared understanding. Workers cannot see each other’s choices, so two of them can make decisions that clash. Anthropic says multi-agent setups fit poorly when every agent must share the same context or when the pieces depend on each other, and notes that "most coding tasks involve fewer truly parallelizable tasks than research".

    • Good fit: broad research, many independent questions, more information than one context window can hold.
    • Poor fit: one tightly connected piece of work, like a single feature where each step builds on the last.
    • Default: start with one agent. Add subagents only when you can name the separate, parallel pieces.
    Key idea

    More agents means more cost and more coordination. Use them only when the work truly splits.

  5. 5

    How do subagents work in Claude Code?

    Claude Code ships with built-in subagents. Explore is a fast, read-only agent for searching a codebase. Plan gathers context in plan mode. General-purpose can both explore and make changes. Claude decides when to hand work to them, or you can ask, for example "use a subagent to find every place we call the payments API".

    You can make your own by adding a Markdown file to .claude/agents/ in a project (or ~/.claude/agents/ for all projects). Only name and description are required; the description tells Claude when to delegate, and the body becomes the subagent’s instructions. As of Nov 2026, a subagent can start its own subagents up to three layers deep by default.

    .claude/agents/code-reviewer.md (from the Claude Code docs)
    ---
    name: code-reviewer
    description: Reviews code for quality and best practices
    tools: Read, Glob, Grep
    model: sonnet
    ---
    
    You are a code reviewer. When invoked, analyze the code and provide
    specific, actionable feedback on quality, security, and best practices.
  6. 6

    What are handoffs in the OpenAI Agents SDK?

    OpenAI’s Agents SDK offers two ways for agents to work together. With a handoff, one agent passes the conversation to a specialist, which then answers the user directly. The SDK shows each handoff to the model as a tool named like transfer_to_refund_agent, so the model "calls" the specialist it wants.

    With agents as tools, a manager agent stays in charge and calls specialists for small subtasks, then writes the final answer itself. That is the orchestrator–worker pattern again. You can mix both.

    A triage agent with handoffs (simplified from the SDK docs)
    from agents import Agent, Runner
    
    refund_agent = Agent(name="Refund agent",
        handoff_description="Handles refund requests")
    order_agent = Agent(name="Order status agent",
        handoff_description="Looks up order delivery status")
    
    triage_agent = Agent(
        name="Triage agent",
        instructions="Hand each customer message to the right specialist.",
        handoffs=[refund_agent, order_agent],
    )
    result = await Runner.run(triage_agent, "I was charged twice.")
From the people who built it

Straight from the source

The original idea, then the same idea taken apart, then how you use it today.

Anthropic Engineering (Jeremy Hadfield, Barry Zhang and colleagues)
The team that built the Research feature in Claude
How we built our multi-agent research system (engineering post, June 2025)
1 · Understand
Research is open-ended, so a lead agent should plan and send parallel subagents, each with its own context, to explore different angles and return condensed findings.
2 · Break it down
  • Parallel subagents gave a 90.2% gain over a single agent on Anthropic’s internal research eval.
  • Each subagent acts like a filter: it reads a lot and returns a little.
  • The cost is real: about 15 times the tokens of a chat.
  • It fits broad, splittable tasks better than tightly linked ones like most coding.
3 · Use it
Before adding agents, list the subtasks. If they are independent and valuable, try parallel subagents; if not, keep one agent.
Anthropic (Erik S. and Barry Zhang)
Anthropic engineers who wrote its widely read guide to agent patterns
Building effective agents (December 2024)
1 · Understand
Look for "the simplest solution possible, and only increasing complexity when needed"; orchestrator–workers is one pattern to reach for when subtasks cannot be known in advance.
2 · Break it down
  • Orchestrator–workers: a central model decides the subtasks for each input and merges the results.
  • Parallelization: fixed subtasks run at once, or the same task runs several times to vote.
  • Every added layer trades speed and cost for quality, so it has to earn its place.
3 · Use it
Build the single-agent version first, measure it, and add workers only where the measurements show it falls short.
5 terms

Words to know

Multi-agent system
Several AI agents, each with its own instructions, tools and context, working on parts of one task.
Subagent
A helper agent started by a main agent for one piece of work; it works in its own context and returns a summary.
Orchestrator–worker
A pattern where a lead agent plans, hands subtasks to worker agents, and combines their results.
Handoff
In the OpenAI Agents SDK, passing the conversation from one agent to a specialist agent that takes over.
Parallel
Running several pieces of work at the same time instead of one after another.
1 video · plays here

Watch

Hand-picked from the people who explain this best. The video loads only when you press play.

Multi Agent Systems Explained: How AI Agents & LLMs Work Together
IBM Technology · 8 min

A clear whiteboard tour of supervisor, hierarchical and network shapes, plus the risks of shared weaknesses. Watch after step 2.

Hands-on · 10 minutes or less

Try it

Run an orchestrator–worker team by hand

  1. 1Pick a broad question, such as "Which three AI tools should a fresher learn for a data analyst job in 2026, and why?"
  2. 2In one chat with any free assistant (ChatGPT, Claude or Gemini), act as the orchestrator: ask it to split the question into 3 independent research subtasks, each with a goal and a 5-line output format.
  3. 3Open a new, separate chat for each subtask and paste just that subtask. These are your workers, each with a clean context.
  4. 4Paste the three short answers back into the first chat and ask it to combine them, flag conflicts and name what is still unknown.
  5. 5Compare with asking the whole question in one chat. Note what improved, and how many more messages (tokens) it took.
Anthropic: How we built our multi-agent research system
3 questions · instant feedback

Check yourself

Pick an answer to see if you are right, and why.

Question 1

Question 1 of 3

What is the main job of a subagent?

Question 2

Question 2 of 3

According to Anthropic, roughly how many more tokens did multi-agent systems use than a normal chat?

Question 3

Question 3 of 3

Which task is the best fit for several parallel subagents?

Lesson 23 of 36

Done? Keep going

Mark this lesson complete to keep your place. Progress is saved on this device, no login.

Up next · Lesson 24 · 10 minEvals: does your AI work?Evals are tests for AI features: a fixed set of realistic inputs, a clear rule for what a good answer looks like, and a score you check every time you change the prompt or model. You find what to test by reading real outputs, then grade with code, a human, or another model using a rubric (LLM-as-a-judge).← Previous: What are Agent Skills?
People also ask

Questions people ask

What is the difference between an AI agent and a multi-agent system?

An AI agent is one model using tools in a loop to finish a task. A multi-agent system has several agents, often a lead that plans and helpers that each handle one part in their own context, with the lead combining the results.

Are multi-agent systems better than a single agent?

Only for some tasks. Anthropic found big gains on broad research that splits into parallel parts, but multi-agent systems used about 15 times more tokens than chat and fit poorly when every step depends on the last, as in most coding.

What is a subagent in Claude Code?

A specialised helper with its own context window, instructions and tool permissions. Claude Code includes Explore, Plan and general-purpose subagents, and you can add your own as Markdown files in .claude/agents/.

6 sources · checked Nov 2026

Sources and further reading

Free · No signup to start

Going for an AI role? Practise the interview.

Talk to an AI interviewer about what you just learned and get feedback on every answer.

Start a free mock interview