Knowledge · D1 · D3 · How-To

Why Subagents Don't Automatically Inherit CLAUDE.md and How to Fix It.

First time I noticed my subagents ignoring our project conventions I assumed Claude had regressed; the real cause was that CLAUDE.md never traveled with the spawn. Subagents start blank because CLAUDE.md is a parent-session filesystem read, not a transmitted artifact - here is how to force inheritance on every call.

D1 Agentic ArchitecturesD3 Agent OperationsHowTo · 5 steps

Last updated

01 · TLDR

The short version

Subagents are independent Claude instances with fresh context windows. CLAUDE.md is a local filesystem convention the parent session reads at startup; it is never transmitted to spawned subagents. To make a subagent respect your project rules, inject a distilled convention block into its system prompt or first turn on every spawn. Centralize the block in one template so updates propagate without hand-editing five agent definitions. On the CCA-F exam this surfaces under D1 and D3 as scenario stems where a subagent breaks a stated rule and you must name the missing inheritance step.

02 · Why this matters in production

The silent rule-dropping bug

A code-review subagent shipped a PR that violated three of our project rules in one pass: it added a server-side import to a client file, used a forbidden API, and renamed a public export. Each rule was clearly written in CLAUDE.md. The reviewer returned a clean summary and approved the diff. The bug was not the reviewer; it was the assumption that CLAUDE.md is ambient. It is not. The reviewer never saw a single rule because none had been injected into its context. This is the most common multi-agent bug in production Claude Code pipelines and it is silent - the subagent does not warn you it is missing rules, it just operates without them.

Per the vault's context-window guidance: "Coordinator delegates with full 150KB case context expecting inheritance. Subagent wastes 100KB on irrelevant history. Fix: coordinator extracts a 2KB TASK_CONTEXT and passes only that. Subagent has 198K for actual research." The same principle applies to CLAUDE.md - except the default is not 150KB of garbage, it is zero KB of rules.

03 · The mechanics

How parent context is built, why subagents miss it, and what to inject

When Claude Code starts in a project directory, it loads CLAUDE.md in a defined order. Per the /concepts/claude-md-hierarchy page in the vault: "(1) reads user ~/.claude/CLAUDE.md (personal defaults); (2) reads project root .claude/CLAUDE.md or root CLAUDE.md (shared); (3) while editing a file, checks all .claude/rules/*.md files, tests the paths glob against the filename, and loads matches. All loaded content is concatenated and injected as context into Claude's system prompt." This is a one-time, parent-session filesystem operation.

A subagent does not repeat that operation. The Skilljar Introduction to Subagents course (Lesson 1) is explicit: "Each one runs in its own conversation context window... The intermediate steps - all the file reads, searches, and tool calls - stay in the subagent." The flip side is also true: anything the parent loaded into its own context is not visible to the subagent unless the parent explicitly passes it in the spawn message.

The fix has three layers. First, identify the rules that govern the subagent's task class - if it is a reviewer, the relevant rules are review standards and anti-patterns; if it is a styler, design tokens and component patterns. Second, extract those rules into a convention block, typically 10-30 lines. Third, inject the block at spawn time. The Skilljar Lesson 4 quote nails the intent: "This separation also lets you encode project-specific review standards in the subagent's system prompt, ensuring consistent review criteria across the team." The catch: that encoding does not happen automatically. You write it.

A minimal injection pattern looks like this:

# subagents/reviewer.md
---
name: reviewer
description: Code review subagent for this project
---

# Project convention block (mirror of CLAUDE.md §Code Style + §Anti-Patterns)
- Server-side imports never appear in app/ or components/.
- Named exports only; no default exports in lib/.
- Type hints required on every function (mypy strict).
- Reject any PR that adds a NEXT_PUBLIC_*KEY* variable unless it is a publishable key.

# Specialized review criteria
- Run git diff first.
- Flag every violation of the block above before commenting on style.
- Cite the violated rule by section so the human can verify.

Three things matter about that snippet. The convention block is scoped to what a reviewer needs - not the full CLAUDE.md. It is labeled as a mirror of CLAUDE.md so a future maintainer knows where the source of truth lives. The specialized criteria reference the block directly, which gives the subagent a closed loop: rule, check, citation. Without that structure the subagent treats the rules as advisory and ignores them under load.

For a multi-subagent pipeline (one orchestrator, four specialists), build a shared template loader. The orchestrator reads CLAUDE.md once, slices it into per-role blocks (reviewer block, styler block, security block, docs block), and injects the appropriate slice on each spawn. This costs one file - the loader - and prevents the failure mode where five subagent definitions each carry their own stale copy of the rules. Treat the rules like code: one source, many consumers, never hand-copied.

04 · Decision rule and checklist

Six steps to bulletproof inheritance

  1. Catalog which rules each subagent class needs. Reviewers need anti-patterns; stylers need design tokens; security subagents need the secrets boundary. A subagent does not need the rules of a class it never executes.
  2. Distill a per-class convention block from CLAUDE.md. 10-30 lines, scoped to the task class. Label it as a mirror so future maintainers find the source.
  3. Inject the block at the system-prompt layer when possible.System prompts cache; first-turn injections do not. Across many spawns this is a real cost saving.
  4. Reference the block from the subagent's task instructions.Tell the subagent explicitly to check the block before producing output, not to treat it as background context.
  5. Centralize block storage in one file or loader. Hand-copying guarantees drift. One source, many consumers.
  6. Verify on every meaningful CLAUDE.md change. Re-run a known scenario through each subagent class after editing the rules. A silent regression here is invisible until production catches it.
05 · Common anti-patterns

Five failures we keep seeing

  1. Ambient assumption."The subagent will read CLAUDE.md because it's in the directory." Cause: confusing parent-session behavior with subagent behavior. Fix: treat injection as the only propagation mechanism.
  2. Full-file dump. Injecting the entire 500-line CLAUDE.md into every spawn. Cause: avoiding the work of distillation. Fix: scope blocks to the task class; let unused rules stay in the parent.
  3. Hand-copied blocks. The same convention block pasted into five subagent definitions. Cause: no loader. Fix: one file, one source; every subagent reads from the same template.
  4. Background-context tone.Block injected but the subagent told "here are some guidelines" instead of "check this before output." Cause: weak prompt structure. Fix: make the block a hard constraint, with the cite-on-violation pattern in §The mechanics.
  5. Path-scoped rule blindness. A scoped rule in .claude/rules/*.md that auto-loads in the parent never reaches the subagent that triggers it. Fix: inject scoped blocks explicitly when spawning a subagent that will touch matching files.
06 · CCA-F exam mapping

How this shows up on the exam

Domains
D1 Agentic Architectures (27%) · D3 Agent Operations (20%)
What is tested
Whether you can name the inheritance step as the defect when a subagent produces output inconsistent with stated project rules. The exam pattern is diagnostic: given a symptom, identify the architectural cause.
Stem pattern
A multi-agent pipeline ships output that violates a documented project rule. What change makes the subagent enforce the rule?
Distractor to reject
"The subagent should re-read CLAUDE.md from disk." Subagents do not browse filesystems for convention files; injection is the only mechanism.
Second distractor
"Increase the parent's context window." The parent already has the rules; the subagent does not. Window size does not change what crosses the spawn boundary.
Third distractor
"Switch to a larger model." A model upgrade does not invent rules that were never in context. This is the Model vs Design distractor heuristic documented in ACP-T03 §6.
07 · Sources

Vault and external references

  • Vault: data/aeo/reports/2026-05-17-recommendations.md §Signal 3 - source of the original five-bullet recommendation that seeded this page.
  • Vault: public/concepts/context-window.md§Where you'll see it in production - documents the 150KB-vs-2KB TASK_CONTEXT pattern that informs the distillation step.
  • Vault: public/concepts/claude-md-hierarchy.md §How it works - authoritative three-level load order (user → project → path-scoped) that subagents do not repeat.
  • Vault: 99-attachements/asc-a01-skilljar-course-content/course-16-introduction-to-subagents/lesson-01-what-are-subagents.md - Anthropic Skilljar definition: "Each one runs in its own conversation context window... intermediate steps stay in the subagent."
  • Vault: 99-attachements/asc-a01-skilljar-course-content/course-16-introduction-to-subagents/lesson-04-using-subagents-effectively.md - Skilljar quote on encoding project-specific review standards in the subagent's system prompt.
  • Vault: 02-tasks/acp-t03-claude-architect-competitive-research.md- "Subagents do NOT inherit coordinator context automatically. Every required fact must be explicitly passed in the subagent prompt. No shared memory, no history propagation."
  • Vault: public/concepts/subagents.md- "The message list inside the subagent is isolated from the coordinator. Every file read, every tool call, every intermediate result stays in that nested context window."
08 · Related

Adjacent reads