Context Engineering · ~7 min
Your instructions arrive from four sources at once. Knowing which one wins — and where it physically lands — is how you stop an agent from "ignoring" a rule.
@AGENTS.md primacy nuance from Lesson 03.
Instructions stack in layers, each more specific than the one above it. On a conflict, specificity wins — the layer closest to the task usually overrides the ones further out.
"Always write tests" in CLAUDE.md, then a user message "skip tests for now" → the agent skips them.
Correct for the immediate task, but it just overrode your project convention. That's the stack working as designed —
and why duplicating a rule across layers is a drift bomb: change one copy and you've authored a silent contradiction.
A sub-agent starts fresh — its own system prompt, none of the parent's project instructions, skills, or history unless explicitly passed at invocation. Layering without an injection protocol is "operationally equivalent to having no project layer for sub-agents." Debug what the sub-agent received, not what the parent had.
@-import is verbatim concatenation at load timeClaude Code expands @path imports at session start — pulled in verbatim, equivalent to
concatenation. So position is real: @AGENTS.md on line 1 injects that file into primacy,
making the end of CLAUDE.md the true global tail (Lesson 03). Broken imports fail silently —
rename the target and the agent just loads fewer rules, no error.
Each layer adds to total instruction volume, and past the compliance ceiling the lowest-priority rules (usually the project layer) get silently dropped. Ten rules in a flat prompt beat forty spread across four layers.
Retrieval practice — recall, don't peek
Question 1On a conflict between layers, which tends to win?
Question 2How much of the parent's project instructions does a sub-agent inherit?
Question 3A Claude Code @-import loads the referenced file…
Question 4As you add instruction layers, low-priority rules tend to be…
Question 5 · spaced recall from Lesson 05An API signature written into a CLAUDE.md is…
content/
harness (system → @AGENTS.md → CLAUDE.md → rules → skills)? Or see how .claude/rules/ with
paths: changes the load timing vs an @-import? Say so — next up is where we'll pause
lessons and run the full audit-instruction-file skill across everything.