What is the exact message?
On Claude Code v2.1.318 or later, an interactive session shows:
Login reached its time limit · Please run /loginIn a non-interactive run (-p) or an Agent SDK application, the same failure reads:
Failed to authenticate: this login reached its time limitBefore v2.1.318, both forms say Login expired or OAuth session expired and could not be refreshed instead, without naming the time limit.
Anthropic's error reference groups both forms under its Login expired entry: they are the ordinary login-expired message with the reason spelled out.
What does it mean?
Claude Code tried to renew your saved claude.ai login, the OAuth service rejected the stored refresh token, and Claude Code cleared the saved credentials. With no other saved credential, model requests then stop with this message instead of being sent.
The time-limit wording replaces the ordinary Login expired wording and names the reason: the login had a time limit, and it was reached. Anthropic's recovery is the same either way, which is to sign in again.
In a non-interactive run or an Agent SDK application, the structured error code for this failure is authentication_failed, which is what a script or a CI job should look for.
Why it appeared
- The login outlived its time limit. This is the cause the message names: the saved login had a time limit, and the renewal came after it.
- The account itself is the problem, not the clock. If the renewal failed because the account is suspended, Claude Code shows your account is on hold instead of this message.
How do I fix it?
- Run
/loginand sign in again. That is Anthropic's first step, and it replaces the cleared credential. - In a non-interactive run, complete the sign-in in the same environment. Run
claudewith no arguments there, finish/login, then rerun your original command. - For automation that cannot sign in interactively, use a credential that does not expire this way. Set
ANTHROPIC_API_KEY, or runclaude setup-tokenon a machine where the browser sign-in works and set the token it prints asCLAUDE_CODE_OAUTH_TOKENwhere the job runs. - Check which credential is active with
/status. If it still shows the old login after signing in, the sign-in did not take, and the next request repeats the message.
How do I know it is fixed?
- The next model request in the session succeeds instead of stopping locally with the message.
/statusshows the account you just signed in with.- A
-prun exits with an answer rather than theauthentication_failederror.
Where these answers come from
- Both message forms, the rejected refresh token, the cleared credentials, the
authentication_failedcode, and the recovery steps includingclaude setup-token: Anthropic's error reference, read November 18, 2026. - What
claude setup-tokendoes and howCLAUDE_CODE_OAUTH_TOKENis set: Anthropic's authentication page, read November 18, 2026.
Common questions
Can I extend a login that reached its time limit?
No. Anthropic's recovery is to sign in again with /login.
What does it print in a non-interactive run?
Failed to authenticate: this login reached its time limit. The structured error code in that mode is authentication_failed.
How does a CI job sign in with no browser?
Two documented ways: set ANTHROPIC_API_KEY, or generate a long-lived token with claude setup-token on a machine where sign-in works and set it as CLAUDE_CODE_OAUTH_TOKEN where the job runs.
Is this the same as Login expired?
It is the same failure with different wording: Claude Code tried to renew the saved login, the OAuth service rejected the stored refresh token, and the saved credentials were cleared. The time-limit wording names why the login could not be renewed.