[BUG] Claude stuck at 0 tokens

Open 💬 23 comments Opened Aug 18, 2025 by NightMachinery

Environment

  • Platform (select one):
  • [x] Anthropic API (pro subscription)
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.83
  • Operating System: 14.3.1
  • Terminal: Kitty

Bug Description

Claude gets stuck on 0 tokens. It doesn't show any errors. It just never produces anything.

Steps to Reproduce

  1. Run claude --verbose.
  2. Say "hi" or anything else.
  3. Wait indefinitely.

Expected Behavior

I'd expect proper error messages or actual responses.

Actual Behavior

Nothing happens.

<img width="1278" height="667" alt="Image" src="https://github.com/user-attachments/assets/8792116a-0c6d-4af6-8cef-2e3583da94ec" />

Update: After about 5 minutes of inactivity, claude actually responded normally. Then my next message was also answered promptly. But when I closed and re-opened claude, it again got stuck.

Additional Context

I deleted ~/.claude.json and ~/.claude.

I also tested on a Linux server I had, and things worked fine there. Claude was also working fine on my laptop, but it recently stopped working. I did reinstall claude dozens of times due to all the auth bugs:

I am running Claude under a proxy using HTTP_PROXY etc. I do not think this is the problem, however, even if it is, claude should generate proper error messages.

Here is claude doctor:

 Checking installation status…

 Diagnostics
 └ Currently running: native (1.0.83)
 └ Path: /Users/evar/.local/bin/claude
 └ Invoked: /Users/evar/.local/share/claude/versions/1.0.83
 └ Config install method: native
 └ Auto-updates enabled: false

View original on GitHub ↗

23 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3692
  2. https://github.com/anthropics/claude-code/issues/3786
  3. https://github.com/anthropics/claude-code/issues/3799

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

NightMachinery · 11 months ago

This problem went away itself. But the bug remains; CC should log its operations somewhere so that long delays like this can be debugged.

yemq3 · 7 months ago

same problem

yemq3 · 7 months ago

I think I may have found the cause. This issue seems related to the Node.js version.

In Node.js 22+, the native fetch uses undici under the hood by default, and it appears undici has some known issues with proxy support (see https://github.com/nodejs/undici/issues/4086).

After downgrading Node.js to version 20 and reinstalling claude, the issue was resolved.

Atephys · 7 months ago

Another possible cause: IPv6 connectivity issues

I had identical symptoms but my issue was DNS returning IPv6 addresses (AAAA records) on a network without working IPv6 routing.

Quick check:

curl -6 -v --connect-timeout 5 https://api.anthropic.com

For me this said "Network is unreachable" while -4 worked.

Fix - prefer IPv4 /etc/gai.conf (Linux):

precedence ::ffff:0:0/96  100

Or just disable IPv6 on your system if you don't use it.

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

mroc170 · 5 months ago

I'm having the same issue. Sometimes it just sits at 0 tokens, and sometimes it responds to my prompt, then sits at 0 tokens and I have to end the session to get a new response

Butanium · 5 months ago

same, seems to correlate with some background task finishing today, never had that before afaict

<img width="841" height="199" alt="Image" src="https://github.com/user-attachments/assets/1e398d4b-881b-4bd1-be77-cde349cd16a4" />

matthewjsloane · 5 months ago

Same issue here

cosmin-cucu · 5 months ago

same here

ronniehyslop · 5 months ago

I am now having this issue too on two separate sessions: "Booping… (esc to interrupt · 1h 27m 40s · ↓ 0 tokens)"

bengruher · 5 months ago

Same issue here

okekrr · 5 months ago

Same issue here

Embracex1998 · 5 months ago

powershell
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
Installing the stable version with this command and then downgrading it to 2.1.7 can resolve this issue. The latest version available at the time of my reply was 2.1.19.

bhavenmurji · 5 months ago

Tried all these fixes and no luck. reinstalled and cleaned out the config. No luck. Stays stuck at 0 tokens and then fires at about 8-10 mins in

CarlosZiegler · 5 months ago

same here

tam5 · 5 months ago

For me, the solution was to remove a UserPromptSubmit hook from a seemingly unrelated and older project.

It started at some point yesterday, I'm not sure exactly what triggered it. It _may_ have been when I installed codev, not sure. But every time I would ask claude it would stall for minutes at a time at 0 tokens, and then eventually resolve.

How I found it:

  • Ran claude --debug in one session
  • ran less +F ~/.claude/debug/latest in another
  • sent "Hello" to claude
  • found this in debug log:

```text
2026-01-08T00:25:19.495Z [DEBUG] Getting matching hook commands for UserPromptSubmit with query: undefined
2026-01-08T00:25:19.495Z [DEBUG] Found 1 hook matchers in settings

  • thought that i don't remember having any intended hooks for user prompt submit here

How I fixed it:

  • Ran claude
  • Ran /hooks
  • Went to UserPromptSubmit hooks
  • found the random one that was there
  • removed it
DonRedwoood · 5 months ago

I've been experiencing this issue as well over the past several days. Claude will often sit there for over 2 minutes with 0 tokens before it finally starts doing something.

DonRedwoood · 5 months ago

<img width="713" height="60" alt="Image" src="https://github.com/user-attachments/assets/8e9bc587-e674-4a08-92e5-5c2a9710b6ce" />

This is getting extremely frustrating.

ghcreative869 · 5 months ago

Root Cause Identified: OAuth Token Not Linked to Max Subscription

I've been investigating this "0 tokens" issue extensively and found the root cause - it's related to the hasExtraUsageEnabled: false bug in the OAuth authentication flow.

My Environment

  • Claude Code Version: 2.1.27 (CLI)
  • - OS: Ubuntu 25.10 (Linux)
  • - - Subscription: Claude Max (active)

What's Actually Happening

  1. When you authenticate, the OAuth token is generated successfully
  2. 2. However, the subscription verification endpoint fails or returns incorrect data
  3. 3. The system defaults to hasExtraUsageEnabled: false in ~/.claude.json
  4. 4. This causes requests to be silently rejected, displaying "0 tokens"

How to Verify This is Your Issue

cat ~/.claude.json | grep -E "(subscriptionType|hasExtraUsageEnabled|rateLimitTier)"

If hasExtraUsageEnabled: false appears despite having a Max subscription, this is the bug.

Workaround (Temporary Fix for 0 Tokens Symptom)

# Clean all credentials
rm -f ~/.claude.json
rm -rf ~/.claude

# Re-authenticate
claude

This resolved the "0 tokens" symptom for me, but hasExtraUsageEnabled: false persists after re-authentication - this is a backend bug that Anthropic needs to fix.

Related Issue

The detailed bug report is in #17966 - this is a systemic issue with the OAuth → Subscription linking pipeline affecting many Max subscribers since January 2026.

Request to Anthropic Engineering

The subscription verification flow needs investigation. Why is it failing/returning incorrect data for valid Max subscribers?

bhavenmurji · 5 months ago

Tried this fix and couldn't get it to work. nuked and Downgraded to 2.1.7. Cleared project and global configs. Now seems to work.

Hnefi · 4 months ago

Same problem for me, this needs to be fixed.

Note: I am experiencing this with hasExtraUsageEnabled: true, so the issue is not necessarily https://github.com/anthropics/claude-code/issues/17966.**

The workaround in https://github.com/anthropics/claude-code/issues/6008#issuecomment-3828941910 does not function, even after re-authenticating multiple times I am still stuck at zero tokens.

Downgrading the version does not fix the issue either.

Flowing-Moon-Xian · 4 months ago

我也遇到了这个问题,但是似乎静止claude code一段时间,就会自动恢复?也有可能是我的版本过低,在linux上的低版本会出现这个问题,但是在mac上就没有出现过。