[BUG] OAuth token expires 5-10 times within a single session, requiring constant /login
Resolved 💬 3 comments Opened Mar 8, 2026 by sonynamcos Closed Mar 11, 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?
OAuth token expires 5-10 times within a single session, requiring constant /login. This is not the "every 8 hours" issue —
it happens every few minutes during active use. No pattern to which tool triggers it.
What Should Happen?
OAuth token should be refreshed automatically before expiration. A single /login at session start should be sufficient for
the entire session. The refresh token should be used transparently without user intervention.
Error Messages/Logs
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication
credentials"},"request_id":"req_..."}
· Please run /login
This error appears 5-10 times per 1-2 hour session, unpredictably.
Environment: Windows 11 Pro, Claude Max 5x plan, Anthropic OAuth auth.
Related: #1757 (42 upvotes), #5893 (48 upvotes), #31095, #12447
Steps to Reproduce
- Start Claude Code session, /login
- Use tools normally (Read, Bash, WebFetch, Agent, etc.)
- After a few tool calls, any tool fails with 401
- Run /login → "Login successful"
- Continue working → fails again within minutes
- Repeat 5-10 times per session
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.71
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗