Subagents and Agent Teams
On this page8 items
In 10 seconds
A mechanism for carving out part of the work and handing it to a helper working at a separate desk.
The biggest benefit is that the messy traces of that work don’t come back into the main conversation.
No. 22 said it’s better to separate out the reviewer role. The mechanism that actually makes that possible is the subagent.
From here on, the discussion leans toward Claude Code. If you grasp just the concept, you won’t have trouble in Chapter 5.
Working at a separate desk#

A subagent has a work desk independent of the main agent. In the words of the official documentation, it has its own context window, its own instructions, a limited set of tools, and its own permissions.
There are four benefits.
The traces of work don’t pile up. Say it read 50 files and produced a flood of logs, and only 3 lines of it were useful. Those 50 files’ worth don’t land on the main desk. Only a summary comes back. The work-desk idea from No. 04 applies directly.
No preconceptions creep in. A regular subagent starts without the conversation history. It hasn’t seen the exchanges in the main conversation or the files already read. This pays off when you use it as a reviewer, because someone who doesn’t know how the work was made is looking at it.
They can run at the same time. Independent tasks can run in parallel.
Settings can differ by role. You can decide the available tools, the model, and the level of permissions for each role. For example, you don’t give writing tools to a reviewer that only reads.
There’s also a form that inherits history#
The form called a fork is the opposite: it inherits the entire parent conversation.
Choosing between them is simple.
| Doesn’t inherit (regular) | Inherits (fork) | |
|---|---|---|
| What it has | Only what you asked for | The entire conversation so far |
| Suited to | Research, review, independent tasks | Complicated side paths that need the backstory |
| Preconceptions | None | Present |
Reviews are better without inheritance; follow-up discussions are better with it. That’s the axis for deciding.
How to create one#
You can create one with a single Markdown file. Write the settings in YAML at the top, followed by the instructions.
---
name: quote-checker
description: Double-checks the quote spreadsheet. Use after the table is created
tools: Read, Grep
model: sonnet
---
You are in charge of double-checking quotes. For the table you are given, check the following:
・Whether the number of rows matches the number of pages in the original PDF
・Whether unit price × quantity matches the total
・Where there are blank cells
Do not fix anything. Return only your findings, in order of priority.There are two places to put it. In .claude/agents/ it’s for that project; in ~/.claude/agents/ it’s for all projects. Project-level ones can be shared with your team.
The key point is that tools narrows down the available tools. This checker can only read, so it can never accidentally rewrite the table. The “set the scope first” principle from No. 21 is at work here.
There are limits#
These are limits stated explicitly in the official documentation.
- Up to 20 can run at the same time (configurable)
- Nesting is limited to 3 levels (configurable)
- A subagent’s desk size is that of its own model, not the main agent’s
The last one is easy to miss. Even if the main agent uses a model with a large context, if you assign a lighter model to a subagent, it only has that model’s capacity. Assign a lighter model to a role that reads a large amount of material, and it will get stuck there.
How agent teams differ#
Agent teams are a separate mechanism. Whereas a subagent is a helper within a single session, an agent team launches multiple sessions and coordinates them.
Only the scale differs; the thinking is the same: split up roles, narrow what you hand over, and have summaries come back. The sensible order is to get a feel for subagents first, then try agent teams.
Try it: design a reviewer’s instructions (5 minutes)
You don’t have to actually run it. It’s design practice.
Prompt
“`
I want to design a reviewer for my work as an independent agent.
Please decide the following:
・What it should check (up to 5 items)
・Which tools it may use (read only, or can it write?)
・The format it should return
・What it should not checkWork: (describe your own work)
“`Expected result: All four are decided concretely, and “Which tools it may use” is read only.
If it doesn’t work: If “What it should not check” doesn’t come out, that’s the most important item. Let it look at everything and its findings scatter until they’re useless.
Common pitfalls#
Assuming that splitting improves accuracy. Splitting only helps for work where separating the context is better. Forcing a continuous task apart drops the information in between and makes things worse.
Forgetting that history isn’t inherited. “About what we discussed earlier” means nothing to a subagent. Write every necessary premise into the request itself.
Assuming parallel means faster. Running tasks that aren’t independent in parallel means they fight over the same files and break things. Only tasks that don’t affect each other should run in parallel.
Summary#
- A subagent is a separate work desk. Only a summary returns to the main agent
- By default it doesn’t inherit history, which makes it well suited to reviewing
- You can narrow its tools. Don’t give writing tools to a read-only role
- Up to 20 at once and 3 levels of nesting. Its desk size is that of its own model