[BUG] Can't authenticate on individual account - OAuth error

Resolved 💬 29 comments Opened Mar 11, 2026 by nathan-brainkey Closed May 20, 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?

I started getting this API error:
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CYwY9t9tKpSCeLPocnPwm"}
· Please run /login

When I run /login and open the browser, and click Authorize, I get the you're all set message but the console shows this message:

<img width="298" height="120" alt="Image" src="https://github.com/user-attachments/assets/cce76401-490c-48b2-88c2-216150e467a5" />

What Should Happen?

Claude Code should successfully log in after following the normal authentication workflow.

Error Messages/Logs

PI Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing       
     token."},"request_id":"req_011CYwXr8pSYMayAt1kUj4hq"} · Please run /login
OAuth error: timeout of 15000ms exceeded

Steps to Reproduce

  1. /login
  2. open browser
  3. click authorize

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.72

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

29 Comments

steven-esser · 4 months ago

same

R00118189 · 4 months ago

OAuth error: timeout of 15000ms exceeded

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/33214
  2. https://github.com/anthropics/claude-code/issues/33228
  3. https://github.com/anthropics/claude-code/issues/33226

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

pkral78 · 4 months ago

@claude kick someone shiny metal a** to fix that

chezluc · 4 months ago

Same here.

doctorfarhan · 4 months ago

Workaround for Claude Cli timeout issues on Windows (I am able to login now)

What I did:

Located the global npm install folder: C:\Users\<yourname>\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\

The main file is cli.js (it's minified so it's one giant unreadable line). Find and replace the hardcoded timeout values:

timeout:15000 → timeout:45000

AbortSignal.timeout(15000) → AbortSignal.timeout(45000)

That's it. Just save the file and restart claude cli.

WernerGo · 4 months ago

OAuth error: Request failed with status code 500
same problem: v2.1.72, macOS Tahoe 26.3.1

vpaloh · 4 months ago

Same issue. Can't do anything - not logging in even though paying for the subscription. Tried to do this multiple times, different browsers etc..

pkral78 · 4 months ago
chezluc · 4 months ago
### Workaround for Claude Cli timeout issues on Windows (I am able to login now) What I did: Located the global npm install folder: C:\Users<yourname>\AppData\Roaming\npm\node_modules@anthropic-ai\claude-code\ The main file is cli.js (it's minified so it's one giant unreadable line). Find and replace the hardcoded timeout values: timeout:15000 → timeout:45000 AbortSignal.timeout(15000) → AbortSignal.timeout(45000) That's it. Just save the file and restart claude cli.

Nice @doctorfarhan - I had codex do this on my mac based off what you did and was able to get it working: I fixed this on macOS by patching the Claude Code binary at ~/.local/share/claude/versions/2.1.72, replacing timeout:15000 with timeout:45000 and AbortSignal.timeout(15000) with AbortSignal.timeout(45000), then re-signing it with ad-hoc codesign. After that, login worked.

doctorfarhan · 4 months ago
> ### Workaround for Claude Cli timeout issues on Windows (I am able to login now) > What I did: > Located the global npm install folder: C:\Users\AppData\Roaming\npm\node_modules@anthropic-ai\claude-code\ > The main file is cli.js (it's minified so it's one giant unreadable line). Find and replace the hardcoded timeout values: > timeout:15000 → timeout:45000 AbortSignal.timeout(15000) → AbortSignal.timeout(45000) That's it. Just save the file and restart claude cli. Nice @doctorfarhan - I had codex do this on my mac based off what you did and was able to get it working: I fixed this on macOS by patching the Claude Code binary at ~/.local/share/claude/versions/2.1.72, replacing timeout:15000 with timeout:45000 and AbortSignal.timeout(15000) with AbortSignal.timeout(45000), then re-signing it with ad-hoc codesign. After that, login worked.

Glad it worked on Mac too! Cheers!

patrykiciak-st · 4 months ago

Same problem

pkral78 · 4 months ago
> ### Workaround for Claude Cli timeout issues on Windows (I am able to login now) > What I did: > Located the global npm install folder: C:\Users\AppData\Roaming\npm\node_modules@anthropic-ai\claude-code\ > The main file is cli.js (it's minified so it's one giant unreadable line). Find and replace the hardcoded timeout values: > timeout:15000 → timeout:45000 AbortSignal.timeout(15000) → AbortSignal.timeout(45000) That's it. Just save the file and restart claude cli. Nice @doctorfarhan - I had codex do this on my mac based off what you did and was able to get it working: I fixed this on macOS by patching the Claude Code binary at ~/.local/share/claude/versions/2.1.72, replacing timeout:15000 with timeout:45000 and AbortSignal.timeout(15000) with AbortSignal.timeout(45000), then re-signing it with ad-hoc codesign. After that, login worked.

Well even with that, I got 500

TheSentiTrader · 4 months ago

It started to work for me I did run the older binary thought ~/.local/share/claude/versions/2.1.70

jerin081-zuper · 4 months ago

try /logout and then /login again. it worked for me

varungodbole · 4 months ago

Doing /logout and /login for me didn't help. It takes me to the https://claude.ai/oauth/authorize, which seems to have really high latency after I click "Authorize", and then the Claude Code CLI throws an error that the deadline was exceeded.

Claude Code is unusable for me atm, and it seems that claude.ai is down right now? :(

sighonara · 4 months ago

A bug here is that we, the purchasers of this product, cannot set the OAuth timeout. This should be updated ASAP. This is such an amazing oversight and very disappointingly bad coding.

fvandina · 4 months ago

logout and login for me fix the problem

Sprk3lzZ · 4 months ago

I think it's a global problem. We have all the same error at the same time, it seems a internal server error.

Sprk3lzZ · 4 months ago
logout and login for me fix the problem

It work for me too.

OptionBase · 4 months ago

it's working for me on macOs Tahoe 26.3.1
data = data.replace(b'timeout:15000', b'timeout:45000')

renavides · 4 months ago

I found a workaround for this issue. I used the binary from a previous version (2.1.50), which can be found in ~/.local/share/claude/versions. I logged in using that version, and once the authentication was successful, I was able to switch back and use the latest version (2.1.72) without any problems."

magicsmoke · 4 months ago

@renavides nice workaround. Got it to work with 2.1.63.

bmg02 · 4 months ago

This approach worked for me -

  1. claude setup-token - It will launch an authorization screen on the browser. Authorize it. You will see a token printed on your terminal.
  2. Copy that token and set/export it to the variable mentioned in the terminal.
  3. Re-launch the terminal and type claude
  4. Type /login and authorize in the browser. It should work now.

Earlier, I was getting error 500 and sometimes a timeout error.

sighonara · 4 months ago
This approach worked for me - 1. claude setup-token - It will launch an authorization screen on the browser. Authorize it. You will see a token printed on your terminal. 2. Copy that token and set/export it to the variable mentioned in the terminal. 3. Re-launch the terminal and type claude 4. Type /login and authorize in the browser. It should work now. Earlier, I was getting error 500 and sometimes a timeout error.

This is the sort of work-around that should be more widely known. Clearly Claude Code will accept a "code", but there wasn't good information about how to get a code that could be added.

xbtmatt · 4 months ago

This 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 fish terminal, it was also loading this invalid Auth token.

VSCode requires a restart to reload environment variables so...

  1. Ensure you've removed export CLAUDE_CODE_AUTH_TOKEN="...", set -x CLAUDE_CODE_AUTH_TOKEN "..." and the like from any of your terminal startup scripts.
  2. Restart your computer
  3. Re-authenticate through the typical means (VSCode login sequence, claude setup-token, etc
sobabear · 3 months ago

Some may not have ~/.local/share/claude/versions/2.1.72 just do execute claude and /logout, will begin from scratch login works probably

github-actions[bot] · 1 month ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 7 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.