The one thing subagents are for
By the end you can
- Name the single problem a subagent solves — keeping investigation out of your context window
- Decide from the task shape whether to delegate or stay in the main conversation
- Predict what actually comes back from a subagent and what it costs you
- Scope a delegated brief so the subagent returns a summary, not a transcript
- Name the three built-in subagents and say which tools Explore and Plan are denied
You asked how session timeouts work in a codebase you did not write. Claude
grepped, read session.ts, then timeouts.ts, then four config files, and
answered in two paragraphs. The answer was right. But six thousand tokens of
file contents now sit in your window and get re-sent with every message for the
rest of the session — for two paragraphs you would have been happy to receive on
a sticky note.
This level is the first time you hand work to something that is not you. Start with the smallest version of that: subagents are
Delegated workers inside one session that do a side task in their own context and return a summary — Run agents in parallel
Inside one session is what separates this lesson from the rest of the level.
Subagents work within a single session and report results back to the
conversation that spawned them. One running in the background is not invisible —
/tasks lists it and lets you check on, attach to, or stop it. But its findings
arrive in your conversation when it finishes, and that is the fact the rest of
this lesson turns on.
Delegation is a context decision, not a speed decision
The docs open the subagent page with the use case rather than the mechanism, and the use case is context:
Use one when a side task would flood your main conversation with search results, logs, or file contents you won't reference again: the subagent does that work in its own context and returns only the summary. — Create custom subagents
Note the qualifier: you won't reference again. That is the whole test. Lesson 3.1 established that your window is a budget and that every token in it is paid for on every subsequent turn. A subagent does not stop the files being read, and running one is not free — the docs note that several subagents at once multiply token usage. It moves the reading somewhere you are not paying rent on.
Since context is your fundamental constraint, use subagents to keep research out of it. When Claude researches a codebase it reads lots of files, all of which consume your context. Subagents run in separate context windows and report back summaries — Best practices
The mechanism is stated plainly, and Lesson 8.2 is entirely about its consequences:
Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. — Create custom subagents
Which makes a subagent the second of the two documented ways out of the infinite exploration — scope the investigation narrowly, or delegate it so the reading does not consume your main context. Lesson 1.4 builds that failure and both fixes in full. What it does not settle — and what the rest of this lesson is about — is how much of the delegated reading comes back anyway.
What comes back, and what it costs
Be exact about the return value, because everything else follows from it. The context-window walkthrough traces a subagent that researches session timeouts:
Only the subagent's final text response comes back to your context, plus a small metadata trailer with token counts and duration. The subagent read 6,100 tokens of files. You got a 420-token result. That's the context savings. — Context window
| Where it happens | What it costs your window |
|---|---|
| The subagent's file reads | Nothing — "None of this touches your main context" |
| The subagent's tool calls and intermediate reasoning | Nothing |
| The subagent's final text response | Its full length, in your window |
| Token counts and duration | A small metadata trailer |
Read the third row twice. The saving is not a property of delegating; it is the gap between what was read and what was returned. Six thousand tokens read and four hundred returned saves you most of six thousand. Six thousand read and four thousand pasted back saves you very little, and cost a round trip to get.
The trap: treating subagents as free parallelism
The obvious move once you learn this is to fan out — five subagents, one per module, all at once. The docs flag exactly that shape:
When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context. — Create custom subagents
Parallel research is a documented pattern and works best when the research paths do not depend on each other. But the number that matters is not how many subagents you spawned; it is the total size of what they hand back.
When the main conversation is the right place
The docs give the decision as two lists, not a rule. This is the whole of it:
| Stay in the main conversation when | Delegate when |
|---|---|
| The task needs frequent back-and-forth or iterative refinement | The task produces verbose output you don't need in your main context |
| Multiple phases share significant context — planning, implementation, testing | You want to enforce specific tool restrictions or permissions |
| You're making a quick, targeted change | The work is self-contained and can return a summary |
| Latency matters |
That last row is the one that catches people who have just learned the trick. The docs spell out why: a subagent that isn't a fork "starts fresh and may need time to gather context" — it re-derives what you already have. For a thirty-second question that is a bad trade. Lesson 8.3 covers forks, which are the exception to that sentence.
There is also a cheaper instrument you already own. Lesson 3.2 introduced
/btw, and the subagent page points at it by name: for a question about
something already in your conversation, use /btw instead of a subagent. It
sees your full context, has no tool access, and the answer is not added to
history. If the answer is already in the room, do not send someone out for it.
The built-in agents you already have
You do not have to author anything to start delegating. Claude Code ships
several built-in subagents and delegates to them on its own, based on the task
description in your request, the description field in subagent configurations,
and current context. Three of them account for most of what you will see:
| Built-in | Tools | What it is for |
|---|---|---|
| Explore | Read-only tools; Write and Edit are denied | File discovery, code search, codebase exploration |
| Plan | Read-only tools; Write and Edit are denied | Codebase research during plan mode |
| General-purpose | Every tool available to subagents | Complex research, multi-step operations, code modifications |
Claude delegates to Explore when it needs to search or understand a codebase without making changes, which is most of the delegating you will see. The denial is a documented property of the agent, not a hopeful instruction in its prompt: Write and Edit are denied. Plan is why Level 4 felt cheaper than it should have — in plan mode, research is delegated to the Plan subagent so exploration output stays in a separate context window while the main conversation remains read-only. You were already using this level's mechanism; you just were not the one who asked.
Scoping the brief so the summary stays small
Two facts about how a subagent is briefed, both of which change what you type.
First, you are not writing the subagent's prompt. Claude writes it from your
message, and an @-mention only pins which subagent receives it — Lesson 8.2
quotes that rule and works out the rest of what the brief has to carry. So a
request is not a handover. Whatever you want the subagent to be told has to be
recoverable from what you said to Claude.
Second, the docs' own example of a good delegation names the report, not the topic:
Use a subagent to run the test suite and report only the failing tests with their error messagesCompare that with "use a subagent to run the tests". Both delegate. Only one constrains the return value, and the return value is the part you pay for. The phrase carrying the weight is report only. It generalises to three clauses:
| Clause | Example |
|---|---|
| The work | run the test suite |
| The filter | report only the failing tests |
| The shape | with their error messages |
Lesson 2.3 made the case for pointing at the pattern rather than the outcome. This is the same instinct aimed at a different target: describe the deliverable, because with a subagent the deliverable is the only thing that survives the trip.
Which is the point to leave with. A subagent is not a faster Claude and not a second pair of hands. It is a boundary you draw around a piece of reading, and the brief is where you decide how much comes back across it.
Checkpoint
-
You spawn a subagent to review three modules and it returns a 3,000-token report. Did you save context? What would you need to know to answer, and what would you change next time?
Show answerAnswer
You cannot tell yet, and that is the point. The saving is not a property of delegating; it is the gap between what was read and what came back. Six thousand tokens read and four hundred returned saves you most of six thousand; six thousand read and four thousand pasted back saves very little and cost a round trip to get. So the missing number is how much reading the subagent did — the small metadata trailer that arrives with the report carries the token counts. What is not in doubt is that all 3,000 tokens of the report are in your window at full length, and are now conversation history.
Next time, constrain the return value rather than the topic. The docs' good delegation names the report — "run the test suite and report only the failing tests with their error messages" — which splits into the work, the filter and the shape. The filter, report only, is the clause that decides what you pay.
-
You are debugging a failing test with Claude and expect several rounds of "try this, no, try that". Which of the two documented lists does that task fall into, and why?
Show answerAnswer
The first list: stay in the main conversation. Your task is that list's first row almost verbatim — it needs frequent back-and-forth and iterative refinement — and each "try that" only makes sense against what the last attempt did, so the phases share context rather than separating cleanly.
The latency row seals it. A subagent that isn't a fork starts fresh and may need time to gather context, so every round would open by re-deriving what you already have, and what comes back is one summary rather than a conversation. The delegation list wants self-contained work that can return a summary; a debugging loop is neither self-contained nor done after one report.
-
A colleague says "delegate to Explore so it can fix the config while it's in there". Name the specific reason that cannot happen.
Show answerAnswer
Explore cannot write: its tools are read-only and Write and Edit are denied. That denial is a documented property of the agent, not a hopeful instruction in its prompt, so no phrasing of the brief reaches around it — Explore is for file discovery, code search and codebase exploration.
If the config genuinely has to change, that is general-purpose work, the built-in with every tool available to subagents, or a custom agent you wrote for it.
-
Rewrite this into a brief whose return value you can predict: "Use a subagent to look into our logging setup."
Show answerAnswer
Name the work, the filter and the shape: "Use a subagent to find every place we configure logging and report only the file paths and the log level each one sets. No code changes, no recommendations." The original delegates a topic; this delegates a deliverable, and with a subagent the deliverable is the only thing that survives the trip.
The phrase doing the work is report only. "Look into our logging setup" leaves the size of the return value entirely to the subagent, and the size of the return value is the part you pay for.