Authentication method unexpectedly switched from Claude Max to Claude API mid-session
Description
During an active Claude Code terminal session, the authentication method unexpectedly switched from "Claude Max subscription" to "Claude API", and the model downgraded from Opus 4.6 to Sonnet 4.5. Running /login again restored the correct authentication method and model.
Steps to Reproduce
- Started a new terminal session with
claude - Ran
/status→ showed "Claude Max subscription" with "Opus 4.6" - Used Claude Code normally for an extended period
- Ran
/statusagain later in the same session → now showed "Claude API" with "Sonnet 4.5" - Ran
/loginto re-authenticate - Ran
/status→ back to "Claude Max subscription" with "Opus 4.6"
Expected Behavior
Authentication method should remain consistent throughout the session. Model fallback from Opus to Sonnet due to rate limits is expected, but the authentication method switching from Claude Max to Claude API is not.
Environment
- Claude Code Version: 2.1.42
- Platform: macOS (Darwin 25.1.0)
- Shell: zsh
- Interface: Terminal CLI (not VS Code extension)
Additional Context
In an earlier VS Code session, I also encountered an OAuth token expiration (401 error), which may be related:
"error": "authentication_failed",
"message": "OAuth token has expired. Please obtain a new token or refresh your existing token."
It's possible that the token expiration triggered a credential refresh that incorrectly switched to the Claude API authentication method instead of refreshing the Claude Max credentials.
Impact
- Unexpected model downgrade (though the model fallback itself is documented behavior)
- User confusion about which account/subscription is being used
- Potentially incorrect billing if different auth methods have different rate limits
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗