Domain 3 · Claude Code Configuration

The CLAUDE.md hierarchy

CLAUDE.md is the file Claude Code reads as standing instructions — the project's "house rules." But there isn't one file; there's a hierarchy: user-level, project-level, and directory-level, each layered on top of the last. Knowing which file wins where is the single most configuration-heavy thing the exam tests.

user / project / directorylayering ~/.claude/CLAUDE.mdimports specificity
Explain like I'm 10
Think of rules at school. There are rules for the whole school (no running), rules for your classroom (raise your hand), and rules for the art corner (wear an apron). The art-corner rules are most specific, so they win there — but the school rules still apply everywhere else. CLAUDE.md works the same way: the file closest to the work you're doing has the loudest voice.

Click a folder — see which rules apply

Claude Code reads from broad to specific and stacks them. A more specific file doesn't erase the broader ones — it adds to and overrides them for its scope. Click around the tree to see the effective rule set for a file in that location:

Effective instructions for the selected file:

The three (plus one) levels

LevelLocationScope
User~/.claude/CLAUDE.mdEvery project on your machine — your personal defaults.
Project<repo>/CLAUDE.md (committed)The whole repo — shared team conventions.
Directory<repo>/sub/CLAUDE.mdJust that subtree — e.g. backend-only rules.
Local / personalCLAUDE.local.md (git-ignored)Your private overrides for a repo, not shared.

Files can also pull in others with @path/to/file imports, so you keep one source of truth and reference it instead of copy-pasting. The closer a file is to the code being edited, the higher its precedence.

Exam trap: directory-level files add to the broader ones — they don't replace the whole stack. And put shared conventions in the committed project CLAUDE.md; put personal tweaks in ~/.claude/CLAUDE.md or CLAUDE.local.md. Mixing these up (committing personal prefs, or putting team rules only in your user file) is a classic wrong answer.
Takeaways: CLAUDE.md is a layered hierarchyuser (~/.claude) → project (committed) → directory (subtree) → local (git-ignored personal). More-specific files add to and override broader ones for their scope; they don't wipe the stack. Use @imports for one source of truth. Shared rules → committed project file; personal rules → user/local file.

Curated companion: Claude Code — Memory & CLAUDE.md.