[BUG]

Resolved 💬 3 comments Opened May 3, 2026 by MasashiHarada666 Closed May 6, 2026

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?

## Summary
OAuth access token is not being automatically refreshed between sessions.
Every time I restart Claude Code, I am prompted to log in via browser,

## Environment

  • Claude Code version: 2.1.126
  • OS: macOS (Darwin 25.3.0)
  • Auth method: OAuth (Claude Pro subscription via claude.ai)

## Steps to Reproduce

  1. Run /login to authenticate
  2. Close Claude Code session
  3. Wait ~8 hours (or until next day)
  4. Restart Claude Code
  5. Prompted to log in again via browser

## Expected Behavior
The refresh token stored in the macOS Keychain (Claude Code-credentials)
should be used automatically to obtain a new access token without requiring
manual re-authentication.

## Actual Behavior
Claude Code asks for manual re-login every time the access token expires
(approximately every 8 hours). The Keychain entry exists and is readable —
this is not a Keychain lock/permission issue (verified: no-timeout setting).

## Additional Notes

  • This used to work correctly in earlier versions — appears to be a regression.
  • The Keychain entry (Claude Code-credentials) contains both accessToken

and refreshToken, but the refresh token does not appear to be used on startup.

  • No ANTHROPIC_API_KEY is set (using OAuth as intended for Pro subscribers).

What Should Happen?

Claude Code should automatically refresh the OAuth access token using the
stored refresh token in the macOS Keychain, without requiring the user to
manually run /login again. The session should persist seamlessly across
restarts as long as the refresh token is valid.

Error Messages/Logs

Steps to Reproduce

  1. Run /login to authenticate with Claude Pro (OAuth)
  2. Use Claude Code normally
  3. Close the terminal or end the session
  4. Wait until the next day (or ~8+ hours)
  5. Start Claude Code again
  6. Browser opens asking to log in again — manual authentication

required every time

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.126

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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