Getting stuck in a Claude Code OAuth login loop stops your terminal workflow right when you need to ship code. You run the login command approve access in your browser and then watch the CLI bounce straight back to the Sign In Again screen.
Developers across the US, UK and Canada hit this loop when a local callback port fails or browser cookies clash with cached session files. Even after service incidents like the November 13 2026 authentication disruption recover local token mismatches keep trapping terminals in endless redirects. Below is why this loop happens and the first two fixes to run immediately.
Quick Check: A Claude Code OAuth login loop means your browser approved the login but your terminal never received or saved the final callback token.
Why Does Claude Code Keep Asking You to Sign In Again?
Claude Code relies on a local localhost callback server to catch your authorization code from Anthropic. If a firewall browser extension or stale credential file blocks that handoff the CLI discards the session and restarts the login prompt.
| Loop Trigger | What Fails During Login | Direct Fix |
|---|---|---|
| Dropped Localhost Callback | Browser redirect fails to reach the local CLI listener port. | Copy the manual auth code into terminal. |
| Corrupted Token Cache | Expired credentials overwrite new OAuth tokens on disk. | Run logout and wipe stale config files. |
| Multi-Account Browser Clash | Browser signs into a personal email instead of your API org. | Authenticate inside a clean browser profile. |
If your terminal hangs without showing any login screen at all you may be dealing with a different process freeze. Check our separate walkthrough on fixing Claude CLI session authentication stalls when commands stop responding entirely.
How to Fix Claude Code OAuth Login Loop
1. Verify Live Anthropic Service Health First
Before changing local config files confirm that Anthropic login servers are responding normally. Visit the official Claude Status page to check for active authentication incidents. If login services show degraded performance wait until engineers deploy a fix before retrying.
2. Use the Manual Copy-Paste Login URL Flow
Automatic browser redirects frequently fail on Linux WSL and remote SSH setups because the browser cannot reach your terminal callback port. When you see a Claude Code OAuth login loop copy the full authorization link printed in your terminal open it manually in your browser and paste the confirmation code back into the CLI prompt.
3. Clear Stale Local OAuth Credentials
Expired session tokens cached inside your home directory often overwrite fresh logins and trigger a Claude Code OAuth login loop. Clearing your local auth state forces the CLI to generate a clean credential file from scratch.

claude logout
rm -rf ~/.claude/auth.json
claude login
Run those three lines in order and complete the browser prompt once more. If your terminal refuses to save new config files check that your user folder has normal write permissions.
Local storage corruption affects other AI coding editors when cached state files lock up. If you encounter similar editor freezes check our guide on fixing Cursor AI not working errors to clear broken workspace files safely.
4. Authenticate Inside an Incognito Browser Window
If you stay signed into multiple Google or Anthropic accounts your browser may pass the wrong session cookie during the OAuth handshake. That account mismatch causes a Claude Code OAuth login loop right after you click Authorize.
| Browser Factor | Why It Breaks OAuth | Quick Solution |
|---|---|---|
| Multiple Active Logins | Personal email overrides your paid Claude Console org. | Use a clean Incognito window. |
| Strict Privacy Extensions | Ad blockers strip query parameters from the callback URL. | Pause extensions during login. |
Copy the login URL from your terminal paste it into a Private window and sign in using only the exact email tied to your active Claude subscription.
5. Check Local Firewall Ports and VPN Routing
Claude Code spins up a temporary localhost port to listen for the OAuth callback. Corporate VPNs strict firewalls and proxy environment variables like HTTP_PROXY can intercept that local connection and throw a Claude Code OAuth login loop.
Disconnect your VPN temporarily and check your shell environment for active proxy variables before running the login command again. Enterprise authentication flows across CRM and developer platforms share this exact callback behavior. You can see how redirect URLs behave in our guide on Salesforce OAuth flow authentication stalls when local callbacks fail.
6. Update Claude Code CLI to the Latest Release
Running an outdated CLI build often breaks compatibility with updated Anthropic login endpoints and causes a Claude Code OAuth login loop. Updating the package ensures your local client supports the latest OAuth token exchange format.
If updating still fails check open authentication bug threads on the official Anthropic Claude Code GitHub repository to confirm if your specific operating system requires a manual flag. Developers managing multi-agent terminal setups can also check our open source agentic AI frameworks guide for alternative local workflows.
Conclusion
Resolving a Claude Code OAuth login loop comes down to fixing the callback handoff between your browser and terminal. Verify server status use the manual login link or wipe stale auth files to get back to coding fast.
Frequently Asked Questions
Why does Claude Code keep asking me to sign in again?
Your browser approved the login but your local terminal failed to capture the callback token. Firewalls expired auth files or wrong browser accounts usually block that handoff.
How do I fix a Claude Code OAuth login loop over SSH or WSL?
Copy the full authorization URL displayed in your terminal open it in your desktop browser and paste the confirmation code back into the CLI window.
Where does Claude Code store local authentication tokens?
Claude Code saves session data inside the hidden .claude folder in your user home directory. Deleting the stale auth file forces a clean login.
Do I need a paid Anthropic account to avoid OAuth login loops?
You need an active Claude Pro Max or funded Console API account to use Claude Code. Signing in with an unlinked free email triggers repeated login redirects.
