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

  1. Run /login and authenticate via claude.ai
  2. Wait ~8 hours (or until next day)
  3. Claude Code session is expired — must run /login again

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)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗