CLAUDE.md Hierarchy
Definition
The set of memory files Claude Code loads and concatenates (broad→specific) into the context as instructions, spanning managed, user, project, and local scopes.
Key points
- Load order, broad→specific (all concatenated, not overriding): Managed policy (
/etc/claude-code/CLAUDE.mdon Linux) → User~/.claude/CLAUDE.md→ Project./CLAUDE.mdor./.claude/CLAUDE.md→ Local./CLAUDE.local.md. - Parent directories are read before child;
CLAUDE.local.mdis read afterCLAUDE.md. Managed policy cannot be excluded. - CLAUDE.md content is delivered as a user message, not enforced config — it is probabilistic guidance, not a hard gate.
- Path-scoped
.claude/rules/*.mdwithpaths:frontmatter globs apply only under matching paths; user rules load before project rules, so project wins. - Hot-reload vs restart: memory files are re-read when changed (and via
/memory), unlikemodel/outputStylewhich need a restart. - AGENTS.md is not read directly — reference it from a CLAUDE.md via
@AGENTS.md. See CLAUDE.md Imports And Rules.
Why it matters for the exam
- D3 (20% of scored content) tests where org-wide vs personal vs project instructions live and that all layers are concatenated rather than one overriding another.
- Distinguishes CLAUDE.md (soft, probabilistic memory) from permissions and hooks (hard config).
Common gotchas
- CLAUDE.md is probabilistic (delivered as a user message) → for hard enforcement of financial/destructive ops use a PreToolUse hook, never CLAUDE.md alone. See PreToolUse hook enforcement.
- Org-wide memory can only be injected via
claudeMdin managed settings. - Managed policy layer cannot be excluded by
claudeMdExcludes.
See also
Sources
Referenced by
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.