[BUG] VS Code extension: login fails with "Request failed with status code 400" at code-exchange step
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?
Cannot log in to Claude Code in the VS Code extension. The login flow
completes every step except the last: the emailed code is accepted, but
exchanging it in the extension returns "Request failed with status code
400".
Started immediately after updating VS Code and the Claude Code extension
on 2026-08-28. Still failing after 3 days.
Ruled out, all reproducing the same 400:
- Renamed ~/.claude/.credentials.json to .bak, full VS Code restart,
completely clean re-login
- Full extension uninstall, VS Code closed completely, reinstall from
marketplace, clean login
- Installed a previous extension version via "Install Another Version"
- All 15 claudeCode settings checked (User and Workspace): Disable Login
Prompt off, Claude Process Wrapper empty, no Environment Variables set
- ANTHROPIC_API_KEY not set (shell and Windows environment variables)
- Code.exe fully disappears from Task Manager on close (no lingering
process)
- Fails identically on a company Team account and a personal Pro account
- Code pasted immediately, verified via Notepad for trailing whitespace,
always the newest code
- Full machine restart
Network is not blocking it: the code email is delivered, so the request
reaches the server. The Claude desktop app on the same machine works
fine throughout.
<img width="312" height="788" alt="Image" src="https://github.com/user-attachments/assets/4c7d1ace-0149-4e19-951b-573dd89bb537" />
What Should Happen?
The pasted login code should be accepted and the extension should
authenticate successfully.
Error Messages/Logs
Request failed with status code 400
Steps to Reproduce
- Open the Claude Code panel in VS Code
- Click "Claude.ai Subscription"
- Browser opens correctly; request the login code
- Code arrives by email normally
- Paste the code into the Claude Code panel in VS Code
- Click sign in
- Error appears: "Request failed with status code 400"
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown version number — the one installed before the 2026-08-28 update
Claude Code Version
2.1.250/251
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
- The Claude desktop app on the same machine works fine throughout, so
this is specific to the VS Code extension.
- After "Developer: Reload Window" a logged-in Claude Code window with
session history is briefly visible, then it drops back to the login
screen.
- Since both the stored credentials AND the extension files have been
fully replaced, and a previous extension version fails identically,
this does not appear to be local state corruption.
- Company laptop without install permissions: cannot install the
standalone CLI, so claude doctor, /logout and CLI-based
workarounds are unavailable.
- Authentication method: Claude.ai subscription (Team and personal Pro
both tested), not an API key.
Note: Platform is set to "Anthropic API" (direct connection to
Anthropic, not Bedrock/Vertex), but authentication is via Claude.ai
subscription, not an API key.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗