[BUG] OAuth token expired — `claude login` fails with 401, no browser flow initiated, no recovery path after 34+ hours

Resolved 💬 7 comments Opened Apr 8, 2026 by toshiiii Closed May 25, 2026

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 login fails with 401 without opening a browser — no OAuth flow is initiated
  • Issue has persisted for 34+ hours

Troubleshooting attempted (all unsuccessful):

  1. security delete-generic-password -s "claude-code" (macOS Keychain cleanup)
  2. Deleted ~/.claude/.credentials.json
  3. rm -rf ~/.claude
  4. npm update -g @anthropic-ai/claude-code (updated to latest version)
  5. Logged out and back into claude.ai in the browser, then retried claude login
  6. Repeated all steps multiple times
  7. Restarted the computer
  8. 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

  1. Use Claude Code normally until OAuth token expires
  2. Run claude login
  3. claude login immediately returns 401 without opening browser
  4. Run rm -rf ~/.claude and retry claude 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.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗