Course B · Module B2 Going Agentic · Lesson 12 of 18

Using Subagents

Big jobs go faster when you split them up and run the pieces in parallel.

~11 min · Nothing to open yet · Prereq: B11 Tools, CLI, MCP & Skills

A single agent doing a long, complex job is like one person trying to research, write, proofread, and format a report all at once. It works — but it's slow, the context fills up with everything from every stage, and one misfired step can tangle the whole run. The alternative is subagents: fresh, focused helpers that each own one scoped piece of the job. Your single win: by the end you'll understand when to delegate to subagents, and what the orchestration pattern looks like — so you can hand off parallel work without losing oversight.

What a subagent actually is

A subagent is just another agent — a model, tools, context, and a loop — that you spin up to handle a specific, bounded task. What makes it a subagent is context: it was launched by a main (orchestrator) agent rather than directly by you, and it reports its result back to that orchestrator when done.

Think of a project manager who has three team members: a researcher, a writer, and a fact-checker. The PM doesn't do all three jobs herself — she delegates, waits for the results, and then assembles the final deliverable. The researcher, writer, and fact-checker are her subagents. Each works in their own lane; none is distracted by the others' work. The PM is the orchestrator.

Three reasons to use them

Parallel work

Multiple subagents run at the same time. Researching three topics in parallel takes the same wall-clock time as researching one. For anything with independent pieces, this is a straightforward speed win.

Clean context per task

Each subagent starts fresh — its context window contains only the task it was given, not the entire history of the parent job. This keeps reasoning sharp and prevents the "context contamination" where early steps confuse later ones.

Specialization

You can configure each subagent differently — give the researcher a web-search tool and a skeptical research skill, give the writer your brand-voice skill and a draft template. Right tools, right instructions, for each role.

When it's overkill

Short, linear tasks — draft one email, answer one question — don't need subagents. The overhead of spawning and coordinating them costs more than it saves. If the whole job fits in a single agent's context and runs in under a minute, keep it simple.

The orchestration pattern

Orchestration is just the word for the main agent managing the subagents. Here's how it flows in plain English:

  1. Receive the goal. You give the orchestrator a high-level objective: "Produce a competitive analysis of these five companies."
  2. Break it down. The orchestrator decides which pieces can be split off. In this case: five parallel research subagents, one per company.
  3. Delegate. It launches each subagent with a scoped task and the specific tools it needs (web search, read competitor site).
  4. Collect results. When all five subagents finish, the orchestrator reads their outputs — all five research summaries.
  5. Synthesize. The orchestrator (or a dedicated "writer" subagent) combines the five summaries into the final report.
You are still in charge. The orchestrator is just another agent you configure. You define the goal, the allowed tools, and any human-review checkpoints. Subagents don't acquire permissions you didn't grant; they inherit only what you authorized for the job. Scope each subagent tightly.

A note on cost. Every subagent uses tokens — the model's unit of work. Running five parallel subagents uses roughly five times the tokens of one agent doing the same work sequentially. For time-sensitive tasks the trade-off is usually worth it; for simple jobs it isn't. Check your usage after your first multi-agent run.

Check yourself

Answer before opening — recalling it now is what makes it stick.

What is the main practical difference between an orchestrator and a subagent?

Role, not technology. Both are ordinary agents. The orchestrator receives the high-level goal, breaks it down, and delegates pieces. A subagent receives a scoped task from the orchestrator and returns a result. You could run the same agent as an orchestrator in one job and as a subagent in another.

Why does each subagent get a "clean context"? Why does that matter?

Because subagents start fresh — they only see their own scoped task, not the full history of the parent job. This matters because a cluttered context causes the model to lose track or get confused by irrelevant earlier steps. A focused context means sharper, faster reasoning for that specific piece.

You need to draft one short follow-up email. Should you use subagents?

No — overkill. A single short task fits easily in one agent's context and takes seconds. The overhead of spawning, configuring, and coordinating subagents would take longer than just running one agent straight through. Subagents pay off on jobs with multiple independent pieces that benefit from parallelism or specialization.

Read this next (primary source)

Create custom subagents — Claude Code Docs. The official guide to defining and deploying subagents in Claude Code: how to write the agent definition file, set descriptions, and control which tools each subagent gets. See RESOURCES.md for more.

I'm your teacher — ask me anything. Have a multi-step project in mind that might benefit from subagents? Describe it and I'll sketch out an orchestration plan: how many subagents, what each one does, and where the human checkpoint should go.

Key terms — agent, context, human-in-the-loop — are in the course glossary. Keep it open.