Where does Claude Code look for CLAUDE.md files?
Claude Code reads CLAUDE.md from up to four scopes: a managed file at /Library/Application Support/ClaudeCode/CLAUDE.md, your personal ~/.claude/CLAUDE.md, the project's ./CLAUDE.md or ./.claude/CLAUDE.md, and a gitignored ./CLAUDE.local.md. It also walks up from your working directory and loads subfolder files on demand. All of them stack; none replaces another.
The four CLAUDE.md locations
| Scope | Path on macOS | Who it affects |
|---|---|---|
| Managed | /Library/Application Support/ClaudeCode/CLAUDE.md | Everyone on the Mac. Set by IT; you read it, you don't edit it. |
| User | ~/.claude/CLAUDE.md | You, in every project. |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | Everyone who clones the repo, once it's committed. |
| Local | ./CLAUDE.local.md | You, in this project only. Add it to .gitignore. |
On Linux the managed file lives at /etc/claude-code/CLAUDE.md, and on Windows at C:\Program Files\ClaudeCode\CLAUDE.md. The other three paths are the same on every platform.
What goes where
- User: how you like to work everywhere. Your package manager, commit style, tools you prefer.
- Project: what any teammate needs. Build and test commands, folder layout, naming conventions.
- Local: things that are true only on your machine for this repo. Your sandbox URL, a test account, a port you use.
A common mistake is putting personal preferences in the project file, where they get committed for the whole team, or putting project facts in ~/.claude/CLAUDE.md, where they leak into every other repo.
Load order: how the files stack
When you run claude in ~/code/app/web, Claude Code loads CLAUDE.md and CLAUDE.local.md from that folder and every folder above it, so ~/code/app/CLAUDE.md loads too. Content is ordered from the top of the tree down to where you launched, and within one folder CLAUDE.local.md comes after CLAUDE.md. Instructions closest to you are read last.
Files in folders below your working directory load later, the first time Claude touches a file in that folder. That is why a subfolder CLAUDE.md won't show in the launch list.
Two more places instructions come from
.claude/rules/
Markdown files in .claude/rules/ (project) or ~/.claude/rules/ (user) load like extra CLAUDE.md files. Add paths frontmatter to make one load only for matching files:
---
paths:
- "src/api/**/*.ts"
---
- Every endpoint validates its input.@imports
A line like @docs/git-instructions.md inside any CLAUDE.md pulls that file in. Relative paths resolve from the file that contains the import, and imports can nest up to four levels.
Check what actually loaded
- Start a session in the project folder.
- Run
/context alland read the Memory files list. - Run
/memoryto open any of them in your editor.
If a file you expect is missing, check the folder you launched from. Claude Code only walks up from there at launch, so starting in a sibling folder skips that branch's files.
Next: the same scopes exist for settings, with different rules. See which settings.json wins. If Claude is ignoring a long file, read how long CLAUDE.md should be.
Questions
- Where is the global CLAUDE.md on a Mac?
- At ~/.claude/CLAUDE.md, inside the hidden .claude folder in your home directory. Claude Code loads it in every project you open on that Mac. In Finder, press Command-Shift-G and type ~/.claude to open the folder.
- Should the project CLAUDE.md go in the root or in .claude/?
- Either works. Claude Code reads ./CLAUDE.md and ./.claude/CLAUDE.md as the project file. The root is easier for teammates to spot; .claude/ keeps the repo root tidy next to .claude/settings.json.
- Do CLAUDE.md files override each other?
- No. Every file that loads is added to context, ordered from the broadest scope to the most specific. If two files disagree, Claude may follow either one, so the fix is to remove the conflict, not to rely on order.
- Does Claude Code read CLAUDE.md in subfolders?
- Yes, on demand. A CLAUDE.md in a subdirectory of where you started Claude loads the first time Claude reads, writes or edits a file in that subdirectory. Files in parent directories load at launch.
- How do I check which CLAUDE.md files loaded?
- Run /context all in a session and look under Memory files. /memory lists the files too and opens one for editing.
Rulebook for Mac
Rulebook is a native Mac app we are building for these files. It shows every CLAUDE.md and settings.json level side by side, lets you drag a rule from one file to another, and edits permissions without hand-written JSON. See the features.
Rulebook is in development and not available yet.
Email us about the launch