[BUG] Claude Code fails to use Config Dir inside VSCode DevContainers
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?
When using Dev Containers in VS Code with the configuration provided in the Anthropic guide, the environment fails to initialize Claude Code using the existing configuration located in ~/.claude.
The ~/.claude directory is correctly bind-mounted into the container with the appropriate permissions (without requiring root access), and its contents match those on the local system. Additionally, the CLAUDE_CONFIG_DIR environment variable is explicitly provided to the Dev Container and points to this mounted directory.
Despite this, the Claude Code CLI does not detect the existing configuration and instead triggers the initial welcome/bootstrap flow.
This setup is intended to persist the local Claude Code configuration into Dev Containers in an authenticated manner, but the configuration is not being recognized inside the container.
What Should Happen?
When executing claude code cli should have the same content as the local system, authenticated and having the sessions.
Error Messages/Logs
Steps to Reproduce
- Using VSCode DevContainers create a new one both config and dockerfile
- Bind the ~/.claude with ``
"source=${localEnv:HOME}/.claude,target=/home/dev/.claude,type=bind"`` - Start the container and try to start claude
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.45
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗