[BUG] OAuth session expires mid-session with 401, /login doesn't reliably refresh
Resolved 💬 3 comments Opened May 4, 2026 by LeandroBenitez1998 Closed May 7, 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?
Description
Claude Code v2.1.126 + Claude Pro — OAuth session expires during active sessions and returns 401 for ALL commands, including /login itself and the /bug feedback mechanism.
What Should Happen?
Running claude code in my console
Error Messages/Logs
Please run /login · API Error: 401
{"error":{"type":"authentication_error","message":"Invalid authentication credentials"}}
4. Running `/login` again sometimes succeeds temporarily but token expires again shortly after
Steps to Reproduce
Steps to Reproduce
- Authenticate via
/login(Pro subscription, OAuth flow) - Use Claude Code normally for 10-20+ minutes
- Eventually all commands return:
Please run /login · API Error: 401
{"error":{"type":"authentication_error","message":"Invalid authentication credentials"}}
- Running
/loginagain sometimes succeeds temporarily but token expires again shortly after /bugfeedback command also returns 401, making it impossible to report from within CLI
Expected
- Session stays alive during active use, or
/loginreliably refreshes token - Feedback mechanism works even with expired auth
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
macOS · Claude Code v2.1.126 · Sonnet 4.6 · Claude Pro subscription
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 ↗