OAuth token expires mid-session in Claude Desktop with no recovery path
Resolved 💬 3 comments Opened Jan 16, 2026 by bonecondor Closed Jan 19, 2026
Bug Report: OAuth token expires mid-session in Claude Desktop
Summary
OAuth token expires during active Claude Code sessions within Claude Desktop, causing API errors with no recovery path.
Environment
- Claude Desktop version: 2.0.72
- macOS Darwin 24.6.0
- Using Claude Code within Claude Desktop (not standalone CLI)
Steps to Reproduce
- Start a new Claude Code session in Claude Desktop
- Have an active conversation (sending messages, using tools)
- Within ~10 minutes of active use, receive OAuth error
Expected Behavior
OAuth token should refresh transparently without interrupting the session.
Actual Behavior
Session fails with:
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_011CXA57hmxzRRfj59eBrqDH"} · Please run /login
The error suggests running /login, but this command does not exist in Claude Desktop's Claude Code integration.
Log Evidence
From ~/Library/Logs/Claude/main.log:
2026-01-15 10:58:32 [info] refreshing oauth token now
2026-01-15 10:58:33 [info] oauth token refreshed, now persisting
2026-01-15 11:05:40 [info] performing fresh oauth exchange
2026-01-15 11:35:40 [info] performing fresh oauth exchange
2026-01-15 18:28:45 [info] performing fresh oauth exchange
2026-01-15 18:41:01 [info] performing fresh oauth exchange
The logs show OAuth exchanges happening, but tokens still expire mid-session.
Analysis
Appears to be a race condition where:
- Session makes an API call
- OAuth token expires at that moment
- Refresh hasn't propagated yet
- API returns 401
Impact
- Session becomes unusable
- No way to recover without starting a new conversation
- Work in progress is lost
- Error message references non-existent
/logincommand
Requested Fix
- Implement proactive token refresh before expiration (not reactive)
- Add retry logic when 401 is encountered to attempt token refresh
- Either implement
/loginfor Claude Desktop or remove it from error message - Provide a UI-based way to manually refresh auth if needed
Workaround
Starting a new conversation forces a fresh OAuth exchange and usually works.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗