CLAUDE_CONFIG_DIR does not isolate global CLAUDE.md — always loads from ~/.claude/CLAUDE.md
Version
2.1.143
OS
macOS
Severity
Documentation mismatch / isolation break
Summary
The docs state:
CLAUDE_CONFIG_DIR: Override the configuration directory (default:~/.claude). All settings, credentials, session history, and plugins are stored under this path.
This is false. The global user CLAUDE.md is always loaded from ~/.claude/CLAUDE.md regardless of CLAUDE_CONFIG_DIR.
Reproduction
# Fresh config dir — no CLAUDE.md inside it
CLAUDE_CONFIG_DIR=~/.claude.test claude
With ~/.claude/CLAUDE.md present, the injected system prompt contains its full contents even though the active config dir is ~/.claude.test.
Proof: intercepting the raw API payload shows the second user block grows from ~410 chars (just baseline context, when ~/.claude is absent) to ~5,428 chars (same + full ~/.claude/CLAUDE.md content) when ~/.claude is restored — with CLAUDE_CONFIG_DIR unchanged throughout.
The path surfaced in the injection is:
Contents of ~/.claude/CLAUDE.md (project instructions, checked into the codebase)
This path is not in the CWD directory ancestry, ruling out a project-level walk. It is a hardcoded load.
Impact
The advertised multi-account isolation pattern:
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
...does not isolate system prompt instructions. Any CLAUDE.md in ~/.claude bleeds into every profile. For users with sensitive per-account instructions, this is a real confidentiality and behaviour break.
Expected behaviour
Global CLAUDE.md should be loaded from $CLAUDE_CONFIG_DIR/CLAUDE.md, not ~/.claude/CLAUDE.md.
Actual behaviour
Global CLAUDE.md is always loaded from ~/.claude/CLAUDE.md.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗