[BUG] OAuth token expired — `claude login` fails with 401, no browser flow initiated, no recovery path after 34+ hours
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?
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
OAuth token expired and every recovery method fails. claude login returns 401 immediately without opening a browser. This has persisted for over 34 hours.
Error messages:
Error 1 (initial):
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_011CZoxfN7gfaRaHPMWyHxLq"}
Error 2 (after troubleshooting):
API Error: 401
{"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CZqG3x3i7dqsprB5xnir7"}
Symptoms:
- Every command in Claude Code returns 401
claude loginfails with 401 without opening a browser — no OAuth flow is initiated- Issue has persisted for 34+ hours
Troubleshooting attempted (all unsuccessful):
security delete-generic-password -s "claude-code"(macOS Keychain cleanup)- Deleted
~/.claude/.credentials.json rm -rf ~/.claudenpm update -g @anthropic-ai/claude-code(updated to latest version)- Logged out and back into claude.ai in the browser, then retried
claude login - Repeated all steps multiple times
- Restarted the computer
- Removed VPN configuration
Additional context:
- ~12 hours before my first troubleshooting attempt, other users on social media reported the same issue. They appear to have recovered, but my issue persists.
- Platform: macOS
- Support ticket has been submitted via email but no response after 10+ hours.
- Related issues: #33811, #19078
Expected Behavior
claude login should open a browser OAuth flow and issue a fresh token, even when the existing token is expired/invalid.
Request ID
req_011CZoxfN7gfaRaHPMWyHxLq
What Should Happen?
claude login should open a browser OAuth flow and issue a fresh token, even when the existing token is expired/invalid.
Error Messages/Logs
### Error messages:
Error 1 (initial):
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_011CZoxfN7gfaRaHPMWyHxLq"}
Error 2 (after troubleshooting):
API Error: 401
{"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CZqG3x3i7dqsprB5xnir7"}
Steps to Reproduce
- Use Claude Code normally until OAuth token expires
- Run
claude login claude loginimmediately returns 401 without opening browser- Run
rm -rf ~/.claudeand retryclaude login— same 401 error
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.94
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- Support ticket submitted via email to support@anthropic.com but no response after 10+ hours.
Related issues: #33811, #19078
- Also tested with Opus 4.6 — same 401 error on both models.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗