OAuth session expires every ~8 hours, requires daily /login
Resolved 💬 2 comments Opened Jun 28, 2026 by zhurakov Closed Jun 28, 2026
Description
When using Claude Code with a claude.ai subscription (OAuth login), the session token expires approximately every 8 hours. Claude Code does not automatically refresh the token using the stored refreshToken, so users are forced to manually run /login every day.
Steps to reproduce
- Run
/loginand authenticate via claude.ai - Wait ~8 hours (or until next day)
- Claude Code session is expired — must run
/loginagain
Expected behavior
Claude Code should silently refresh the access token using the refreshToken stored in ~/.claude/.credentials.json before it expires, without requiring user interaction.
Actual behavior
The refreshToken field is present in .credentials.json (under claudeAiOauth) but is never used. The expiresAt timestamp is ~8 hours from login time. After expiry, the session is lost and the user must manually re-authenticate.
Environment
- OS: macOS 26.5.1
- Auth method: claude.ai OAuth subscription (no API key)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗