[BUG] CLAUDE_CONFIG_DIR environment variable behavior unclear - still creates local .claude/ directories
Environment
- Platform (select one):
- Anthropic API
- AWS Bedrock
- Google Vertex AI
- Other:
- Claude CLI version: Latest
- Operating System: Linux
- Terminal: bash
### Bug Description
I have the CLAUDE_CONFIG_DIR environment variable set to centralize Claude Code configuration, but Claude Code still creates local .claude/ directories in individual workspaces. The purpose and expected behavior of CLAUDE_CONFIG_DIR is unclear since it's not documented in the official documentation.
Steps to Reproduce
- Set CLAUDE_CONFIG_DIR=/path/to/global/claude/config environment variable
- Start Claude Code session in a workspace directory
- Use Claude Code tools that require permissions (e.g., Bash commands)
- Observe that a local .claude/settings.local.json file is created in the workspace
### Expected Behavior
It's unclear what the expected behavior should be since CLAUDE_CONFIG_DIR is not documented. Possible expectations:
- All configuration centralized: CLAUDE_CONFIG_DIR should prevent any local .claude/ directories from being created
- Hybrid approach: Global config in CLAUDE_CONFIG_DIR, workspace-specific settings still stored locally
- Different purpose: CLAUDE_CONFIG_DIR serves a different purpose than local settings
### Actual Behavior
Despite having CLAUDE_CONFIG_DIR set, Claude Code creates both:
- Global configuration in $CLAUDE_CONFIG_DIR/:
/mnt/bn/xxx/.claude/
├── .claude.json
├── .claude.json.backup
├── .credentials.json
├── projects/
├── shell-snapshots/
├── statsig/
└── todos/
- Local workspace configuration:
/opt/tiger/aiic_verl/.claude/
└── settings.local.json
### Additional Context
- The CLAUDE_CONFIG_DIR environment variable is not mentioned in the official documentation:
- https://docs.anthropic.com/en/docs/claude-code/settings
- https://docs.anthropic.com/en/docs/claude-code/cli-reference
- This makes it impossible to determine if the current behavior is a bug or intended functionality
- Would appreciate clarification on the purpose of this environment variable and whether it should be documented
Request: Could you please document the purpose and behavior of CLAUDE_CONFIG_DIR and clarify whether creating both global and local config directories is the intended behavior?
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗