CLAUDE.md hierarchy, imports and scoping
Where each CLAUDE.md lives (managed, user, project, local, subdirectory), how the files concatenate instead of overriding, what @path imports and the .claude/rules/ directory do and do not save, and how to diagnose loading with /memory, /context and claudeMdExcludes.
Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization
~8 min read · 10 practice questions ·
What the exam expects
- Place an instruction at the right CLAUDE.md scope given who must receive it: the whole organization, one developer in every project, the team in one repository, or one developer in one repository.
- Diagnose hierarchy problems, such as a new teammate missing conventions that live in someone's user-level file, or two files giving contradictory instructions.
- Use
@pathimports so each package's CLAUDE.md pulls in only the standards files its maintainer considers relevant, knowing imports organize but do not save context. - Split a monolithic CLAUDE.md into topic files under
.claude/rules/, and share rule files across repositories with symlinks. - Verify memory files with
/memoryand/context, and silence irrelevant ones withclaudeMdExcludes.
Key terms: CLAUDE.md (Markdown instructions Claude reads at session start); scope (managed policy, user, project or local location that decides who shares a file); import (@path/to/file inside a CLAUDE.md that expands the file into context); rules directory (.claude/rules/, auto-discovered topic files); on-demand loading (subdirectory files that load only when Claude touches a file there).
Key facts
- Detail
./CLAUDE.mdor./.claude/CLAUDE.md, shared via source control
- Detail
./CLAUDE.local.md, gitignored
- Detail
- Concatenated, not overridden; Claude may pick either instruction
- Detail
- Loads when Claude reads, writes or edits a file there; not listed at launch
- Detail
- Relative to the importing file; maximum depth four hops
- Detail
- Load at launch, so no saving
- Detail
- Auto-discovered recursively; load at launch like
.claude/CLAUDE.md
- Detail
- Managed settings such as
permissions.deny, not CLAUDE.md
claudeMdExcludes- Detail
- Globs on absolute paths; any settings layer; cannot skip managed CLAUDE.md
- Detail
- Project CLAUDE.md and rules need
"project"insettingSources
Sources for this section (4)
- Why does a teammate miss instructions that work for you, although you both use the same repository?
- When does
packages/api/CLAUDE.mdload in a session started at the repository root? - Why does replacing CLAUDE.md sections with
@imports not shrink context? - How do you stop another team's package CLAUDE.md loading only on your machine?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Claude Certified Architect - Foundations pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 30 lessons of the Claude Certified Architect - Foundations guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (10 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams
Practice for the Claude Certified Architect - Foundations exam
Certifyforce is an independent study resource and is not affiliated with, endorsed by or sponsored by Anthropic. Claude is a trademark of Anthropic.