[BUG] VS Code extension ignores CLAUDE_CONFIG_DIR environment variable
Open 💬 12 comments Opened Mar 3, 2026 by pidefrem
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 VS Code extension does not respect the CLAUDE_CONFIG_DIR environment variable, even when set via claudeCode.environmentVariables in VS Code settings or when launching VS Code from a shell where the variable is exported.
The CLI correctly uses CLAUDE_CONFIG_DIR to support multiple profiles/accounts, but the extension always reads from and writes to ~/.claude/ regardless of configuration.
What Should Happen?
The extension should respect CLAUDE_CONFIG_DIR the same way the CLI does, allowing users to maintain separate configurations (e.g., work vs personal accounts) per VS Code profile.
Error Messages/Logs
Steps to Reproduce
- Create a custom config directory (e.g.,
~/.claude-personal) - Set
CLAUDE_CONFIG_DIRvia one of:
claudeCode.environmentVariablesin VS Code settings:
"claudeCode.environmentVariables": [
{ "name": "CLAUDE_CONFIG_DIR", "value": "/path/to/.claude-personal" }
]
- Exporting the variable before launching VS Code:
export CLAUDE_CONFIG_DIR="$HOME/.claude-personal"
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code
- Open the Claude Code extension
- Observe that the extension prompts for login and creates files in
~/.claude/instead of the configured directory
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.63
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Related Issues
- #261 - Added
CLAUDE_CONFIG_DIRsupport for CLI - #4739 -
/idecommand fails whenCLAUDE_CONFIG_DIRis set (locked) - #24963 - Support for multiple accounts/profiles
Environment
- VS Code Version: 1.109.5 (arm64)
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗