[BUG] Claude Code unexpectedly clears OAuth tokens and requires full re-authentication before refreshTokenExpiresAt
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?
Claude Code unexpectedly logged me out and required a full OAuth login again even though the stored refreshTokenExpiresAt had not yet passed.
I authenticated using Claude Account with Subscription (OAuth) in Warp on Windows.
Timeline:
- Initial OAuth login:
- July 22, 2026
- Approximately 11:30 AM (local time)
- Claude Code worked normally for approximately 12 days.
- On August 3, 2026 at around 9:00 AM, I started my PC and found that Claude Code had completely logged out.
Running /login immediately generated a brand-new OAuth authorization URL and required the full OAuth flow again.
After the logout, my credentials.json contained:
{
"accessToken": "",
"refreshToken": "",
"expiresAt": 0,
"refreshTokenExpiresAt": 1787269979281
}
The interesting part is that refreshTokenExpiresAt still pointed to approximately 2026-08-21, yet both the access token and refresh token had already been cleared.
I expected Claude Code to continue refreshing the access token until the refresh token actually expired.
What Should Happen?
Claude Code should continue using the stored refresh token until it actually expires.
If the refresh token has been revoked server-side, Claude Code should explicitly indicate that instead of silently clearing the stored credentials and requiring a complete OAuth login.
Additionally, if the refresh token is intentionally revoked before refreshTokenExpiresAt, it would be helpful to clarify whether that timestamp is only informational or not guaranteed to represent the token's actual lifetime.
Error Messages/Logs
No error message was displayed.
Claude Code simply required `/login` again and generated a new OAuth authorization URL.
Steps to Reproduce
- Login using "Claude Account with Subscription" OAuth.
- Complete the OAuth verification process.
- Use Claude Code normally.
- Leave the machine unused for several days.
- Start Claude Code again.
- Observe that Claude Code requires a complete OAuth login again.
- Inspect
credentials.jsonand observe that:
- accessToken is empty
- refreshToken is empty
- expiresAt is 0
- refreshTokenExpiresAt is still in the future
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.220
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Warp
Additional Information
I searched existing issues before opening this report.
Potentially related issues include:
- #81512
- #81306
- #78239
- #77596
- #59937
- #59460
- #19160
However, I could not find a report discussing the combination of:
- OAuth login ("Claude Account with Subscription")
refreshTokenExpiresAtstill being in the future- Both tokens being cleared
- A complete OAuth login being required before the reported refresh token expiration time
Could you clarify whether this is expected behavior, token revocation, or a bug?
3 Comments
This is quite disappointing. Unexpectedly losing OAuth tokens before
refreshTokenExpiresAtdefeats the purpose of long-lived authentication and interrupts workflow. I hope this gets investigated and fixed soon, or at least documented if it's expected behavior.We're experiencing the exact same issue across our team.
Environment:
Our sessions are being logged out unexpectedly every few days, and every team member has to go through the login flow again. There doesn't seem to be any clear trigger—it happens during normal usage across different machines and operating systems.
This has become quite disruptive for our daily workflow, especially since multiple developers are affected at the same time.
Happy to provide additional logs or diagnostic information if that would help identify the root cause.
I’m experiencing the same issue.
I logged in successfully on July 21, and everything worked normally until August 3, when my session was unexpectedly disconnected. I didn't intentionally sign out or change anything on my account or device before the disconnect happened.
Is anyone else seeing the same behavior, or is there any workaround while this is being investigated?
Timeline: