What
Claude Code renews your sign-in token (the key that keeps you signed in) from time to time and stores it in the Keychain, the macOS password store. If the renewed token can't be saved, it now shows:
"Failed to refresh OAuth token: can't save to the Keychain. If locked, run security unlock-keychain. If sandboxed, use claude setup-token. Otherwise, retry, then claude auth login"
The message offers a fix for each case:
security unlock-keychainif the Keychain is lockedclaude setup-tokenif Claude Code is running in a sandbox (a restricted environment)- retrying, then
claude auth loginotherwise
Why
A failed sign-in renewal now tells you what went wrong and the command to try next.
claude auth login
Error reference modified, high confidence
| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/en/cli-reference#cli-commands) |see the edit
claude auth login
CLI reference modified, medium confidence
| `claude auth login` | Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subsc…see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
claude auth login on Error reference