[BUG] /login loop or Claude Code, cannot fix on my own
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?
/login loop — magic-link flow never completes, no error surfaced, persists for weeks (possible match to backend identity-mapping failure pattern)
What's Wrong?
/login never completes. The flow cycles indefinitely back to the "enter your email" screen with no error thrown, either in the browser or the terminal.
Steps to reproduce:
- Run
claudein Terminal.app on macOS - Run
/login - Select option 1 ("Sign in with your Claude subscription") — options 2 (Anthropic Console/API) and 3 (third-party platform) are not applicable to my use case
- Browser opens, I enter my email
- I receive the magic-link email and click the link (tested both on the same Mac and on mobile — no difference in outcome)
- Browser either returns to the same "enter your email" screen, or shows a code that does not validate when entered in the terminal ("code is not valid" error)
- Terminal never completes authentication; no error is thrown — it simply behaves as if
/loginwas never run
This has persisted across multiple weeks and many repeated attempts.
What I've Already Tried (all unsuccessful, symptom identical each time)
- Removed
ANTHROPIC_API_KEYentirely from~/.zshrc, confirmed unset in a fresh terminal session - Updated Claude Code to the latest version via
npm install -g @anthropic-ai/claude-code@latest - Cleared cached credentials:
````
security delete-generic-password -s "claude-code"
rm -f ~/.claude/.credentials.json
- Manually unlocked Keychain:
security unlock-keychain ~/Library/Keychains/login.keychain-db - Tried the login flow in an incognito/private browser window
- Tried completing every step (email open, magic link click, code entry) on the same device (MacBook Air M4) rather than splitting across phone and Mac
- Confirmed no system-wide
ANTHROPIC_API_KEYin/etc/zshrc,/etc/environment,~/.zprofile,~/.zshenv,~/.bash_profile
None of the above changed the outcome. The loop is identical before and after each fix attempt.
Environment
- Device: MacBook Air M4
- macOS version: <!-- fill in: Apple menu → About This Mac -->
- Claude Code version: <!-- fill in:
claude --version--> - Terminal: Terminal.app (macOS)
- Auth method attempted: Claude.ai subscription login (option 1 at
/login) - Subscription tier: <!-- fill in: Pro / Max / Team etc. -->
- Account status on other surfaces: <!-- fill in: e.g. "Works fine on claude.ai web / mobile app" — this is useful to confirm it's not account suspension -->
Why I suspect this may be related to a known backend issue
This symptom pattern (magic-link/email login not completing, no surfaced error, subscription confirmed active elsewhere) closely matches several previously reported issues describing a backend identity-mapping failure affecting magic-link authentication:
- #36797 — Authentication redirect loops to onboarding for existing account with active subscription
- #39788 — OAuth login redirects to account creation instead of authenticating existing Max subscription
- #51002 — Desktop app connector flow creates duplicate account under same email, locks paid Max subscriber
- #60022 — Magic-link email login redirects to onboarding for existing Max subscriber (fifth public report of same pattern)
- #68861 — Magic-link login returns "can't verify email" error on desktop app and web
#60022 specifically notes that Claude Code OAuth login uses the same backend identity-mapping logic as the claude.ai/Desktop magic-link flow, which would explain why this CLI-specific case shows the same behavior.
Support channel history
<!-- Fill in if applicable, e.g.: -->
- Submitted via support.claude.com on [date] — Conversation ID: [if provided]
- <!-- Note here if Fin (AI support agent) recommended self-service steps that didn't apply, or did/didn't escalate to a human -->
Impact
This has made Claude Code unusable via subscription login for several weeks. The only workaround is switching to ANTHROPIC_API_KEY, which bypasses subscription billing entirely and incurs pay-as-you-go API charges — not a sustainable substitute for subscription access.
What Should Happen?
/login (option 1) should complete authentication using an active Claude subscription within a single attempt, without requiring device-matched email access, and any failure should surface a clear error rather than silently looping.
Error Messages/Logs
Steps to Reproduce
Steps that are taken to authenticate account from Claude Code to be able to log in.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.197
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗