Note on selection
Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization
What you need to know
- User-level memory never reaches teammates. Only committed project and directory files do.
- Works for the veteran, broken for the new hire = a rule parked at user level.
- Run
/memoryfirst; it lists the files actually loaded. -
@importpulls standards in by reference;.claude/rules/splits topics into separately ownable files. - Scoping and sharing only — the guide gives no precedence between the three levels, and none is needed: Claude Code concatenates every file it finds rather than letting one override another.
Claude Code builds its instruction set ("memory") by combining several CLAUDE.md files. The skill being measured is knowing which file a given instruction belongs in, and diagnosing the symptoms when it sits in the wrong one.
The three levels the exam grades
| Level | Path | Applies to | Reaches teammates? |
|---|---|---|---|
| User | ~/.claude/CLAUDE.md |
every project that one user opens | No — never version-controlled |
| Project | .claude/CLAUDE.md or root CLAUDE.md |
everyone who clones the repo | Yes |
| Directory | a CLAUDE.md inside a subdirectory |
one package or service in the tree | Yes |
The guide describes scoping and sharing here and nothing more. It states no precedence or override order, so on the exam an answer that ranks one level over another is inventing a rule — pick the option that reasons from who receives the file, never from which file wins.
That holds because in Claude Code nothing wins: every discovered file is concatenated into context rather than overriding another.33 The order runs from the filesystem root down to your working directory, so the file closest to where you launched is read last. There is also a fourth location the guide does not cover — a managed policy CLAUDE.md that an organization deploys machine-wide and that individual settings cannot exclude. That is where a compliance standard belongs; a project file is the wrong instrument for a rule nobody may opt out of.
The diagnostic pattern
The "works on my machine" configuration bug: a senior engineer's conventions are honored in their sessions, but a new team member does not receive them. The cause is almost always instructions parked in user-level ~/.claude/CLAUDE.md instead of project-level configuration. The fix is to move them into the committed project file.
/memory is the instrument. It lists the memory files actually loaded in the current session, so you can see what Claude is really reading before theorizing about behavior that differs between sessions or teammates.34
Keeping it modular
Two mechanisms stop CLAUDE.md from growing into an unreadable monolith.
| Mechanism | What it does | Reach for it when |
|---|---|---|
@import |
references an external file from inside CLAUDE.md |
each package should pull in only the standards its maintainers know apply |
.claude/rules/ |
holds topic-specific rule files: testing.md, api-conventions.md, deployment.md |
one file has grown too large to review or own |
The split into .claude/rules/ also makes each topic separately reviewable, and it is the prerequisite for the path scoping in 3.3.35
The trade-off to remember: project and directory files are shared and code-reviewed; user-level files are private and invisible to review. Anything the team must obey has to be committed.
Show the three levels of CLAUDE.md configuration as a tree of scopes, which of them travel through version control to teammates, and which modular files (@import targets, .claude/rules/) hang off each level. It describes scoping and sharing only, not any precedence or override order.
Click a level to highlight the edge label describing its own scope — personal to one machine, or committed and received by every clone.
Worked examples
Diagnosing the "new hire gets no conventions" bug
Scenario 2 · Code Generation with Claude CodeA team lead has been telling Claude Code for months to use a specific error-handling wrapper and to never edit generated migration files. It works flawlessly in their sessions. A new engineer joins, clones the repo, and Claude immediately edits a generated migration.
The first move is /memory in each session to list loaded memory files. The lead's session loads ~/.claude/CLAUDE.md; the new engineer's does not, because that file exists only on the lead's machine. The rules were user-scoped all along. The fix is to move the team-relevant instructions into the committed project-level file and leave only genuinely personal preferences (e.g. preferred commit-message tone) in the user-level file.
# In each engineer's session, list the loaded memory files
/memory
# Move the team-relevant rules out of personal memory and commit them
git add CLAUDE.md .claude/rules/
git commit -m "chore: move error-handling and migration rules to project memory"Monorepo: per-package CLAUDE.md that imports only relevant standards
Scenario 4 · Developer Productivity with ClaudeA monorepo has packages/api (GraphQL), packages/web (React) and infra/ (Terraform). A single root CLAUDE.md containing every convention would push infra rules into every frontend session and waste context.
Instead the root file carries only universal facts, and each package's directory-level CLAUDE.md uses @import to include the standards files its maintainers know are relevant. Nothing is duplicated: the shared standards live once under docs/standards/ and are referenced from wherever they apply.
# API package
This package owns the public GraphQL schema.
## Standards that apply here
@docs/standards/graphql-conventions.md
@docs/standards/testing.md
@docs/standards/error-handling.md
## Local notes
- Resolvers live in `src/resolvers/`; never call the database directly from a resolver.
- Schema changes require a matching entry in `CHANGELOG.md`.Splitting a 900-line CLAUDE.md into .claude/rules/
A CLAUDE.md that has grown to hundreds of lines is hard to review, and pull requests touching it produce unreadable diffs. Split it by topic into .claude/rules/testing.md, .claude/rules/api-conventions.md and .claude/rules/deployment.md, each owned by the team that cares about it. The remaining CLAUDE.md becomes a short orientation document. This also sets you up for path scoping (task statement 3.3): once rules are separate files they can be activated conditionally instead of always loaded.
repo/
CLAUDE.md # short: what the project is, how to build it
.claude/
rules/
testing.md # test layout, fixtures, coverage expectations
api-conventions.md # versioning, error envelope, pagination
deployment.md # release process, migration safety
packages/
api/CLAUDE.md # directory-level, @imports the API standards
web/CLAUDE.mdAnti-patterns
- Putting team-wide coding standards in
~/.claude/CLAUDE.mdinstead of a committed project-level file because user-level memory is never shared through version control and new teammates silently get nothing. - Growing one monolithic root
CLAUDE.mdinstead of splitting topics into.claude/rules/files or importing them because the file becomes unreviewable and loads irrelevant context into every session. - Copy-pasting the same standards text into every package
CLAUDE.mdinstead of using@importbecause the copies drift apart and nobody knows which one is authoritative. - Guessing why behavior differs between sessions instead of running
/memoryto see which files are loaded because the hierarchy is invisible until you inspect it.
How it is examined
- Stems that describe "works for the senior engineer, not for the new team member" are asking you to identify user-level vs project-level scoping — pick the answer that moves instructions into version-controlled project configuration.
- The tempting wrong answer is usually "tell the new hire to copy the file into their
~/.claude/directory": it restores the behavior but leaves the standard unshared and unreviewable. - When the stem mentions a huge
CLAUDE.mdand wasted context, the right answers involve@importselectivity or.claude/rules/topic files, not shortening prose or raising a context limit. Know which half does which:.claude/rules/with apathsglob is the one that removes tokens from sessions that do not need them, while@importbuys ownership and reviewability. Imports are expanded into context at launch, so importing from a rootCLAUDE.mdreorganizes the file without shrinking the session.
Beyond the exam — what the API does that this does not grade
The guide names three levels. Claude Code reads two more, and they change where a rule belongs.33
| Location | Path | Who it binds |
|---|---|---|
| Managed policy | macOS /Library/Application Support/ClaudeCode/CLAUDE.md; Linux and WSL /etc/claude-code/CLAUDE.md; Windows C:\Program Files\ClaudeCode\CLAUDE.md |
every user on the machine |
| Local instructions | ./CLAUDE.local.md, gitignored |
just you, in this project |
A managed policy file cannot be excluded by individual settings. That is what makes it the right home for a rule nobody may opt out of, and a project file the wrong one. Everything else can be skipped: the claudeMdExcludes setting takes paths or globs, so a monorepo can drop another team's ancestor CLAUDE.md without editing it.
References — 3 sources
- How Claude remembers your project Anthropic Settles the precedence question the guide leaves open: discovered CLAUDE.md files are concatenated in load order rather than overriding each other. Also adds the two locations the three-level table omits — machine-wide managed policy, which individual settings cannot exclude, and gitignored `CLAUDE.local.md` — and states that path-scoped rules trigger when Claude *reads* a matching file, that `@path` imports load at launch so they do not reduce context, and that rules with `paths:` are not re-injected after `/compact`.
- Debug your configuration Anthropic The diagnostic split behind "run `/memory` first": `/context` reports what actually loaded into the session, while `/memory` lists and opens the memory files for editing.
- Explore the .claude directory Anthropic The annotated map of everything Claude Code reads under `.claude/`, which shows `@import` targets, `rules/` with `paths:` globs and directory-level files as entries in one documented layout rather than isolated mechanisms.
Live product docs — where they differ from the exam guide, answer from the guide. All references
Exam guide, verbatim — what is measured
Knowledge of
- The CLAUDE.md configuration hierarchy: user-level (~/.claude/CLAUDE.md), project-level (.claude/CLAUDE.md or root CLAUDE.md), and directory-level (subdirectory CLAUDE.md files)
- That user-level settings apply only to that user—instructions in ~/.claude/CLAUDE.md are not shared with teammates via version control
- The @import syntax for referencing external files to keep CLAUDE.md modular (e.g., importing specific standards files relevant to each package)
- .claude/rules/ directory for organizing topic-specific rule files as an alternative to a monolithic CLAUDE.md
Skills in
- Diagnosing configuration hierarchy issues (e.g., a new team member not receiving instructions because they're in user-level rather than project-level configuration)
- Using @import to selectively include relevant standards files in each package's CLAUDE.md based on maintainer domain knowledge
- Splitting large CLAUDE.md files into focused topic-specific files in .claude/rules/ (e.g., testing.md, api-conventions.md, deployment.md)
- Using the /memory command to verify which memory files are loaded and diagnose inconsistent behavior across sessions