[BUG] CLAUDE_CONFIG_DIR environment variable behavior unclear - still creates local .claude/ directories

Resolved 💬 7 comments Opened Jul 17, 2025 by szrlee Closed Jan 29, 2026

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

  1. Set CLAUDE_CONFIG_DIR=/path/to/global/claude/config environment variable
  2. Start Claude Code session in a workspace directory
  3. Use Claude Code tools that require permissions (e.g., Bash commands)
  4. 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:

  1. Global configuration in $CLAUDE_CONFIG_DIR/:

/mnt/bn/xxx/.claude/
├── .claude.json
├── .claude.json.backup
├── .credentials.json
├── projects/
├── shell-snapshots/
├── statsig/
└── todos/

  1. Local workspace configuration:

/opt/tiger/aiic_verl/.claude/
└── settings.local.json

### Additional Context

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?

View original on GitHub ↗

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