[BUG] Unable to Login
Open 💬 34 comments Opened Mar 11, 2026 by adam-badar
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?
<img width="1173" height="566" alt="Image" src="https://github.com/user-attachments/assets/0f5cae09-36b4-4959-a6d4-04b43c866be5" />
The browser says authenticated, but claude code gives a OAuth error. I'm on the Max plan. I am unable to use claude code at all. There seems to be a lot of lag even in the authentication process itself
<img width="1285" height="296" alt="Image" src="https://github.com/user-attachments/assets/6a6e2206-5fec-49b9-a829-adc127660427" />
What Should Happen?
It should log me in.
Error Messages/Logs
Steps to Reproduce
- /login in claude code
- click authorize in browser
- claude code throws OAuth error
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
34 Comments
Same problem
Same here
+1
+1
same problem. I was. looking at DNS:
DNS Verification
accounts.anthropic.com returns NXDOMAIN from both local DNS and Google's public resolver:
$ dig accounts.anthropic.com
; <<>> DiG 9.10.6 <<>> accounts.anthropic.com
;; QUESTION SECTION:
;accounts.anthropic.com. IN A
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47159
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; AUTHORITY SECTION:
anthropic.com. 1800 IN SOA isla.ns.cloudflare.com. dns.cloudflare.com. 2398319840 10000 2400 604800 1800
;; SERVER: 192.168.1.1#53
$ nslookup accounts.anthropic.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
** server can't find accounts.anthropic.com: NXDOMAIN
Note: claude.ai and api.anthropic.com both resolve and connect normally. Only accounts.anthropic.com is missing.
Same problem, tried several times, got a code to paste every 5th time but Claude Code always ran into timeout.
same
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
+1
+1
+1
great shit antrhopic +1 thanks for wasting tokens.
+1
+1
https://status.claude.com/
lets solve ai incident quickly using ai
+1
Root Cause (Likely)
Claude Code CLI authentication uses an OAuth flow through the browser. The browser successfully authenticates the account, but the CLI fails when receiving or validating the OAuth callback token.
This mismatch usually occurs when:
Since the browser shows authenticated but the CLI throws an OAuth error, the failure likely happens after authorization, during token exchange or callback handling.
---
Proposed Fix
Improve OAuth callback handling in the CLI by:
---
Example Fix (TypeScript)
Improve OAuth Callback Listener
Ensure the local server waits long enough for the redirect.
+1
+1
+1
Same problem here
+1
+1
+1
Same issue on EndeavourOS (Arch-based), Lima, Peru. Claude Code 2.1.72, installed via npm + nvm.
Environment:
/loginin CLI fails withOAuth error: timeout of 15000ms exceeded❌Workaround confirmed working for Linux/nvm users:
After patching,
/logincompletes successfully. This confirms the issue is not specific to Windows — it affects Linux users in Latin America as well, likely due to regional latency on the OAuth callback endpoint.+1
The patch fix did not work for me on Ubuntu. As soon as the browser finally responds saying "Build something great..." the CLI reports OAuth error timeout exceeded even at 45000ms.
I was successful with:
I don't know if it was a coincidence, but I'm logged in now
2.1.66 also worked for me, thanks @tpzub
I did this (without -g) in conjunction to https://github.com/anthropics/claude-code/issues/33247#issuecomment-4040530566 (timeout adjust).. which worked well enough to get my login back and from there, I resumed on the latest version of claude code..
Setup claude token
claude setup-tokenin your zshrc to avoid this oauth nonsense in the futureThis sounds silly and it might not apply to everyone, but I had a stale auth token set in my start up config in my terminal. Since I use VSCode with my
fishterminal, it was also loading this invalid Auth token.VSCode requires a restart to reload environment variables so...
export CLAUDE_CODE_AUTH_TOKEN="...",set -x CLAUDE_CODE_AUTH_TOKEN "..."and the like from any of your terminal startup scripts.claude setup-token, etcHad the same issue this morning. Mix of 500 and timeout errors. Must have tried more tha a dozen times.
What worked for me:
I got a timeout error on the first attempt, but second time finally succeeded.