[BUG] Claude Code login not working in dev containers in VS Code
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?
Claude Code login does not work in dev containers in VS Code.
devcontainer.json:
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
},
"mounts": [
"source=claude-code-config,target=/home/vscode/.claude,type=volume"
],
I login successfully and I authorize Claude Code to use my account subscription, but then I get "Failed to retrieve auth status after login" in the Claude Code chat in VS Code.
What Should Happen?
Login should work
Error Messages/Logs
Failed to retrieve auth status after login
Steps to Reproduce
Create the devcontainer.json described above and try to login.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.211 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
I also tried to run claude from VS code terminal and not just from the extension. Login is successful... but then it immediately says that I am not logged in. Same problem if I click the login button in the Claude Code extension. I tried many times.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗