OAuth token not persisted — Max subscribers forced to /login every session for months
Summary
OAuth tokens are not being persisted to disk between sessions, forcing Max subscribers to run /login at the start of every single session. This has been a known, recurring issue for months with no resolution. Paying customers are losing time daily to a broken authentication flow.
What happens
- Start Claude Code → 401 "Invalid authentication credentials"
- Run
/login→ "Login successful" - Session works fine
- Close session, open new one → back to step 1
The credentials file (~/.claude/.credentials.json) does not exist between sessions. The token appears to be held in memory only and never written to disk, or is written and then invalidated server-side before the next session.
What I've tried
rm ~/.claude/.credentials.json && claude login— fixes it temporarily, same issue next sessionrm -rf ~/.claude/.credentials.json ~/.config/claude-code/auth.json— neither file exists anymore, problem persists- This has been happening repeatedly over multiple weeks
Environment
- macOS (Darwin 24.6.0)
- Claude Code CLI (latest)
- Claude Max subscription (active, correctly shown on welcome screen)
Impact
This is not a one-time inconvenience. Every session starts with a broken auth error, context about what the user was working on is lost, and time is wasted. For a paid product, this is unacceptable — especially when the only suggested workaround (API keys) routes around the subscription the user is already paying for.
Related issues
This is a recurring, unresolved pattern across many reports:
- #40473 — 401 after successful /login, token not persisting (12+ hours, 10+ attempts)
- #44930 — claude login fails with 401, no browser flow, no recovery path after 34+ hours
- #33811 — OAuth token expired, login/logout/all commands fail, no recovery path
- #33879 — API Error 401, OAuth token issue
- #17966 — Re-authentication causes 401, subscription not recognized
- #44264 — Claude OAuth is down
- #44092 — Authentication issue
- #15007 — /login does not recover active session after token expiration
None of these have been resolved. This is not an edge case — it is a systemic failure in the OAuth token lifecycle that is actively degrading the experience for paying subscribers.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗