[BUG] Claude code for VS Code OAuth token expiry not handled gracefully
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?
Subject: Claude Code stuck on authentication — OAuth token expiry not handled gracefully
Hi Anthropic Support,
I wanted to report an issue I experienced with Claude Code today (March 11, 2026).
Issue: Claude Code became stuck and was unable to authenticate. It did prompt me to re-authenticate but did not provide a clear recovery path within the app and never accepted the web-based auth.
Error received:
API Error: 401
{"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CYwhCxavYrSe3gQJ8ZcWR"}
Resolution: Running 'claude auth login' from the command line resolved the issue.
Suggested improvement: Claude Code for VS Code could detect an expired OAuth token and either automatically refresh it or better process when the user re-authenticates, rather than getting stuck / timing out silently. The auth web page could provide a token to enter directly instead of just reporting "all set".
Note: This occurred during the broader Claude.ai/Claude Code elevated errors incident reported on the status page today, and is likely an edge case during an outage.
Thanks for looking into this!
What Should Happen?
Claude should continue after web-based auth says success. (Or should indicate a connectivity problem and let the user know to try later when connectivity is restored and not ask for OAUTH in the first place.)
Error Messages/Logs
Error received:
API Error: 401
{"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CYwhCxavYrSe3gQJ8ZcWR"}
Steps to Reproduce
Simulate connectivity issue with OAUTH server during outage.
Run through web-based auth prompt
Notice that Claude Code for VS code cannot re-auth and continues to throw the same error.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Other
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 ↗