Agent.Space Blog

Claude Code Login Expired? Check the Account and Credential Source

Diagnose Claude Code login-expired and not-logged-in errors, identify active credentials, re-authenticate correctly, and verify a small request.

If Claude Code says Login expired or Not logged in, identify the credential used by the failing session first. Your browser account, subscription, and terminal authentication can differ. Sign in again through the appropriate source; waiting for a usage reset will not renew an expired credential.

This guide follows the official authentication documentation, error reference, and CLI reference, checked October 14, 2026. It is a diagnostic workflow, not a test of your account or a guarantee of recovery.

Classify the message before changing the account

Message or observationFirst question
Not logged in / Please run loginDoes this session have usable credentials?
Login expiredWhich saved login or profile needs renewal?
Invalid API keyIs the intended credential valid for this endpoint?
An account is suspended or an organization is restrictedWhat does the official notice and review process require?
A usage limit with a reset timeWhich usage meter is exhausted?

A login failure alone does not establish suspension, regional enforcement, or an exhausted budget. Use the usage-limit guide for capacity errors rather than repeatedly signing in.

Record the exact wording, client version, time, and whether the failure is in a terminal, editor, cloud session, or Remote Control. Leave keys, tokens, login codes, and private project content out of public reports.

Check the identity in the process that failed

From the shell you actually use to launch Claude Code, run:

sh
claude --versionclaude auth status --text

Inside an interactive Claude Code session, use:

text
/status

These checks identify authentication and configuration. They do not prove that the next model request will succeed. Supported versions also report the configuration directory in the CLI's JSON status output; inspect it privately when comparing launchers.

A working personal terminal and a failing editor can inherit different environments. Sessions using different configuration directories can have different saved accounts. Compare the difference before changing either one.

Check whether authentication-related settings are present without printing their values. Sources can include an API key, auth token, selected Anthropic profile, credential helper, or organization-managed gateway. The API billing guide explains how an unintended credential can also change who pays.

Do not paste a full environment dump or credential file into a support request. On a managed machine, ask which source is required before overriding it with a personal account.

Renew the credential through its own login path

For a normal interactive login, follow the message's documented sign-in action. Run /login inside Claude Code, or use the shell command:

sh
claude auth login

Choose the intended account and billing route. The documented --console option selects Anthropic Console for API usage billing; it is not an interchangeable shortcut for restoring a Claude subscription.

An Anthropic profile login expired message needs more care. The official error reference distinguishes an explicitly selected profile from an automatically discovered one. Renew it through the tool or administrator that supplied it. A profile created through the supported keyless Console sign-in can be renewed through that flow; another tool's profile should be renewed through that tool.

Do not assume /login always replaces the same profile. The documentation describes cases where another sign-in creates an API key or switches the active route instead. Check /status afterward.

For an API key or company gateway, follow the provider's or administrator's recovery process. Buying another subscription does not renew a gateway credential, and a new personal key does not restore managed organization access.

If login succeeds but the same session still fails

Check one layer at a time:

  1. Reopen the same client under the intended account and configuration directory.
  2. Look for an inherited key, token, profile, or helper selecting another credential source.
  3. Compare with another client you already use under equivalent settings.
  4. Check official service status and retain the actual error. An incident does not establish that every account has the same failure.
  5. Preserve managed-policy messages and ask the administrator rather than removing organization controls.

Claude Code 2.1.299, released October 14, makes rejected or expired claude.ai login clearer when a cloud session is refused. A better message does not renew the login. Use the update guide if an appropriate update is part of diagnosis.

Avoid deleting configuration or credential directories as a general repair. That can discard history and unrelated settings without identifying the original failure.

Confirm recovery with one small request

Before retrying a large job, save project files and record what already changed. A failed conversation does not prove that no tool action happened.

Once the credential source and possible usage charge are clear, send a minimal request requiring no private files or changes: “Reply with OK.” Then try a read-only explanation of one permitted file.

Confirm a completed answer under the intended setup. A successful login page or status check alone is insufficient. If another model or account made it work, record the distinction; it does not demonstrate recovery of the original route.

If requests still fail, give support the redacted error, timestamp, version, credential-source name, and smallest repeatable steps. Share sensitive account details only through the provider's approved channel.

Keep the project separate from the access problem

Restoring official access and choosing where a project runs are different tasks. Agent.Space does not reverse an Anthropic suspension or grant native Claude subscription rights.

If you want a shared place for files and a compatible Agent, review Claude Code on Agent.Space first. Confirm the available model and costs before creating a workspace for one small task. This is a workflow choice, not proof that the original login was repaired.