CLAUDE_CONFIG_DIR does not replace ~/.claude — both CLAUDE.md files loaded

Resolved 💬 3 comments Opened Mar 3, 2026 by mieubrisse Closed Mar 31, 2026

Environment

  • Platform: Anthropic API
  • Operating System: macOS 15 (Darwin 25.2.0)
  • Terminal: Ghostty + tmux

Bug Description

When CLAUDE_CONFIG_DIR is set to a custom path, Claude Code loads CLAUDE.md from both $CLAUDE_CONFIG_DIR/CLAUDE.md and ~/.claude/CLAUDE.md. The expectation is that CLAUDE_CONFIG_DIR fully replaces ~/.claude/ as the config directory, so only $CLAUDE_CONFIG_DIR/CLAUDE.md should be loaded.

Steps to Reproduce

  1. Set CLAUDE_CONFIG_DIR to a path other than ~/.claude/ (e.g., export CLAUDE_CONFIG_DIR=~/.agenc/missions/<id>/claude-config)
  2. Have a CLAUDE.md in both $CLAUDE_CONFIG_DIR/ and ~/.claude/
  3. Start Claude Code
  4. Run /context

Expected Behavior

Only $CLAUDE_CONFIG_DIR/CLAUDE.md is loaded. ~/.claude/CLAUDE.md should not appear in context.

Actual Behavior

Both files are loaded into context:

Memory files
└ ~/.agenc/missions/<id>/claude-config/CLAUDE.md: 6.1k tokens
└ ~/.claude/CLAUDE.md: 4.6k tokens

This wastes ~4.6k tokens of context on duplicate/stale instructions.

Additional Context

~/.claude/ is a real directory (not a symlink). CLAUDE_CONFIG_DIR is set by an orchestration system (AgenC) that manages multiple Claude Code instances, each with their own config directory. The ~/.claude/CLAUDE.md being loaded in addition to the config-dir version defeats the purpose of CLAUDE_CONFIG_DIR as a config directory override.

The same issue likely affects settings.json, skills/, hooks/, etc. — if Claude Code is reading from both directories, permissions and hooks may also be merged unexpectedly.

View original on GitHub ↗

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