CLAUDE_CONFIG_DIR does not redirect user memory — ~/.claude/CLAUDE.md still loaded (undocumented)
Version: Claude Code v2.1.238, macOS (darwin 25.5)
Setup: A second, isolated environment via CLAUDE_CONFIG_DIR=$HOME/.claude-vanilla, which contains its own CLAUDE.md, settings.json, and skills.
Observed: /context in a session launched with the custom config dir lists both $CLAUDE_CONFIG_DIR/CLAUDE.md (and its @-imports, loaded without prompting) and ~/.claude/CLAUDE.md — the literal default path — as loaded memory files. The "external includes" trust dialog fires for the @-import found in ~/.claude/CLAUDE.md, naming that imported path. Declining keeps the import unresolved, but the pointer file itself still enters context in every session.
Docs gap: memory.md documents ~/.claude/CLAUDE.md as user memory and sessions.md documents CLAUDE_CONFIG_DIR as relocating storage; neither specifies whether ~/.claude/CLAUDE.md remains in the memory lookup under a custom config dir. Whichever behaviour is intended, it's currently unspecified — and the current behaviour breaks the isolated-second-environment use case (A/B baselining against vanilla, clean-room configs), since the default environment's memory leaks into the custom one.
Repro:
- Put an
@-import in~/.claude/CLAUDE.md. - Create
~/.claude-vanilla/with its ownCLAUDE.md. CLAUDE_CONFIG_DIR=~/.claude-vanilla claude, then run/context→~/.claude/CLAUDE.mdappears in memory files, and the trust dialog names its import.
Ask: document the intended lookup order under CLAUDE_CONFIG_DIR; ideally have it fully redirect user memory (or provide an explicit isolation flag).