CLAUDE_CONFIG_DIR still does not isolate user memory: ~/.claude/CLAUDE.md always loads (v2.1.233)

Status Open
Reported on v2.1.233
Maintainer reply None cached
Activity 0 comments · opened Aug 15, 2026

Environment

  • Claude Code v2.1.233, macOS (darwin), installed at ~/.local/bin/claude
  • CLAUDE_CONFIG_DIR pointed at a fresh shadow directory

Steps to reproduce

  1. Create a shadow config dir: mkdir -p ~/claude-shadow and put a marker memory file in it: echo "# MARKER" > ~/claude-shadow/CLAUDE.md
  2. Ensure no CLAUDE.md exists in the cwd's ancestor directories.
  3. Run:

``sh
CLAUDE_CONFIG_DIR="$HOME/claude-shadow" claude -p 'List the file paths of every CLAUDE.md whose contents appear in your context. Output only the paths.'
``

Expected

Only $CLAUDE_CONFIG_DIR/CLAUDE.md (plus any project CLAUDE.md) is loaded. The docs at https://code.claude.com/docs/en/debug-your-config say pointing CLAUDE_CONFIG_DIR at an empty folder yields a session with "no user or project settings, hooks, MCP servers, plugins, or memory."

Actual

Both files load:

/Users/<user>/claude-shadow/CLAUDE.md
/Users/<user>/.claude/CLAUDE.md

The real-home ~/.claude/CLAUDE.md is read unconditionally, in addition to the shadow one.

Additional data point: with --setting-sources project,local, the $CLAUDE_CONFIG_DIR/CLAUDE.md drops out of context, but ~/.claude/CLAUDE.md still loads. So the hardcoded read is not gated by the user setting source either — it bypasses both isolation mechanisms.

Workaround

"claudeMdExcludes": ["/Users/<user>/.claude/CLAUDE.md"] in the shadow dir's settings.json works (verified on 2.1.233).

Prior reports

#47056 (closed not-planned), #59701, #30230, #58815 — all closed/locked; filing fresh per the lock message. The behavior still reproduces on 2.1.233, and it directly contradicts the debug-your-config doc quoted above.

View original on GitHub ↗