Skip to navigation

Claude Code Subagent Memory: Why Parallel Agents Repeat the Same Work

In short: Claude Code subagents start with isolated context. Parallel agents can repeat file reads and rediscover the same facts unless you share a task brief.

Published 17 min read
On this page

Direct answer

Parallel Claude Code subagents repeat work because each starts with fresh, isolated context. They do not automatically receive the parent’s full conversation. Give every subagent the same concise task brief, explicit file boundaries, known facts, and a required return format so each agent can start from shared evidence instead of rediscovering it.

Official: initial context includes the system prompt, task message, CLAUDE.md files, git status, and preloaded skills. It does not include the parent’s full history. A useful handoff therefore belongs in the task message or in repository guidance the agent actually receives, not in an assumption that the parent’s memory is shared.

The concrete win is less duplicated discovery and fewer contradictory reports. The honest loss is briefing effort and staleness: a shared brief can become wrong as the repository changes, and adding too much context can bury the part that matters. Measure repeated reads and corrected assumptions before claiming any token saving.

Why isolation matters

Isolation protects a subagent from unrelated conversation history. A scout investigating billing does not need every earlier discussion about deployment or UI styling. Fresh context can keep the assignment focused and make the returned report easier to attribute.

The cost appears when important facts remain only in the parent session. If the parent already knows which package owns invoices, which test command works, and which approach was rejected, the subagent may search for those facts again. Several agents can then perform the same discovery in parallel.

This is not a hidden shared-memory feature that needs a setting. The subagents documentation describes isolated startup context and specific inherited inputs. Design the handoff around those inputs rather than assuming an undocumented memory channel.

Isolation also makes ownership easier. Each agent can return a self-contained report with evidence and open questions. The parent becomes the integration point, comparing reports and resolving disagreements instead of expecting every agent to know the whole session.

Cost of repeated discovery Why it happens Practical signal
Repeated file reads Agents start from the same broad question Reports cite the same files and passages
Repeated searches Package boundaries are absent from the brief Multiple agents run similar repository searches
Contradictory assumptions Agents see different slices of current state Recommendations disagree without new evidence
Rejected work Earlier decisions stay in parent history An agent proposes an approach already ruled out
Review overhead Reports duplicate facts A human must reconcile the same evidence again

The proof-of-work packet helps at the integration point. Each report should identify what was inspected, what changed, and what remains uncertain. A shared brief reduces overlap, but it does not replace verification.

What subagents inherit

Official: a custom subagent begins with a fresh context window. Its initial inputs include the system prompt, the task message, CLAUDE.md files, git status, and preloaded skills. Those are concrete handoff surfaces.

The task message is the most direct place to put assignment-specific facts. Include the objective, relevant paths, known constraints, rejected approaches, and the expected report shape. Do not paste the entire parent transcript and call it a brief.

CLAUDE.md files provide repository-level guidance. Anthropic’s large-codebase guidance recommends a root file for big-picture pointers and subdirectory files for local conventions. A subagent receives those files according to its context, so put durable facts at the scope where they belong.

Git status gives the agent a view of current repository state. It does not explain why a file changed or which change is safe to keep. If that rationale matters, write it into the brief.

Preloaded skills can add relevant instructions. They do not guarantee that every skill or every parent-session discovery is available. Check the actual task inputs instead of assuming a broader memory transfer.

Inherited input Good use Common misuse
System prompt Baseline operating rules Assuming it contains project decisions
Task message Scope, facts, constraints, return format Copying unrelated conversation history
CLAUDE.md files Durable repository conventions Hiding task-specific decisions in global guidance
Git status Current change awareness Treating status as change rationale
Preloaded skills Relevant packaged instructions Assuming every parent skill is loaded

Official: combined custom subagent descriptions above 15,000 tokens trigger a startup warning. A warning threshold is not a target brief size. Focus the task enough that the agent can find the important constraint without scanning a large specification.

Claude Code Subagent Memory evidence map showing fresh context receiving a task brief and CLAUDE.md guidance before returning a report
Claude Code Subagent Memory evidence map. Anthropic documents fresh context and specific inherited inputs; the diagram does not imply an undocumented shared memory store or guaranteed recall.

What subagents do not inherit

The parent’s full history is not automatically visible. Missing context includes earlier conclusions, tool results, discarded approaches, and conversational corrections that never made it into the task message or repository guidance.

A parent may remember that a dependency was rejected because it broke a browser test. A subagent without that fact can recommend the same dependency after inspecting the code. The mistake is not poor model reasoning. The handoff omitted a constraint.

Subagents also do not automatically inherit each other’s reports. Parallel agents can finish with different views of the same subsystem, and the parent must compare the returned evidence. Treat reports as inputs to integration, not as a shared conclusion that every agent already knows.

Compaction is a separate mechanism. Official: compaction replaces older turns with a server-written summary while recent turns remain word for word. A summary can reduce what the parent carries forward, but it does not turn isolated subagents into participants in one shared transcript.

The compaction context-retention test is useful when a long parent session prepares several briefs. Preserve exact constraints before compaction so an important rejected approach does not disappear from the handoff.

Do not respond to isolation by creating an unmaintained parallel knowledge store. A handoff file is useful only when its owner updates it and agents know where to find it. The context-portable migration guide explains how to keep task state usable across interfaces without depending on hidden state.

Duplicated discovery

Duplication often begins with an underspecified question. “Investigate authentication” gives every agent permission to read the same entry points, configuration, and tests. “Check whether the session middleware refreshes expiry, using these two files and this test command” gives the agent a starting point and a boundary.

Some overlap is healthy. Independent agents may read the same evidence and reach the same conclusion, which can increase confidence. The problem is unplanned overlap that consumes attention without adding a new check or perspective.

A shared scouting phase can reduce the overlap. Send one read-only agent to map the relevant package, identify candidate files, and return open questions. Then give implementation or review agents distinct slices of that map. The monorepo search and token-budget guide provides a broader retrieval pattern.

Reports should expose duplication. Ask each agent to list the files it inspected and the questions it answered. If two reports contain the same investigation and no independent check, merge them into one finding instead of treating repetition as corroboration.

Duplication mode Brief failure Better handoff
Same entry-point search No candidate paths supplied Include a short scouting map
Same test discovery No known command or fixture supplied Name the command and relevant fixture
Same convention lookup Local CLAUDE.md scope is unclear Point to the owning subdirectory
Same decision revisited Rejected approaches are omitted List decisions that must not be reopened
Same report written twice Return formats are vague Assign a distinct question and evidence shape

The large-codebase guidance supports scoped search, ignore files, read-only exploration, and codebase maps. It does not publish a fixed Claude Code token-saving percentage in the frozen record. Treat retrieval improvements as hypotheses to measure.

Claude Code Subagent Memory workflow from fresh context through a shared task brief and CLAUDE.md pointers to a structured returned report
Claude Code Subagent Memory workflow. The handoff uses official inherited inputs; the workflow is editorial guidance and does not claim that every subagent otherwise repeats all work.

A handoff packet

A handoff packet should be short enough to read and specific enough to act on. It is a contract for the task, not a compressed copy of the entire session.

Start with one objective sentence. Add the repository scope, known facts, constraints, and the evidence required in the report. If an earlier approach was rejected, say why. If a file is outside scope, name it.

Use stable references. A path, symbol, test command, or issue identifier is more useful than “the relevant module.” When the repository is large, point to the owning package and its local CLAUDE.md instead of making the agent search from the root.

Separate facts from hypotheses. A known fact can be stated directly. A hypothesis should include the check that would confirm or reject it. This keeps the agent from treating the parent’s guess as evidence.

Packet field What to include Why it reduces repeat work
Objective One answerable question Prevents scope expansion
Scope Owning package and candidate paths Narrows discovery
Known facts Verified current state Avoids rediscovery
Constraints Forbidden paths and required behavior Prevents rejected work
Prior decisions Chosen approach and rejected alternatives Preserves rationale
Tools and tests Known command or fixture Avoids test setup loops
Return format Findings, evidence, changes, open questions Makes reports comparable
Freshness check What must be re-read now Limits stale assumptions

The worktree isolation guide adds a writable boundary when agents edit code. A brief can state that a task is read-only, owns one module, or must return a proposed patch for a shared file. Context isolation and filesystem isolation solve different problems.

Include permission constraints in the brief as well. The repository-hook security review explains why project code can run at tool boundaries. A subagent should know which actions require review instead of discovering that boundary through a failed or unsafe attempt.

Freshness needs an owner

A handoff packet needs an owner. The owner updates verified facts when the repository changes and removes conclusions that no longer apply. Without that responsibility, a once-useful brief becomes stale context that every agent receives with confidence.

Separate durable guidance from temporary state. Package conventions and test commands belong in the appropriate CLAUDE.md scope when they remain true across tasks. A current branch name, an unmerged experiment, or a suspected regression belongs in the task brief because it may be irrelevant tomorrow.

Git status is an inherited input, but it does not explain intent. If one agent is editing a file and another is reviewing it, state that relationship explicitly. Otherwise the reviewer may treat an in-progress change as the baseline and build its recommendation on top of unfinished work.

Require a freshness check for decisive facts. An agent can acknowledge the brief and still verify the current file before acting. The check catches stale paths, renamed symbols, and changed test behavior without forcing every agent to repeat the entire discovery phase.

Worked example: count overlap before claiming savings

Consider a synthetic scouting batch with three agents and four candidate files. Each agent receives a broad question and reads all four files. The batch performs 3 × 4 = 12 file reads across four unique files, producing eight repeated reads beyond the first pass.

Now give the agents a shared scouting map and distinct questions. One checks the entry point, one checks the data access layer, and one checks the tests. Under the simplified assumption that each needs only its assigned portion, the batch performs four unique reads with no repeated reads in this toy model.

Derived illustration: repeated-read count falls from eight to zero, a reduction of 8 / 12 = 66.7% in this constructed example. The calculation uses chosen inputs, not a Claude Code benchmark, token-saving promise, or claim about real agent behavior.

The simplified model omits important work. Agents may need shared context to interpret their slice, reports may reveal new candidate files, and one agent’s finding may change another’s assignment. Measure the real batch before using the example as a planning estimate.

Capture both unique and repeated reads. A lower read count is not automatically better if the agent misses a decisive file. Pair the efficiency measure with a correctness check and human review.

The MCP output truncation guide matters here because a compact report can hide the decisive failure. Ask agents to preserve the error and its source rather than returning only a summary that looks complete.

Claude Code Subagent Memory tradeoffs between a lean shared brief and the risk of stale or incomplete handoff context
Claude Code Subagent Memory tradeoffs. A shared brief can reduce rediscovery, while stale facts or excess context can mislead agents; the frozen evidence provides no universal duplication rate.

Measurement

Measure the handoff, not just the final answer. A useful comparison holds the repository, model, task, and acceptance criteria constant, then changes only the brief.

Capture unique files read, repeated file reads, search operations, corrected assumptions, report overlap, and review time. If request-level usage is available, capture fresh input and cache-read tokens separately. Do not convert a file count into tokens without an actual tokenizer and content measurement.

Metric How to capture it What it can tell you
Unique reads Distinct paths in agent evidence Breadth of discovery
Repeated reads Same path read by multiple agents Potential overlap
Corrected assumptions Parent notes where a brief was stale or wrong Handoff quality
Report overlap Shared findings with no independent check Duplicated conclusions
Acceptance result Tests or review against fixed criteria Whether efficiency harmed correctness
Human review time Time spent reconciling reports Coordination cost

The cost per verified change framework combines these measures with model or subscription cost. A brief that saves searches but causes a wrong implementation is not a win.

Treat report overlap as a prompt for review, not automatic waste. Two agents may independently inspect the same file because the behavior is high risk or the first report was incomplete. Ask what new evidence the second pass added before removing it from the workflow. Repetition with an independent check can be useful, while repetition with no new observation is a better candidate for consolidation.

Use the prompt-caching break-even math when interpreting request cost. Repeated prefixes can be cheaper than fresh input, but cache identity and TTL still matter. A repeated read is not automatically a repeated full-price request.

Limit the sample and report its limits. The usage tracking and cost API guide describes historical API data and its granularity, not a live trace of every interactive subagent action. Mark missing observability as unknown instead of estimating it silently.

Practical response: brief once, verify twice

Use this sequence when several agents investigate the same area. It creates shared starting evidence without pretending the agents share a hidden memory.

  1. Write one objective and one acceptance check.
  2. Map the owning package and candidate paths.
  3. List verified facts separately from hypotheses.
  4. Note rejected approaches and their reasons.
  5. Assign distinct questions and writable boundaries.
  6. Give each agent the same compact brief plus its specific scope.
  7. Require files inspected, evidence, changes, and open questions in the report.
  8. Compare reports for overlap and disagreement.
  9. Re-read decisive evidence in the current workspace.
  10. Capture duplicated work and review effort before changing the brief again.

If an agent hangs, use the subagent hang and timeout controls. If its history is needed after a stop, check the stop and resume semantics instead of assuming a message restarts the task. When a scout returns a report but the host still counts it as active, use the background running-count diagnosis before dispatching duplicate discovery.

Long sessions may need compaction. The compaction cost worksheet explains the state transition and its cost inputs. Store the handoff packet outside the transcript so a summary does not become the only copy of a critical constraint.

The long-context prefill latency test can help measure a large brief’s latency effect. More context can reduce search while increasing prompt processing, so compare both dimensions.

Claude Code Subagent Memory control checklist for objectives, known facts, task scope, inherited guidance and returned evidence
Claude Code Subagent Memory control checklist. The controls organize official inherited inputs into a practical handoff; they do not claim automatic business-rule recovery or a fixed token reduction.

Honest loss and data gaps

The concrete win is a common starting point. Agents can spend less time finding the same entry points and more time answering distinct questions. Structured reports also make disagreement visible instead of letting each agent sound independently confident.

The honest loss is maintenance. A shared brief can go stale, an overly long brief can obscure the key constraint, and independent agents may still need to read the same evidence to reach a defensible conclusion. Some duplication is the price of independent verification.

Unknown: the frozen sources contain no controlled Claude Code measurement of duplicated discovery, token reduction, or report accuracy from a shared brief. The arithmetic example is illustrative. Future updates should publish the task fixture, model, client version, brief, read log, and acceptance result.

The compaction documentation explains summary behavior, not a guarantee that a handoff preserves every fact. The worktrees documentation explains file isolation, not shared reasoning. Separate context, filesystem, and cost evidence.

The legacy-code characterization workflow is relevant when the missing fact is an undocumented business rule. A brief cannot recover knowledge that no participant has yet captured. Human input remains part of the handoff.

Claude Code Subagent Memory verdict sharing task results through explicit briefs and returned reports rather than assumed hidden memory
Claude Code Subagent Memory verdict. Official documentation confirms isolated startup context and named inherited inputs; the size of any duplication or savings remains unmeasured in the frozen record.

A limited OpenAI-format test route

To compare handoff behavior in another agent, One AI API Key offers an OpenAI-format route. On 2026-11-27, its catalogue showed 76 listed models and 46 available-now free IDs across 22 families. The free IDs share 100 requests and 5,000,000 tokens per day per account, resetting at 05:30 IST / 00:00 UTC. Accounts can have up to three keys, with one request in flight per key on free models.

These free IDs are OpenAI-format only. They are not free Claude Code endpoints. Claude Code uses the Anthropic-format endpoint, and all four Claude IDs were marked unavailable on 2026-11-27. Do not paste a free ID into Claude Code or suggest that its subagent context rules apply to a different harness.

An OpenAI-format agent such as OpenCode, Cline, or Cursor can use the endpoint quickstart for the base URL and first request. The prepaid pricing page documents signup credit and billing without a subscription or seat fee. Use the LLM cost calculator for a separate estimate and review the privacy and retention policy before sharing code.

The loss is comparability. Another harness may expose different context and usage records, so a smoke test can validate the route and your own instrumentation, not reproduce Claude Code’s exact isolation. The coding-agent model selection guide helps choose a test model without attributing harness behavior to model quality.

FAQ

Do Claude Code subagents share the parent conversation?

No. Official: they start with fresh, isolated context and do not automatically see the parent’s full history. Put important facts in the task message, CLAUDE.md guidance, or another explicit handoff surface.

What context does a subagent receive?

The documented initial inputs include the system prompt, task message, CLAUDE.md files, git status, and preloaded skills. The exact task message is therefore a primary place to share scope and constraints.

Should I put every parent detail into the brief?

No. Include facts that affect the assignment, then point to durable repository guidance for the rest. Combined custom subagent descriptions above 15,000 tokens trigger a startup warning, and a larger brief can still hide the decisive constraint.

Can a shared file act as memory?

A maintained brief can carry explicit facts, but it is not a hidden shared-memory system. Assign an owner, update it when facts change, and tell each agent what must be re-checked in the current workspace.

How do I prove the brief reduced duplicate work?

Compare repeated reads, report overlap, corrected assumptions, and acceptance results on a fixed task. The frozen evidence provides no universal percentage, so report the measured sample and its limits.

More Claude Code troubleshooting

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →