Skip to content

OAuth session expires every ~8 hours, requires daily /login #72017

Description

@zhurakov

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:authbugSomething isn't workingduplicateThis issue or pull request already existsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions