[BUG] API Error: 401 — authentication_error: OAuth token
Resolved 💬 3 comments Opened Mar 13, 2026 by rubenrohde-cell Closed Mar 16, 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?
claude login returns a 401 authentication error. The OAuth token is expired and cannot be refreshed through any local method. The CLI is completely unusable.
What Should Happen?
claude login should open a browser auth flow and issue a fresh OAuth token, restoring access.
Error Messages/Logs
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."}}
Steps to Reproduce
Open Claude Code
Run any command — immediately returns 401
Run claude login — same 401, no browser flow opens
Run claude auth logout then claude login — same result
Delete ~/.claude/credentials.json — same result
Full uninstall (rm -rf ~/.claude, remove binary) and reinstall — same result
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code v2.1.73
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗