[BUG] Login expired persists after full credential wipe, keychain clear, and reinstall - /login never initiates OAuth flow

Status Fixed / completed
Reported on v2.1.218
Maintainer reply None cached
Activity 1 comment · opened Jul 23, 2026 · closed Jul 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

What's Wrong?

Claude Code returns "Login expired · Please run /login" on every invocation.
Running /login does not initiate any OAuth flow no browser window opens and
no login method selection menu is shown. The error appears immediately after
the workspace trust prompt is confirmed.

The state persists even after all local credentials have been removed, which
suggests the CLI is not falling back to a fresh login flow when no stored
credential exists.

Actual Behavior

The expired-login error is returned unconditionally, with no path to
re-authenticate through the CLI.

Environment

  • OS: macOS TAHOE 26.5.1
  • Claude Code version: 2.1.218
  • Shell: zsh
  • Auth method: claude.ai subscription login (no API key, no cloud provider)
  • Request ID: dont have

What Should Happen?

Expected Behavior

With no stored credentials present, claude should initiate the browser-based
OAuth login flow rather than reporting an expired login.

Error Messages/Logs

Login expired · Please run /login

Steps to Reproduce

Steps to Reproduce

  1. Run claude in any directory
  2. Confirm the workspace trust prompt
  3. Error appears: "Login expired · Please run /login"
  4. Run /login - no OAuth flow starts, same error returns

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.218

Claude Code Version

2.1.218

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Troubleshooting Already Attempted

  • npm update -g @anthropic-ai/claude-code - completed successfully
  • claude logout
  • rm -f ~/.claude/.credentials.json
  • rm -rf ~/.claude/cache
  • security delete-generic-password -s "claude-code"
  • Verified no relevant environment variables are set:

env | grep -i -E "ANTHROPIC|CLAUDE" returns nothing
(no CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, or ANTHROPIC_AUTH_TOKEN)

  • Started from a project directory rather than home directory
  • Fresh terminal session after each change
  • Reinstalled with --allow-scripts after npm blocked the postinstall script

(@anthropic-ai/claude-code@2.1.218) - no change

  • Tested on a separate network (mobile hotspot) - no change

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗