CCLearn

What a subagent inherits, and what it does not

verified against Claude Code 2.1.261 · 2026-09-0916 min

By the end you can

  • List the five things that never reach a fresh subagent
  • State what a custom subagent does load, including CLAUDE.md and git status
  • State that a subagent's context window is sized by its own model, and what that costs when you route to a cheaper one
  • Say which two subagents skip CLAUDE.md and git status, and which kind of rule must travel in the brief anyway
  • Write a brief that carries the facts the subagent cannot see for itself

You spend twenty minutes with Claude working out that the retry logic must not touch the queue module, and why. Then you type: use a subagent to apply that fix the way we discussed.

The subagent has never heard of the discussion. It will not say so. It will produce something confident and plausible, because a task prompt that references a conversation it cannot see is a task prompt with a hole in it, and a hole gets filled.

Lesson 8.1 made the case for delegating. This lesson is about the boundary that makes delegation work, read from the inside: what is in that second window when it opens, and what is not.

A fresh, isolated window

Each subagent starts with a fresh, isolated context window. It doesn't see your conversation history, the skills you've already invoked, or the files Claude has already read. — Subagents

The sentence immediately after it is the one people skip, and it is where the whole lesson lives: "Claude composes a delegation message that summarizes the task, and the subagent works from there."

So the subagent is not reading your request. It is reading a summary of your request that Claude wrote. Everything the subagent knows about your intent survived a round of compression it was not present for.

The one exception is a fork, which inherits the conversation instead of starting fresh. That is Lesson 8.3; everything below describes a non-fork subagent.

What is actually in the window when it opens

The docs enumerate the startup contents exactly (Subagents):

What loadsWhere it comes from
System promptThe agent's own prompt plus environment details Claude Code appends — not the Claude Code system prompt
Task messageThe delegation prompt Claude wrote when it handed off the work
CLAUDE.md filesEvery level of the hierarchy the main conversation loads: ~/.claude/CLAUDE.md, project rules, CLAUDE.local.md, managed policy files
Git statusA snapshot taken at the start of the parent session; absent outside a Git repository or when includeGitInstructions is false
Preloaded skillsFull content of any skill named in the agent's skills field. Built-in agents preload none
Sibling rosterA system reminder listing main and every other named agent in the session — but only when the subagent's tools include SendMessage and at least one other agent already has a name. Added in v2.1.206

Read the first row twice. A custom subagent does not run Claude Code's system prompt at all:

Subagents receive only this system prompt plus basic environment details like the working directory, not the Claude Code system prompt. — Subagents

The body of the agent file is the whole personality. Authoring that file is Lesson 8.4; what matters here is that a subagent's defaults are its author's defaults, not the ones you have been working under all session.

The five things that never cross

What stays behindWhat that costs you
Your conversation history"The way we discussed" resolves to nothing
The skills you have already invokedThe body of the skill you ran is not there
The files Claude has already readAn @ reference from an hour ago is not a shared reference
Your output styleIt runs its own system prompt, so the shape you set does not shape its report
The main conversation's auto memoryEverything Lesson 6.4 described as remembered about you is absent

Two of these deserve their exact wording, because both are commonly assumed backwards.

Output style: a subagent runs its own system prompt, so your output style doesn't shape its responses, except in a fork. — Subagents

Auto memory: the main conversation's auto memory isn't loaded. To give a subagent persistent memory of its own, use the memory field. — Subagents

The window is not the size you think

One more thing does not come from the parent, and it is not a piece of content:

Context window size: a subagent's context window is sized by its own model, not the parent's. Delegating to a model with a smaller window gives that subagent the smaller window. — Subagents

That is the whole documented fact, and it is worth resisting the urge to extend it into a rule of thumb about which tasks fit where. What it does tell you is that "route this to a cheaper model" is not only a price decision. A subagent on a smaller model is doing your research inside a smaller budget than the one you were reasoning about when you scoped the task.

What a custom subagent does load

Here is the assumption that costs people the most, because it is the opposite of what "fresh, isolated context window" suggests:

Explore and Plan skip your CLAUDE.md files and the parent session's git status to keep research fast and inexpensive. Every other built-in and custom subagent loads both. — Subagents

Your project conventions are already there. So is the git status snapshot. The context-window walkthrough puts the cost where it belongs:

The subagent loads CLAUDE.md too. Same file, same content, but it counts against the subagent's context, not yours. — Context window

MCP servers and skills come across as well: "The subagent has access to the same MCP servers and skills. It gets most of the parent's tools, minus several that don't apply in a nested context, including plan-mode controls, background-task tools, and by default the Agent tool itself to prevent recursion" (Context window).

Lesson 3.2 showed compaction re-injecting CLAUDE.md and auto memory from disk while everything that had only ever existed in the conversation was summarised away. It is tempting to carry that sorting rule across — on disk survives, in the conversation does not — and here it breaks. Compaction re-injects auto memory from disk, and re-injects the body of every skill you invoked (Context window). The subagent boundary drops both, and both sit on disk either way.

So there is no rule to derive here, only a list.

Explore and Plan are the exception

The two research agents skip both, deliberately, and you cannot change it:

Explore and Plan are the only subagents that omit CLAUDE.md and git status. There is no frontmatter field or per-agent setting to change which agents skip them. — Subagents

Which sounds worse than it is, because of where their output lands:

The main conversation reads Explore and Plan results with full CLAUDE.md context, so most rules don't need to reach the subagent itself. If a rule must, such as "ignore the vendor/ directory," restate it in the prompt you give Claude when delegating. — Subagents

Note the shape of the distinction. A rule that governs how the findings are interpreted is fine where it is. A rule that governs how the search is conducted has to travel. "Ignore vendor/" changes what gets read, so it must be in the brief.

Writing the brief the subagent cannot infer

There is one more mechanic that surprises people, and it applies even when you name the agent yourself:

Your full message still goes to Claude, which writes the subagent's task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. — Subagents

You never write the subagent's prompt. You write the message that Claude summarises into one. Which means a fact only reaches the subagent if it is stated plainly enough in your message to survive being summarised.

So the brief carries the three things the boundary strips, and nothing that CLAUDE.md already supplies:

text
Use a subagent to find every call site that retries a failed publish.

The queue module is off limits — we established that this morning and it is
not written down anywhere.

Report a list of file paths with line numbers and the retry count each site
uses. No code changes, no recommendations.

Three moves: the decision that only exists in chat, restated; the entry point, named, because the subagent cannot see what you already read; and the report shape, specified, because your output style is not doing it for you. Contrast that with "apply that fix the way we discussed", where all three are missing and none of them will announce their absence.

The point

A subagent is not a colleague who was in the room. It is a stranger who has read your project's documentation and nothing else — and who has your CLAUDE.md, your git status, your MCP servers and your skills, in its own copy of the window, paid for out of its own budget.

Write to that stranger. The facts it is missing are exactly the ones you would never think to say out loud, because you and Claude agreed them an hour ago.

Checkpoint

  1. You ask a custom subagent to "follow the conventions in the file you just read". Name two separate reasons that sentence fails, and say which one CLAUDE.md would have covered for you.

    Show answer

    Two failures, one per half of the sentence. "The file you just read" points at nothing: a subagent starts with a fresh, isolated context window and does not see the files Claude has already read, so an @ reference from earlier in your session is not a shared reference. And you are not writing the subagent's prompt at all — Claude composes a delegation message that summarises the task, and the subagent works from that, so a phrase that only resolves inside your conversation is gone before it arrives.

    CLAUDE.md covers the first one, and only where the conventions are project conventions written there: a custom subagent loads every level of the hierarchy the main conversation loads, so naming the convention instead of the file would have needed no paste at all. It does nothing for the second. Anything agreed only in chat has to be stated plainly enough in your message to survive being summarised.

  2. A teammate says a subagent must be told the project uses pnpm, because subagents start with an empty context. Where is that wrong, and what would you check to settle it?

    Show answer

    The premise is wrong for a custom subagent. "Fresh, isolated context window" means no conversation history, no already-read files, no invoked skill bodies — not an empty window. Every custom subagent, and every built-in except Explore and Plan, loads your CLAUDE.md files at every level of the hierarchy plus the parent session's git status, and reaches the same MCP servers and skills. Pasting the package manager in is the mirror-image trap: it spends the subagent's window on a second copy of a file already open in front of it.

    Two checks settle it. Open the CLAUDE.md hierarchy and confirm the pnpm rule is actually written down — if it only ever lived in a conversation, your teammate is right by accident. Then check which agent you are delegating to, because Explore and Plan skip CLAUDE.md, and for those the rule has to travel only if it governs how the search is conducted.

  3. You delegate research to Explore with the instruction "skip anything under generated/". Does that instruction need to be in the brief, or is the project rule enough? Now answer the same question for "always report file paths as repository-relative".

    Show answer

    It has to be in the brief. Explore is one of the two subagents that omit CLAUDE.md and the parent's git status, and there is no frontmatter field or per-agent setting to change that, so the project rule never reaches it. "Skip anything under generated/" is also the kind of rule that must travel: it governs how the search is conducted, changing what gets read, which is the same shape as the docs' own example, "ignore the vendor/ directory".

    The path-format rule falls on the other side of that line. It governs how the findings are interpreted rather than what gets read, and the main conversation reads Explore and Plan results with full CLAUDE.md context — so most rules, that one included, do not need to reach the subagent. The test is never how important the rule feels; it is whether it changes what the subagent reads.

Sources