The global CLAUDE.md is ~/.claude/CLAUDE.md in your home directory: Claude Code loads it in every project you open, before the project’s own instructions (Anthropic: memory file locations). On Windows that path is %USERPROFILE%\.claude\CLAUDE.md, and if you set CLAUDE_CONFIG_DIR, the file lives in that directory instead (Claude directory reference).
Applies to: Claude Code on macOS, Linux, WSL and Windows, per Anthropic’s memory, settings and directory docs. Last checked: November 5, 2026.
On this page
Where the global CLAUDE.md is on each system
Anthropic’s docs write every user-level path as ~/.claude/.... Two notes in the docs turn that into a real path: on Windows, ~/.claude resolves to %USERPROFILE%\.claude, and when CLAUDE_CONFIG_DIR is set, every ~/.claude path moves under that directory (Claude directory reference; settings).
| Your setup | Global CLAUDE.md path | Source |
|---|---|---|
| macOS, Linux or WSL, default config | ~/.claude/CLAUDE.md | Memory docs |
| Windows, default config | %USERPROFILE%\.claude\CLAUDE.md | Settings note on Windows |
CLAUDE_CONFIG_DIR set (any OS) | <CLAUDE_CONFIG_DIR>/CLAUDE.md | Claude directory reference |
| Personal rules split into files | ~/.claude/rules/*.md | User-level rules |
The third row matters if you run several accounts. Anthropic’s own example for CLAUDE_CONFIG_DIR is an alias, alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude' (environment variables). A session started through that alias reads ~/.claude-work/CLAUDE.md, not ~/.claude/CLAUDE.md, so each config directory needs its own copy. In a settings file, Anthropic says to write the variable as an absolute path, because ~ is not expanded there, and project or local settings cannot set it.
To open the file from a session, Anthropic points to /memory, which lists the loaded memory files and opens them for editing (troubleshooting).
Global, organization and project files compared
“Global” can mean two different files. The user file covers only you. An organization can also deploy a managed CLAUDE.md that applies to every user on the machine and cannot be excluded with claudeMdExcludes (organization-wide CLAUDE.md).
| Scope | Location | Who it covers | Load order |
|---|---|---|---|
| Managed policy | macOS /Library/Application Support/ClaudeCode/CLAUDE.md; Linux and WSL /etc/claude-code/CLAUDE.md; Windows C:\Program Files\ClaudeCode\CLAUDE.md | All users on the machine | First |
| User (global) | ~/.claude/CLAUDE.md | Only you, all projects | Second |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | Team, via source control | Third |
| Local | ./CLAUDE.local.md | Only you, one project | Last at its level |
The order comes from Anthropic’s table, which lists the files “from broadest scope to most specific, so a project instruction appears in context after a user instruction” (memory docs). Files are concatenated, not merged: nothing in the project file deletes a line from the global one. Managed settings can also carry the organization text in a claudeMd key instead of a separate file.
For project files, see the CLAUDE.md best practices guide.
What to put in it, and what to keep out
Anthropic describes the user file as “personal preferences for all projects”, with code styling preferences and personal tooling shortcuts as examples. It suggests adding an instruction when Claude makes the same mistake twice or you type the same correction you typed last session (when to add to CLAUDE.md).
A practical test: would the line still be true in a repository you have never opened? “Reply in British English” passes. “Run pnpm test before committing” fails in a project that uses another package manager, so it belongs in that project’s file. Multi-step procedures fit better in a skill, which loads only when needed.
Keep it short. Anthropic’s target is under 200 lines per CLAUDE.md, and Claude Code shows a warning at startup and in /status when a file is over the recommended length. A file over 4 MiB is skipped. Imports with @path help you organize, but imported files load together with the file that imports them, so they do not save context (size guidance).
Imports inside the user file load without the approval dialog that project files trigger for external paths, because Anthropic treats ~/.claude/CLAUDE.md and ~/.claude/rules/ as files you wrote yourself. The exception is Cowork sessions on the desktop, which skip user-file imports that resolve outside the session’s working directory and skip a ~/.claude/CLAUDE.md that is a symlink or hard link (imports).
Check that the global file loaded
Run /context all and look under Memory files (set up a project CLAUDE.md). If ~/.claude/CLAUDE.md is not listed, Claude cannot see it. Common causes, each from Anthropic’s docs:
| What you see | Likely cause | Fix |
|---|---|---|
| File missing from Memory files | It sits under a different config directory than the session uses | Check whether CLAUDE_CONFIG_DIR is set for that session (env vars) |
| User, project and rules files all missing | Project instructions set to managed-only in /config | Pick another value; managed-only loads only the managed file and auto memory at launch (choose which files load) |
Notice Instruction file not loaded (a Read deny rule covers it) | A Read deny rule matches the path | Narrow the rule, then start a new session (errors reference) |
| Notice about reads outside your working directories | permissions.blockReadsOutsideWorkingDirectories is on | Move the file or its link target inside the working directories (errors reference) |
| File loads, Claude ignores a line | Vague or conflicting instructions across files | Make the line specific; run /doctor prompt-audit (v2.1.283 or later) to list conflicts (audit) |
The global file also survives a repository switch to AGENTS.md. By default Claude Code reads a project’s AGENTS.md only when no project CLAUDE.md or CLAUDE.local.md exists, and your ~/.claude/CLAUDE.md does not count for that check: it keeps loading alongside AGENTS.md (AGENTS.md). The CLAUDE.md vs AGENTS.md guide covers the project side.
It guides Claude; it does not block anything
Anthropic is direct about this: Claude treats CLAUDE.md “as context, not enforced configuration”, and to block an action regardless of what Claude decides, you use a PreToolUse hook (memory docs). For organizations, the docs map hard limits to managed settings such as permissions.deny and sandbox.enabled, and behavioral guidance to the managed CLAUDE.md. A line such as “never push to main” in your global file is a reminder; the Claude Code hooks guide shows how to make a check deterministic. Keep credentials out of any instruction file.





