"Not logged in · Please run /login"
Updated
"Not logged in · Please run /login" is an authentication error, not a usage limit: the Error reference says no valid credential is available for this session. It has nothing to do with your five-hour or weekly window, so waiting for a reset will not clear it. Run /login to sign in with your Claude subscription or Console account, or check that ANTHROPIC_API_KEY is exported in the shell where you launched claude. /status shows which credential is active.
- Last reset
- 04 SEP 20:08Z
- Status
- OVERDUE
The gap since the last reset is past 1.5x the recent median.
- Next est.
- ANY TIME
- Days since
- 13.1
days
What does "Not logged in · Please run /login" mean?
The Error reference files this under "Authentication errors": "These errors mean Claude Code cannot prove who you are to the API." For this message specifically, "No valid credential is available for this session." Nothing has been counted against a quota; the request never got that far.
A close relative is "Login expired · Please run /login": Claude Code tried to renew your saved claude.ai or Console login, the OAuth service rejected the stored refresh token, and Claude Code cleared the saved credentials. In non-interactive mode the same state reads "Failed to authenticate: OAuth session expired and could not be refreshed". Either way, only /login creates new credentials.
It is easy to mistake for a limit because it also stops every request. The difference: a usage limit names a window and a reset time ("You've hit your session limit · resets 3:45pm"); this message names none, because there is no window involved. This is not a quota problem, and a reset will not solve it.
Which window is full?
| Window | Resets | Where to check |
|---|---|---|
| None: this is an authentication failure, not a usage window | Never; there is nothing to wait for | /status shows which credential is active |
What to do when you see it
- Run /login
Authenticate with your Claude subscription or Console account. The help center adds that if you were logged in via Console pay-as-you-go, /login switches you to your subscription plan.
- Check the environment variable if you expected one
Confirm ANTHROPIC_API_KEY is set and exported in the shell where you launched claude. Tools that load a .env file can also leave a stale key.
- For CI, use an apiKeyHelper
Where interactive login is not possible, the docs recommend an apiKeyHelper script that fetches a key at startup.
- Read the precedence order
When several credentials are present, Claude Code picks one in a fixed order: cloud provider variables, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, profiles, then the /login subscription. /status shows which one won.
- If you keep getting logged out
The docs point to system clock checks and macOS credential-storage recovery under "Not logged in or token expired" in the install troubleshooting page.
When does it reset?
Your own window: nothing resets here. This error is about credentials, not capacity, so your five-hour and weekly windows are untouched and irrelevant. After /login succeeds, /usage shows where those windows stand.
Account-wide resets: an official reset announced by Anthropic would not sign you in either. The board above records those announcements for people who are signed in and waiting on a quota; this page is not one of those cases.
Related errors
FAQ
Is "Not logged in" a usage limit?
No. The Error reference groups it under authentication errors and says no valid credential is available for this session. A usage limit would name a window and a reset time. This is not a quota problem, and waiting for any reset will not solve it.
What is the difference from "Login expired · Please run /login"?
"Login expired" means Claude Code tried to renew a saved login, the OAuth service rejected the refresh token, and the saved credentials were cleared. "Not logged in" means no credential was available at all. Both are fixed the same way: run /login.
I set ANTHROPIC_API_KEY. Why am I still asked to log in?
The docs say to confirm the key is set and exported in the shell where you launched claude. If a key is present but rejected, you would see "Invalid API key" instead. /status shows which credential source Claude Code actually resolved.
Will /login switch me from API pay-as-you-go to my subscription?
Yes. Anthropic's help center says that if you are already logged in via Claude Console pay-as-you-go, running /login from within Claude Code switches you to your subscription plan.
Sources
- Claude Code docs: Error reference — "Not logged in"verified 2026-09-18
- Claude Code docs: Error reference — "Login expired"verified 2026-09-18
- Claude Code docs: Authentication — Authentication precedenceverified 2026-09-18
- Claude Help Center: Use Claude Code with your Pro or Max plan (/status, /login, shared limits)verified 2026-09-17
Want the next Claude reset on your phone?