What
Claude Code keeps your sign-in fresh by periodically getting a new access token. On a Mac it stores the token in the macOS Keychain, the system's password store. When the Keychain refuses that write, there is now a dedicated error for it.
- The error is
OAuthRefreshStoreRefusedError. Its message reads: "OAuth access token could not be refreshed: can't save to the macOS Keychain. Unlock it, run claude outside any sandbox, retry, or sign in again". - The SDK schema, the description programs use to read Claude Code's output, lists a new API error kind,
oauth_refresh_store_refused. It means the Keychain did not take the write, so the refresh token was not sent.
Why
If your sign-in stops refreshing on a Mac, the message now says what went wrong and what to try: unlock the Keychain, run claude outside any sandbox (a restricted environment that can block access to the Keychain), retry, or sign in again. Programs built on Claude Code can check for oauth_refresh_store_refused to handle this case on its own.