| Issue | Quick Fix | Time |
|---|---|---|
| Browser stuck on login / redirect loop on claude.ai | Clear cookies for claude.ai or try an incognito window | 2 min |
| Magic link email never arrives | Check spam/quarantine, whitelist @mail.anthropic.com, request a new link | 3-5 min |
| Claude Code: “Login expired” or 401 on every command | Run /logout then /login to get a fresh OAuth token | 1 min |
| Claude Code: ANTHROPIC_API_KEY overriding your subscription | unset ANTHROPIC_API_KEY and remove it from your shell profile | 2 min |
| SSO login failing for a Team/Enterprise account | Confirm with your admin the SSO config hasn’t changed, then retry | 5-10 min |
| Everything down at once | Check status.claude.com before troubleshooting anything locally | 1 min |
There’s a special kind of annoyance in staring at a login screen that just won’t let you in, especially when you were mid-task in Claude a few minutes ago and now you’re locked out with no clear error to Google. Sometimes it’s a one-click fix. Sometimes it’s Anthropic’s infrastructure having a bad afternoon, and no amount of clearing cookies will help until they sort it out on their end.
This guide walks through the real, current causes of Claude login failures on both claude.ai in the browser and Claude Code in the terminal, and gives you fixes you can actually verify rather than generic “restart your computer” advice. We’ll cover magic link and Google sign-in issues on the web app, OAuth token expiry and environment variable conflicts in Claude Code, SSO problems for Team and Enterprise accounts, and what to do when it turns out the problem isn’t you at all.
What Causes Claude Login Failures
Expired or corrupted session tokens. Claude.ai and Claude Code both rely on tokens that expire after a set period. On the web this usually just means a re-login prompt. In Claude Code, an expired OAuth credential can throw a confusing error mid-session rather than a clean “please log in” message, especially in long-running or background sessions that outlive the token.
A leftover ANTHROPIC_API_KEY in your environment. This is one of the more common Claude Code support tickets and it has nothing to do with your account being broken. If an API key is set in your shell profile — often left over from a previous project or a former employer’s org — Claude Code will use it instead of your subscription credentials. If that key belongs to a disabled or expired organization, you’ll get an authentication error that looks like a login problem but is actually a precedence issue.
Email deliverability problems with the magic link. Claude.ai doesn’t support a traditional password — email login works through a one-time link sent from an @mail.anthropic.com address. Corporate, school, and government email systems frequently quarantine or delay these, which looks identical to “login is broken” from the user’s side.
SSO or admin-side configuration changes. If you’re on a Claude for Teams or Enterprise plan, sign-in runs through your organization’s identity provider. Anthropic’s status page has logged more than one SSO-specific incident, and locally, admin changes to SSO settings, org restrictions, or role assignments can lock out individual users without anyone realizing until they try to log in.
Anthropic-side outages. Claude.ai login has had genuine, if brief, outages — including two separate authentication incidents on August 24, 2026, both resolved within about ten minutes each. These aren’t rare enough to rule out first.
Quick Fix — Try This First
Before anything else, check status.claude.com. It takes ten seconds and saves you from troubleshooting a problem that’s already being fixed on Anthropic’s end. If it shows all systems operational, the fastest genuinely effective fix for most login failures — on both web and CLI — is a full, clean sign-out and sign-back-in rather than just refreshing the page or retrying the same broken session.
On the web: open a private/incognito window, go to claude.ai, and try logging in there. If that works, the problem is a stale cookie or cached session in your regular browser profile, and clearing cookies for claude.ai fixes it permanently.
In Claude Code: run /logout, close the terminal session entirely, then restart with claude and go through login again. This resolves the majority of “login failed but I don’t know why” cases because it discards whatever corrupted or expired credential was causing the loop.
Fixes for Claude.ai (Web)
Step 1: Rule out a browser-side problem
Try an incognito or private window first. If login works there, go back to your normal browser and clear cookies specifically for claude.ai (you don’t need to wipe your whole browser history). Also disable ad blockers or privacy extensions temporarily — some aggressively block the auth redirect Claude uses to complete Google or magic-link sign-in.
Step 2: Fix a missing magic link email
If you chose “Continue with email” and the link never shows up, check your spam and junk folders first, then any server-side quarantine your email provider runs (common on business, government, and .edu accounts, where IT sometimes blocks unrecognized senders outright). Whitelist mail from @mail.anthropic.com and request a new link — don’t click an old one, since these expire quickly. If you’re on a managed work or school email account and still get nothing after a few minutes, that’s usually an IT-side block rather than anything wrong with your Claude account.
Step 3: Handle cross-device login
If you request the login link on one device and open it on another, claude.ai won’t auto-redirect you — you’ll instead get a verification code to enter back on the original device. If you’re stuck on a “check your email” screen for a while, make sure you’re not opening the email on your phone when you started the login on your laptop; go back to the original device and enter the code there.
Step 4: Try Google sign-in as an alternative
If email login keeps failing and you have a Google account tied to your Claude account (or can link one), “Continue with Google” uses a different auth path entirely and can succeed even when the magic-link flow is having problems.
Step 5: Sign out of all sessions and start fresh
If you’re getting logged out repeatedly or something feels stuck, sign in from a working session, click your initials in the lower-left corner, go to Settings, then Account, and choose Log Out. This signs you out of every active session — web, mobile, and desktop app — across all devices at once. Note this option currently only exists in the web app, not the mobile apps. Log back in afterward with a clean slate.
Fixes for Claude Code (CLI)
Step 1: Do a clean re-login
This resolves most Claude Code login failures where the cause isn’t obvious:
/logout
Then close the terminal completely and restart:
claude
This walks you back through the browser-based OAuth flow. If Claude Code doesn’t open a browser automatically, press c at the prompt to copy the login URL, then paste it into a browser manually.
Step 2: Check for a stale API key overriding your login
If you have an active subscription but keep getting an error saying your organization has been disabled, the real culprit is often an old ANTHROPIC_API_KEY sitting in your shell environment — commonly left behind from a previous project or employer. Claude Code prioritizes that key over your subscription credentials whenever it’s present and approved. Unset it:
unset ANTHROPIC_API_KEY
claude
Then check ~/.zshrc, ~/.bashrc, or ~/.profile for a lingering export ANTHROPIC_API_KEY=... line and remove it so it doesn’t come back next session. On Windows, check your PowerShell profile and User environment variables. Run /status inside Claude Code afterward to confirm which authentication method is actually active — it shows a Login method row for your subscription and a separate API key row only when a key is in use.
Step 3: Fix an expired or looping OAuth token
If Claude Code keeps prompting you to log in again mid-session, your OAuth token has likely expired. Run /login to re-authenticate. If this keeps happening frequently and not just occasionally, check that your system clock is set correctly — token validation depends on accurate timestamps, and a clock that’s drifted can cause tokens to appear expired prematurely. You can also check /status before a request even fails; it shows a Login row reading “Expired, log in again” once your credential is past its window.
Step 4: Handle “OAuth error: Invalid code”
This means the login code either expired or got truncated during copy-paste. Press Enter to retry, or type c to copy the full login URL if the browser didn’t open on its own.
Step 5: Fix login in WSL2, SSH, or containers
If you’re running Claude Code over SSH, inside WSL2, or in a container, the browser that opens usually can’t redirect back to Claude Code’s local callback server. Instead of a silent failure, you should see a login code printed in the terminal — paste it at the “Paste code here if prompted” prompt to finish. If nothing pastes in, try your terminal’s alternate paste shortcut (often Shift+Insert), or use:
claude auth login
which reads the pasted code from standard input instead of relying on the interactive prompt. On WSL2 specifically, if no browser opens at all, point Claude Code at your Windows browser:
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
claude
Step 6: Check for corporate proxy or firewall interference
A 403 Forbidden error right after logging in, or TLS errors like “unable to get local issuer certificate,” usually points to a corporate proxy or firewall intercepting the connection rather than an account problem. If you’re behind a corporate proxy, set the proxy environment variables before running Claude Code:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
If your organization’s proxy does TLS inspection (common with security appliances), you may also need to point Node at your corporate CA certificate:
export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem
Ask your IT team for this certificate file if you don’t already have it, and confirm with them whether the Claude API hosts are allowlisted on the network.
Still Can’t Log In?
If you’ve worked through the steps above and you’re still stuck, a few things are worth checking before assuming your account is the problem:
- Check status.claude.com again. An incident can start after you’ve already begun troubleshooting — it’s worth a second look, especially if the failure started suddenly across multiple devices at once.
- Check your email for account notices. Anthropic will email you if there’s an issue with your account, subscription, or organization membership — worth checking before assuming it’s a technical bug.
- If you’re on a Team or Enterprise plan, contact your workspace admin. Login can fail for an individual user because of an SSO configuration change or a role change on the admin side, and only your admin can see or fix that from the Console.
- Contact Anthropic support directly. If you can get logged in anywhere (even briefly), click your initials in the lower-left corner and select “Get help.” If you’re completely locked out, Anthropic’s support articles are at support.claude.com, and account-specific issues — a login loop, an unrecognized subscription, or a disabled organization — generally need a support ticket rather than a self-service fix.
FAQ
Why does Claude Code keep asking me to log in again every few hours?
This is usually genuine token expiry rather than a bug, though it shouldn’t happen constantly. If it’s happening far more often than seems reasonable, check your system clock for drift, since token validation depends on it, and make sure you don’t have parallel Claude Code sessions on the same machine racing to refresh the same token — that can occasionally revoke a shared login and force every open session to re-authenticate at once.
Does Claude.ai have a password I can reset?
No. Anthropic’s own support documentation is explicit that it isn’t currently possible to set a dedicated password for a Claude account — login runs through email magic links, Google sign-in, or SSO for organizational accounts. If you’re looking for a “reset password” option because login is failing, that’s not the fix; work through the email deliverability or browser steps above instead.
Why does Claude Code say my organization is disabled when my subscription is active?
This almost always traces back to a leftover ANTHROPIC_API_KEY environment variable pointing at a different, inactive organization. Claude Code will use that key instead of your subscription’s login credentials whenever it’s present. Unset the variable and remove it from your shell profile, then restart Claude Code.
I’m on a company Claude for Enterprise plan and SSO won’t let me in. What do I do?
Check status.claude.com first, since SSO has had its own dedicated incidents separate from general login issues. If systems are operational, the issue is more likely on your organization’s side — an admin change to SSO configuration, role assignment, or org login restrictions can lock out individual users. Contact your workspace admin rather than troubleshooting this yourself, since they’re the only one who can see the SSO configuration in the Console.
Is it safe to just keep retrying the login page?
Yes, but it wastes time if the actual cause is a stale token, a browser cache issue, or a leftover API key — all of which won’t resolve themselves no matter how many times you retry. Give it two or three attempts, then move to a clean sign-out and retry, or check the status page, rather than repeating the same failing attempt indefinitely.
Related fix guide: claude error: 7 Fast Fixes That Work (2026)
Related fix guide: claude files upload error: 7 Fast Fixes That Work (2026)





