[BUG] CLAUDE_CONFIG_DIR does not redirect global CLAUDE.md — still loaded from hardcoded ~/.claude/CLAUDE.md

Resolved 💬 2 comments Opened Jul 8, 2026 by d3249 Closed Jul 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The session loads $HOME/.claude/CLAUDE.md (the personal, default-path file) even though:

$CLAUDE_CONFIG_DIR is confirmed correctly set to $HOME/.claude_job (verified via echo $CLAUDE_CONFIG_DIR inside the session)
Session data, memory, and transcripts are correctly written under $HOME/.claude_job/projects/..., confirming the variable is respected for those paths

This means personal CLAUDE.md content (in my case: personal workflow preferences, language-learning notes, unrelated project context) leaks into an employer-account session, which is a meaningful isolation/privacy concern for anyone using CLAUDE_CONFIG_DIR specifically to separate work and personal contexts.

Possibly related: #3833 (reports partial/inconsistent CLAUDE_CONFIG_DIR coverage across different config paths)
Same issue reported on https://github.com/anthropics/claude-code/issues/64458

Impact: Anyone relying on CLAUDE_CONFIG_DIR for multi-account isolation (a pattern Anthropic's own docs and several community guides recommend) will have their default account's global CLAUDE.md silently injected into every other account's sessions.

What Should Happen?

Per the docs (code.claude.com/docs/en/claude-directory): "If you set CLAUDE_CONFIG_DIR, every ~/.claude path on this page lives under that directory instead." This does not hold true for the global CLAUDE.md file.
I maintain two separate Claude Code configs to isolate a personal account from an employer-provided enterprise account:

Personal (default): $HOME/.claude, containing $HOME/.claude/CLAUDE.md
Employer ("job"): $HOME/.claude_job, set via a project-level .envrc (export CLAUDE_CONFIG_DIR="$HOME/.claude_job")

Error Messages/Logs

Steps to Reproduce

Set CLAUDE_CONFIG_DIR=$HOME/.claude_job for a given project (I use direnv, but a plain export reproduces it too)
Ensure $HOME/.claude_job has no CLAUDE.md of its own
Ensure $HOME/.claude/CLAUDE.md exists with some content
Start a session inside the project: claude
Ask Claude Code which CLAUDE.md files were loaded and from what paths

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.204

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗