[BUG] [URGENT!!!] Claude Code is hanging / freezing / stuck on heaps of prompts for 5-20minutes or more.

Open 💬 125 comments Opened Feb 17, 2026 by nullbio
💡 Likely answer: A maintainer (catherinewu, contributor) responded on this thread — see the highlighted reply below.

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?

Ever since the release of Opus 4.6 at least, and maybe slightly before (I can't remember exactly when it started), Claude gets stuck "thinking" for ~5-20 minutes, and sometimes even longer. Token usage does not go up during this time, and packet inspection shows it hanging on waiting for SSE events from Anthropic end for the given prompt.

Sometimes this can be fixed by sending a follow up prompt (doesn't matter what it contains), that kicks it back into action and allows the "thinking" prompt to start flowing again. Other times that doesn't work either.

This isn't Claude doing things behind the scenes, it's literally just stuck / blocking, and doing nothing at all.

In most cases, EVENTUALLY, it seems to unfreeze itself, somehow. But it tends to take over 5 minutes, sometimes beyond 20 mins.

Theres a lot of other people complaining of similar problems, and I'm sure it is affecting a very large amount of users, but I haven't seen any evidence to see Anthropic is aware of it.

What Should Happen?

Not freeze.

Error Messages/Logs

Steps to Reproduce

I'm not sure how to trigger it deterministically.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.38

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Windows Terminal

Additional Information

I'm using WSL2 Ubuntu through Windows terminal.

I've tried deleting my entire Claude Code installation and starting with completely fresh config with no MCPs, skills, etc. Still same problem.

I'm not using a VPN or anything. It was working fine until either the release of Opus 4.6, or just prior to it. That's when I first started having this problem.

I'm using High thinking mode (but again, this is NOT stuck on actually thinking, token and tool usage is not going up at all).

View original on GitHub ↗

125 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/25979
  2. https://github.com/anthropics/claude-code/issues/20572
  3. https://github.com/anthropics/claude-code/issues/26157

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

queglay · 4 months ago

This is happening right now even without 4.6. Requests are just hanging.

fkxxyz · 4 months ago

I encountered the same issue. I noticed that it gets stuck when executing any Bash tool call.
I found a related discussion here: https://www.reddit.com/r/ClaudeAI/comments/1qm1fb5/claude_code_stuck_for_minutes_before_asking_for/
Setting the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to a valid Haiku model resolved the problem for me.

nullbio · 4 months ago
I encountered the same issue. I noticed that it gets stuck when executing any Bash tool call. I found a related discussion here: https://www.reddit.com/r/ClaudeAI/comments/1qm1fb5/claude_code_stuck_for_minutes_before_asking_for/ Setting the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to a valid Haiku model resolved the problem for me.

What did you set it to? How do I know what a valid Haiku model is? I'm just using the max subscription. Shouldn't that be all Haiku models?

fkxxyz · 4 months ago
> I encountered the same issue. I noticed that it gets stuck when executing any Bash tool call. I found a related discussion here: https://www.reddit.com/r/ClaudeAI/comments/1qm1fb5/claude_code_stuck_for_minutes_before_asking_for/ Setting the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to a valid Haiku model resolved the problem for me. What did you set it to? How do I know what a valid Haiku model is? I'm just using the max subscription. Shouldn't that be all Haiku models?

I just set it to ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5.
In my case I'm not on a Claude subscription — I'm using a custom model with a third-party LLM API with ANTHROPIC_BASE_URL set, so there's no default Haiku model, which caused the hang.
If you're on an official Claude plan, I think it should automatically pick the latest Haiku version unless there's a bug.
Not sure if the missing Haiku model is what's causing your issue though, just sharing what worked for me!

nullbio · 4 months ago
> > I encountered the same issue. I noticed that it gets stuck when executing any Bash tool call. I found a related discussion here: https://www.reddit.com/r/ClaudeAI/comments/1qm1fb5/claude_code_stuck_for_minutes_before_asking_for/ Setting the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to a valid Haiku model resolved the problem for me. > > > What did you set it to? How do I know what a valid Haiku model is? I'm just using the max subscription. Shouldn't that be all Haiku models? I just set it to ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5. In my case I'm not on a Claude subscription — I'm using a custom model with a third-party LLM API with ANTHROPIC_BASE_URL set, so there's no default Haiku model, which caused the hang. If you're on an official Claude plan, I think it should automatically pick the latest Haiku version unless there's a bug. Not sure if the missing Haiku model is what's causing your issue though, just sharing what worked for me!

Okay, I'll give it a go regardless. It's intermittent, so who knows, but fingers crossed, thank you.

nullbio · 4 months ago
> > I encountered the same issue. I noticed that it gets stuck when executing any Bash tool call. I found a related discussion here: https://www.reddit.com/r/ClaudeAI/comments/1qm1fb5/claude_code_stuck_for_minutes_before_asking_for/ Setting the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to a valid Haiku model resolved the problem for me. > > > What did you set it to? How do I know what a valid Haiku model is? I'm just using the max subscription. Shouldn't that be all Haiku models? I just set it to ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5. In my case I'm not on a Claude subscription — I'm using a custom model with a third-party LLM API with ANTHROPIC_BASE_URL set, so there's no default Haiku model, which caused the hang. If you're on an official Claude plan, I think it should automatically pick the latest Haiku version unless there's a bug. Not sure if the missing Haiku model is what's causing your issue though, just sharing what worked for me!

No luck unfortunately.

Crazy that Anthropic doesn't seem to care about this. They're happy to pump out useless features but can't be bothered to actually make the service usable. I'm sure I'm not the only one getting absolutely fed up with their radio silence.

catherinewu contributor · 4 months ago

Hi - Thank you for reporting this. Our team is actively investigating this and will update this thread when we know more.

kijun · 4 months ago

happens about 50% of time kicking up things from mobile, almost impossible to do consistent work -- thank you for taking a look

khwerhahn · 4 months ago

Confirming the same behavior on macOS (Apple Silicon, 16 GB RAM), Claude Code v2.1.52, Max subscription, Opus 4.6.

Symptom: Tool calls (Bash, Read, Edit) complete but Claude hangs indefinitely — the spinner keeps spinning, no tokens are consumed, and no progress is made. Pressing Escape and re-prompting immediately unsticks it and the same tool call executes fine on retry. Happens intermittently, roughly 1 in 5 tool calls.

Relevant context — memory pressure may be a factor:
I typically run 3-4 concurrent Claude Code sessions. Each session spawns its own set of MCP servers (Docker gateway, excalidraw, etc.). Before trimming, I had duplicate MCP servers across global config (~/.claude.json) and per-project configs (.mcp.json), resulting in 14+ MCP server processes consuming ~570 MB. System was at 85% memory usage, 65% memory pressure, 3.9 GB swap on 16 GB.

After deduplicating MCP servers (removing ~400 MB of redundant npx-based processes), the hangs seem less frequent but still occur. This suggests memory pressure may exacerbate the issue but isn't the root cause — consistent with the SSE streaming stall theory others have reported.

Single Max subscription, no custom API setup.

ieshuaganocry · 4 months ago

Downgrading to previous version of claude code helped. Installed Stable version: 2.1.44.

jurmadani · 4 months ago

I have the same problem as @khwerhahn, I downgraded to v2.1.44 but it still hangs with 0 tokens used

nullbio · 4 months ago
I have the same problem as @khwerhahn, I downgraded to v2.1.44 but it still hangs with 0 tokens used

I've tried 2.1.44 and 2.1.45 and still get hangs.

jurmadani · 4 months ago
Hi - Thank you for reporting this. Our team is actively investigating this and will update this thread when we know more.

Any news on this error?

j0nas · 4 months ago

I'm surprised this isn't getting more attention; must only be hitting a small percentage of users? This is impacting my ability to do any sort of long-running task. Yesterday a plan hung for 45m.

jurmadani · 4 months ago

I think it's a major outage at all levels

<img width="967" height="744" alt="Image" src="https://github.com/user-attachments/assets/9efe4105-247a-451c-a605-316c161368bf" />

nullbio · 4 months ago
I'm surprised this isn't getting more attention; must only be hitting a small percentage of users? This is impacting my ability to do any sort of long-running task. Yesterday a plan hung for 45m.

Likely it is a subset of users, but also I think most people that are affected just assume it's normal behavior or an issue on their own end, and of the users that do believe it is an issue with Claude itself, only a subset of them would actually be posting about it on Github. So pretty small surface area I suppose - in terms of getting feedback.

kernelguardian · 4 months ago

Just happened to me, max subscription, opus 4.6.
i asked claude to create a dummy log file based on the code and it just sat there for a good 5 minute with 77 tokens. asked it to complete now as a follow up and it immediately jumped to completing it. Bizarre

OgnianM · 4 months ago

It's happening every single time I try to do anything now.

<img width="651" height="198" alt="Image" src="https://github.com/user-attachments/assets/845217af-4f1a-4e4a-90b3-5fdfc5ba3b7e" />

bmistrapau · 4 months ago

I start using Claude Code last week and I have the same behaviour most of the time. It hangs very often between 5 and 20 minutes in thinking mode. Sometimes it resumes automatically. But it's frustrating. I'm using most of the time Pro plan, with Claude Sonnet 4.6 model.

abstractrealism · 4 months ago

Happening for me as well. It's been on the same "Planning" step for days now, across full system restarts. Pro plan, I did hit a limit at one point before it broke, not sure if that caused it at all.

cyx-darren · 4 months ago

happened to me too
very frustrating
it only happened since yesterday
degraded performance across all my claude code sessions

abstractrealism · 4 months ago

I found a workaround that got it unstuck, and might point to a fix? I typed something else, like "what's next," and then immediately Cmd-Tabbed away to another app. After a minute I got a notification along the lines of "Allow Claude to exit Plan Mode?" and hovered on it to click "Allow Once," and then it proceeded properly. I wasn't getting that prompt in the app though, so I think it was perpetually waiting for permission to end plan mode but not actually asking for it.

jalalnet24 · 4 months ago

Still happening as of 2026-03-10 on Windows 11 + VS Code extension (Opus 4.6).

Same symptoms: Claude gets stuck in "Thinking"/"Spelunking" state, stop button is completely unresponsive, new messages are ignored. Only fix is killing the session. This has gotten noticeably worse after the latest extension update.

vladfi1 · 4 months ago

I am seeing this as well. Stuck in thinking with tokens constant. Eventually resumed working after ~10 minutes.

dazbaz73 · 4 months ago

Also seeing the same issue. I try to interrupt the session and continue, but it just keeps hanging. I've tries opening a new session but that just spins too.

kolkov · 4 months ago

Experiencing the same issue constantly on Windows 10 + Git Bash, Claude Code 2.1.74, Opus 4.6.

Symptoms:

  • Agent appears to be "thinking" — timer is running, but 0 tokens consumed, nothing is happening
  • Pressing ESC and re-submitting the previous command (or just typing "continue") immediately wakes it up and it resumes working normally
  • If I queue a follow-up message while it's hung, pressing ESC doesn't fully cancel — it cancels the stuck prompt and immediately activates the queued one, which then works fine
  • The new connection/request works every time — it's the original one that's dead

Frequency is increasing:

  • Fall 2025: rare, maybe once or twice per session
  • Now (March 2026): roughly 10-15% of prompts hang like this per hour, sometimes more
  • It's become a constant babysitting problem — I have to watch the agent and intervene manually when it freezes

Ironic proof: While writing this very comment, Claude Code hung for 2+ minutes on "Orbiting..." with 0 tokens. Had to ESC and re-submit. The bug reproduced itself while reporting it.

Workaround: ESC → re-submit. Works 100% of the time, confirming the issue is a stale/dead API streaming connection, not a server-side problem.

This really needs a client-side streaming timeout + automatic retry.

dandanmarcovici · 4 months ago

This is also happening again here using 2.1.74. I tried rolling back to a version that I knew was working before 2.1.68, but no luck. Still hangs. Tokens get to a certain number stop and time continues.

Elliot8212 · 4 months ago

I had the same issue when it's in plan mode.
What worked for me :

  • Stop.
  • type : "execute the plan"
razlani · 4 months ago

esc > 'continue from above' doesn't seem to work reliably. when it freezes the session, it seems to freeze the f'ing session.

CC in WSL, latest version

This oughta be a high priority issue given the duplicate issues open all addressing the same problem :/

kolkov · 4 months ago

We reverse-engineered cli.js across 12 npm versions and analyzed 1,571 sessions (148,444 tool calls, 8,007 orphaned) to find the root causes of this and related hang/orphan issues.

Full analysis with code offsets and fix proposals: #33949

nullbio · 4 months ago
We reverse-engineered cli.js across 12 npm versions and analyzed 1,571 sessions (148,444 tool calls, 8,007 orphaned) to find the root causes of this and related hang/orphan issues. Full analysis with code offsets and fix proposals: #33949

Wow, legends! It's actually ridiculous that the community has to resort to reverse engineering their software because they don't fix high severity bugs... At least open-source it so we can patch things ourselves more easily. Their reasoning is because they think Claude Code is some sort of moat, but it actually is going to have the opposite effect: People will make alternatives out of sheer frustration, causing the market to become more competitive for them. The moat angle only makes sense if you can keep up, otherwise all it does is burn bridges.

Looking from the outside, one can only assume they're focused on building mountains upon mountains of tech debt instead of refactoring their existing codebase using sound SE principles, and putting attention into quality over quantity.

This is my perception of how Claude Code has been going since launch, based on using it every day all day and keeping a close watch on socials and GH issues:

<img width="824" height="918" alt="Image" src="https://github.com/user-attachments/assets/a441ab1f-24fa-4ad2-870d-866c40d087b9" />

Maybe I'm more pessimistic than others, because I'm constantly running into issues and it falls on deaf ears (other than others in the community who put in the work for them, like @kolkov).

Another thing worth pointing out, is that these seems to have coincided with the launch of 4.6 and "fast mode". I feel like infrastructure/dev-ops is part of the issue here. Why are so many connections hanging? No doubt they've introduced some queuing mechanism to give "fast mode" customers (aka themselves, in large part) priority. I'm wondering if that's got bugs in it. Or whatever infra setup they've got going now for 4.6 is causing issues.

While your fixes should exist to begin with, I think it's a bandaid masking the real root of the issue -- whatever is causing all these hangs to begin with. That is something on their end I believe.

Also:

"Important note on testing: We suspect Anthropic internally uses a private API endpoint or prioritized infrastructure that doesn't experience the same latency, timeouts, and stale connections that paying customers face on the public API."

I agree, very likely. Their attitude seems to be: _Well it doesn't affect us, so who cares about our customers. A bug affecting thousands of customers (maybe tens of thousands, maybe millions) and the reputation damage of that? Ah well, works for me. LLM go brrrrr_

When their reputation is trashed, it shouldn't come as a surprise why.

/end rant.

kolkov · 4 months ago

@nullbio Great points, especially about fast mode and infrastructure priorities. Your graph is painfully accurate.

We just checked v2.1.76 (released today) — downloaded from npm, extracted cli.js, checked all 3 root causes:

| Root Cause | v2.1.74 | v2.1.75 | v2.1.76 | Status |
|------------|---------|---------|---------|--------|
| No streaming timeout | ❌ | ❌ | ❌ | 3 releases, still broken |
| ESC queue auto-restart | ❌ | ❌ | ❌ | 3 releases, still broken |
| Non-atomic JSONL writes | ❌ | ❌ | ❌ | 3 releases, still broken |

The code in insertMessageChain() is character-for-character identical across all three versions (only minified variable names differ). Zero effort on core reliability.

Honestly, at this point I'm not even sure these are bugs — they might be features. Think about it:

  • 5 rate limits (hourly, daily, weekly, monthly, per-model) aren't enough to manage infrastructure load
  • Hanging connections = users waste tokens on retries = more revenue
  • Broken ESC = queued prompts auto-restart = more API calls = more revenue
  • No timeout = client waits forever = server doesn't need to handle reconnection logic

Maybe we're naively giving free engineering advice to a company that has a business reason not to fix this. Every hung connection that forces a retry is another API call billed to the customer.

Meanwhile, instead of working on our actual projects — like GoGPU, a GPU computing ecosystem in Go — we're spending days reverse-engineering Anthropic's minified JavaScript and writing professional bug reports with fix proposals. For free. That they apparently don't need.

The irony: we're using Claude Code (and paying for it) to debug Claude Code, while Claude Code hangs every 10 minutes. That's some next-level dogfooding.

kolkov · 4 months ago

To add to that — the frustration with Claude Code's reliability actually pushed me to build my own AI development ecosystem: GOCO.AI (codename PUPSEEK).

Written in Go — which turns out to be the ideal choice for this kind of tool: fast startup, low memory footprint, single binary distribution, no .node file leaks, no 12MB minified JavaScript bundles. It supports multiple AI models simultaneously — you can mix Claude, DeepSeek, Kimi, GPT, Gemini in the same conversation or use different models for different tasks (research vs coding vs review). And it doesn't hang, doesn't lose tool results, and ESC actually works.

The ecosystem includes:

  • GOCO — AI Code Assistant with multi-agent orchestration (the Claude Code replacement)
  • GODA — Browser Automation platform (chromedp + MCP integration)
  • GOPS — Project Scanner with AST parsing for 30+ languages (tree-sitter)
  • GODE — Headless IDE with LSP support, semantic refactoring, and 3-way merge
  • emcp-go — Full MCP Protocol implementation in Go

For everyday tasks we use DeepSeek, Kimi and other affordable models. Opus 4.6 is still the best for large complex projects — but through the raw API, not through Claude Code.

The only thing stopping wider API adoption is cost: Anthropic's API is significantly more expensive than the Max subscription. So we're stuck in a paradox — pay $100-200/month for a broken tool that hangs every 10 minutes, or pay 5-10x more for the raw API to build a tool that actually works.

Either way, Anthropic wins financially. Maybe that's the real business model.

legendarysuccess · 4 months ago

Going on 12+ hours of not being able to get Claude Code (any model) working with Cloud Environment's attached to a Repo. Local environment projects work fine, but any cloud repo fails to get past the thinking stage. Follow up prompting doesn't seem to work and disconnecting/re-authorizing access to Github didn't work.

kolkov · 4 months ago

@legendarysuccess We had a similar issue today — one of our parallel agents got stuck in a 500/529 error loop for hours while two others worked perfectly. Turned out it was stuck on a specific backend instance (same request_id across retries = sticky routing).

What helped:

  1. Start a completely fresh session/exit → wait a few seconds → claude again. New TCP connection = new backend instance
  2. If the session JSONL file has grown large (ours was 107 MB after 12 days), a fresh session dramatically helps

Also, Anthropic seems to be updating infrastructure right now — they launched a 2x usage promotion for off-peak hours through March 28, possibly testing new datacenter capacity. Things have been flying for us in the last few hours after weeks of constant stalls.

If fresh sessions don't help, try adding this to ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_ENABLE_STREAM_WATCHDOG": "1"
  }
}

This enables a hidden streaming watchdog (30s warning, 60s abort + retry) that's been in the code since February but disabled by default. Details in #33949.

legendarysuccess · 4 months ago

@kolkov Thanks - I'll try adding that - For more details I should clarify I've been having this issue through the Claude Code Desktop app on Windows and via Claude Code on the web. I'm not as savvy when it comes to using Claude Code in terminals.

kolkov · 4 months ago

@legendarysuccess Ah, for Desktop and web the settings.json watchdog trick won't work — that's for the CLI terminal version only. Desktop/web likely have their own streaming timeout handling (or lack thereof).

For Desktop/web, try:

  1. Close the conversation and start a fresh one — this forces a new connection to a different backend instance
  2. Try during off-peak hours — Anthropic is running a 2x usage promotion until March 28, and servers seem less loaded outside 12-6 PM GMT
  3. Check if it's specific to Cloud Environments — you mentioned local projects work fine, so the issue might be with the repo connection/auth layer, not the model itself

The infrastructure seems to be improving — things have been significantly faster for us in the last 12 hours. Hopefully whatever they're updating will help Desktop/web too.

legendarysuccess · 4 months ago

@kolkov appreciate the help! Hopefully see a resolution here soon.

m13v · 4 months ago

we run Claude Code agents on scheduled cron jobs and the hanging happens more frequently in long sessions with lots of tool calls. in our case the freeze usually correlates with the agent hitting context limits and the compaction process taking forever. the workaround that helped us most was setting --max-turns to cap how far a session can go, and breaking large tasks into smaller sessions with file-based state handoff. the 5-20 minute hangs specifically seem to happen when the model is trying to process a very large tool result (like a big file read or a long command output).

m13v · 4 months ago

if it helps debug, we built a tool executor that handles hanging tool calls with timeouts and fallback - the pattern of wrapping each tool invocation with a deadline helped us catch similar freezes early: https://github.com/m13v/fazm/blob/main/Desktop/Sources/Providers/ChatToolExecutor.swift

MHanutko · 3 months ago

Environment: Windows PowerShell, Opus 4.6 (1M context), large monorepo

Today: 42 minutes "Tempering..." in Plan Mode with only 2.8k tokens output and 96% context remaining. This is during European business hours (CET).

This is a recurring pattern - during US/EU business hours, Opus becomes practically unusable. Evenings and weekends are significantly faster with the same tasks and codebase.

At Max plan pricing, this latency is not acceptable for professional use. Looking forward to a fix.

rstuart · 3 months ago

As others have noted, it is hanging daily for me now. Symptoms are it's doing some task, the UI is frozen (eg, the time isn't ticking over), doesn't respond to the keyboard, ^C (interrupt), ^\ (quit), SIGTERM. The only way out is SIGKILL.

At the end you can see how strace says it responds to SIGTERM.

$ claude
 ▐▛███▜▌   Claude Code v2.1.81
▝▜█████▛▘  Opus 4.6 (1M context) · Claude Max
....
● Agent(Main module implementer)                                                                                                                                
  ⎿  Bash(cd /home/me/accounts/.llm-tmp/work && python3 -c "                                                                                       
         import sys…)                                                                                                                                           
     Running…                                                                                                                                                   
     Bash(cd /home/me/accounts/.llm-tmp/work && python3 -c "                                                                                       
         import re…)                                                                                                                                            
     Running…                                                                      
     Bash(cd /home/me/accounts/.llm-tmp/work && python3 -c "                                                                                       
         import re…)                                                               
     Running…                                                                                                                                                   
     +60 more tool uses (ctrl+o to expand)                                                                                                                      
     (ctrl+b to run in background)                                                                                                                              
                                                                                                                                                                
* Step 2: Module implementers + integration builder… (1h 19m 19s · ↓ 168.2k tokens)                                                                             
  ⎿  ✔ Step 1: Specification writer                                                                                                                             
     ◼ Step 2: Module implementers + integration builder                                                                                                        
     ◻ Step 3: SQLite converter                                                                                                                                 
     ◻ Step 4: Cross-validation                                                                                                                                 
     ◻ Step 5: Acceptance                                                                                                                                       
                                              
$ claude --version
2.1.81 (Claude Code)
$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ pstree -as 1161813
systemd
  └─systemd --user
      └─plasmashell --no-respawn
          └─konsole
              └─bash
                  └─claude
                      ├─(bwrap)
                      ├─socat UNIX-LISTEN:/tmp/claude-http-c19e978bfdb474c2.sock,fork,reuseaddr ...
                      ├─socat UNIX-LISTEN:/tmp/claude-socks-c19e978bfdb474c2.sock,fork,reuseaddr ...
                      └─20*[{claude}]
$ gdb -p 1161813
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 1161813
[New LWP 1161825]
[New LWP 1161826]
[New LWP 1161827]
[New LWP 1161828]
[New LWP 1161840]
[New LWP 1161841]
[New LWP 1161843]
[New LWP 1161848]
[New LWP 1162110]
[New LWP 1162111]
[New LWP 1162112]
[New LWP 1162113]
[New LWP 1162114]
[New LWP 1162115]
[New LWP 1162116]
[New LWP 1162117]
[New LWP 1162118]
[New LWP 1162119]
--Type <RET> for more, q to quit, c to continue without paging--c
[New LWP 1162120]
[New LWP 1162121]

warning: Could not load shared library symbols for 2 libraries, e.g. /tmp/.999efde97bceeecb-00000000.node.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00000000031ddc8d in ?? ()
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/me/.local/share/claude/versions/2.1.81.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) bt
#0  0x00000000031ddc8d in ?? ()
#1  0x00000000035d8f58 in ?? ()
#2  0x00000000035da5dc in ?? ()
#3  0x00000000037a1a66 in ?? ()
#4  0x0000000003f288a9 in ?? ()
#5  0x0000000004de899b in ?? ()
#6  0x00007f6f2bb51320 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb) info threads 
  Id   Target Id                                             Frame 
* 1    Thread 0x7f6f373bd400 (LWP 1161813) "claude"          0x00000000031ddc8d in ?? ()
  2    Thread 0x7f6ee3dff6c0 (LWP 1161825) "Bun Pool 0"      0x00000000032c1993 in ?? ()
  3    Thread 0x7f6ee39fe6c0 (LWP 1161826) "Bun Pool 1"      0x00000000032c1993 in ?? ()
  4    Thread 0x7f6ee13ff6c0 (LWP 1161827) "HTTP Client"     0x0000000003db935a in ?? ()
  5    Thread 0x7f6ee0ffe6c0 (LWP 1161828) "Bun Pool 2"      0x00000000032c1993 in ?? ()
  6    Thread 0x7f6ee08f76c0 (LWP 1161840) "Bun Pool 3"      0x00000000032c1993 in ?? ()
  7    Thread 0x7f6ee04f66c0 (LWP 1161841) "Bun Pool 4"      0x00000000032c1993 in ?? ()
  8    Thread 0x7f6ed9fff6c0 (LWP 1161843) "Bun Pool 5"      0x00000000032c1993 in ?? ()
  9    Thread 0x7f6ed9bfe6c0 (LWP 1161848) "File Watcher"    0x00000000031ddc8d in ?? ()
  10   Thread 0x7f6ed8aaf6c0 (LWP 1162110) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  11   Thread 0x7f6ed88ae6c0 (LWP 1162111) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  12   Thread 0x7f6ed86ad6c0 (LWP 1162112) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  13   Thread 0x7f6ed84ac6c0 (LWP 1162113) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  14   Thread 0x7f6ed82ab6c0 (LWP 1162114) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  15   Thread 0x7f6ebdfff6c0 (LWP 1162115) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  16   Thread 0x7f6ebddfe6c0 (LWP 1162116) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  17   Thread 0x7f6ebdbfd6c0 (LWP 1162117) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  18   Thread 0x7f6ebd9fc6c0 (LWP 1162118) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  19   Thread 0x7f6ebd7fb6c0 (LWP 1162119) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  20   Thread 0x7f6ebd5fa6c0 (LWP 1162120) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
  21   Thread 0x7f6ebd3f96c0 (LWP 1162121) "tokio-runtime-w" 0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 0x7f6ee3dff6c0 (LWP 1161825))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0x7f6ee39fe6c0 (LWP 1161826))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 4
[Switching to thread 4 (Thread 0x7f6ee13ff6c0 (LWP 1161827))]
#0  0x0000000003db935a in ?? ()
(gdb) bt
#0  0x0000000003db935a in ?? ()
#1  0x000000000478d836 in ?? ()
#2  0x0000000000000000 in ?? ()
(gdb) thread 5
[Switching to thread 5 (Thread 0x7f6ee0ffe6c0 (LWP 1161828))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 6
[Switching to thread 6 (Thread 0x7f6ee08f76c0 (LWP 1161840))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 7
[Switching to thread 7 (Thread 0x7f6ee04f66c0 (LWP 1161841))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 8
[Switching to thread 8 (Thread 0x7f6ed9fff6c0 (LWP 1161843))]
#0  0x00000000032c1993 in ?? ()
(gdb) bt
#0  0x00000000032c1993 in ?? ()
#1  0x0000000003353809 in ?? ()
#2  0x0000000003789759 in ?? ()
#3  0x0000000003352f80 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 9
[Switching to thread 9 (Thread 0x7f6ed9bfe6c0 (LWP 1161848))]
#0  0x00000000031ddc8d in ?? ()
(gdb) bt
#0  0x00000000031ddc8d in ?? ()
#1  0x00000000041419d8 in ?? ()
#2  0x00000000037885b3 in ?? ()
#3  0x00000000032117f9 in ?? ()
#4  0x00007f6f375341f5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f6f375b48dc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 10
[Switching to thread 10 (Thread 0x7f6ed8aaf6c0 (LWP 1162110))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0xd0433d84ffffffff in ?? ()
#3  0x00000000197138a0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 11
[Switching to thread 11 (Thread 0x7f6ed88ae6c0 (LWP 1162111))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 11
[Switching to thread 11 (Thread 0x7f6ed88ae6c0 (LWP 1162111))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) thread 12
[Switching to thread 12 (Thread 0x7f6ed86ad6c0 (LWP 1162112))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x00000000ffffffff in ?? ()
#3  0x0000000019715ca0 in ?? ()
#4  0x0000000019f84c00 in ?? ()
#5  0x00007f6ed865ddf8 in ?? ()
#6  0x000000001970f980 in ?? ()
#7  0x0000000019715cc0 in ?? ()
#8  0x0000000000000000 in ?? ()
(gdb) thread 13
[Switching to thread 13 (Thread 0x7f6ed84ac6c0 (LWP 1162113))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x31d28bc9ffffffff in ?? ()
#3  0x00000000197126a0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 14
[Switching to thread 14 (Thread 0x7f6ed82ab6c0 (LWP 1162114))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x7f2c20fcffffffff in ?? ()
#3  0x0000000019714aa0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 15
[Switching to thread 15 (Thread 0x7f6ebdfff6c0 (LWP 1162115))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd61c6 in ?? ()
#2  0x00000000ffffffff in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) thread 16
[Switching to thread 16 (Thread 0x7f6ebddfe6c0 (LWP 1162116))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x6196bf00ffffffff in ?? ()
#3  0x0000000019711da0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 17
[Switching to thread 17 (Thread 0x7f6ebdbfd6c0 (LWP 1162117))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x46444e82ffffffff in ?? ()
#3  0x0000000019712fa0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 18
[Switching to thread 18 (Thread 0x7f6ebd9fc6c0 (LWP 1162118))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0xb7cfdde6ffffffff in ?? ()
#3  0x00000000197141a0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0xb7cfdde6ffffffff in ?? ()
#3  0x00000000197141a0 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) thread 19
[Switching to thread 19 (Thread 0x7f6ebd7fb6c0 (LWP 1162119))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x00000000ffffffff in ?? ()
#3  0x00000000197153a0 in ?? ()
#4  0x0000000019f84300 in ?? ()
#5  0x00007f6ebd7abdf8 in ?? ()
#6  0x000000001970f900 in ?? ()
#7  0x00000000197153c0 in ?? ()
#8  0x0000000000000000 in ?? ()
(gdb) thread 20
[Switching to thread 20 (Thread 0x7f6ebd5fa6c0 (LWP 1162120))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x00000000ffffffff in ?? ()
#3  0x00000000197165a0 in ?? ()
#4  0x0000000019f84c00 in ?? ()
#5  0x00007f6ebd5aadf8 in ?? ()
#6  0x000000001970fa00 in ?? ()
#7  0x00000000197165c0 in ?? ()
#8  0x0000000000000000 in ?? ()
(gdb) thread 21
[Switching to thread 21 (Thread 0x7f6ebd3f96c0 (LWP 1162121))]
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f6f375ac819 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6ed8bd7946 in ?? ()
#2  0x00000000ffffffff in ?? ()
#3  0x0000000019710ba0 in ?? ()
#4  0x0000000019f82d00 in ?? ()
#5  0x00007f6ebd3a9df8 in ?? ()
#6  0x000000001970f500 in ?? ()
#7  0x0000000019710bc0 in ?? ()
#8  0x0000000000000000 in ?? ()
(gdb) thread 22
Unknown thread 22.
(gdb) quit
A debugging session is active.

        Inferior 1 [process 1161813] will be detached.

Quit anyway? (y or n) y

Detaching from program: /home/me/.local/share/claude/versions/2.1.81, process 1161813
[Inferior 1 (process 1161813) detached]
$ pstree -astp 1161813
systemd,1
  └─systemd,3765 --user
      └─plasmashell,4344 --no-respawn
          └─konsole,103588
              └─bash,103604
                  └─claude,1161813
                      ├─(bwrap,1207550)
                      ├─socat,1161900 UNIX-LISTEN:/tmp/claude-http-c19e978bfdb474c2.sock,fork,reuseaddr ...
                      ├─socat,1161901 UNIX-LISTEN:/tmp/claude-socks-c19e978bfdb474c2.sock,fork,reuseaddr ...
                      ├─{Bun Pool 0},1161825
                      ├─{Bun Pool 1},1161826
                      ├─{Bun Pool 2},1161828
                      ├─{Bun Pool 3},1161840
                      ├─{Bun Pool 4},1161841
                      ├─{Bun Pool 5},1161843
                      ├─{File Watcher},1161848
                      ├─{HTTP Client},1161827
                      ├─{tokio-runtime-w},1162110
                      ├─{tokio-runtime-w},1162111
                      ├─{tokio-runtime-w},1162112
                      ├─{tokio-runtime-w},1162113
                      ├─{tokio-runtime-w},1162114
                      ├─{tokio-runtime-w},1162115
                      ├─{tokio-runtime-w},1162116
                      ├─{tokio-runtime-w},1162117
                      ├─{tokio-runtime-w},1162118
                      ├─{tokio-runtime-w},1162119
                      ├─{tokio-runtime-w},1162120
                      └─{tokio-runtime-w},1162121
$ strace -p 1161813
strace: Process 1161813 attached
futex(0x58484a60ca0, FUTEX_WAIT_PRIVATE, 3, NULL^Cstrace: Process 1161813 detached
 <detached ...>

$ strace -p 1161825
strace: Process 1161825 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161825 detached
 <detached ...>

$ strace -p 1161826
strace: Process 1161826 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161826 detached
 <detached ...>

$ strace -p 1161828
strace: Process 1161828 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161828 detached
 <detached ...>

$ strace -p 1161840
strace: Process 1161840 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161840 detached
 <detached ...>

$ strace -p 1161841
strace: Process 1161841 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161841 detached
 <detached ...>

$ strace -p 1161843
strace: Process 1161843 attached
futex(0x6cab64c, FUTEX_WAIT_PRIVATE, 1, NULL^Cstrace: Process 1161843 detached
 <detached ...>

$ strace -p 1161848
strace: Process 1161848 attached
futex(0x584846601f8, FUTEX_WAIT_PRIVATE, 3, NULL^Cstrace: Process 1161848 detached
 <detached ...>

$ strace -p 1161827
strace: Process 1161827 attached
epoll_pwait2(14, ^Cstrace: Process 1161827 detached
 <detached ...>

$ strace -p 1162110
strace: Process 1162110 attached
futex(0x197138c8, FUTEX_WAIT_BITSET_PRIVATE, 0, NULL, FUTEX_BITSET_MATCH_ANY^Cstrace: Process 1162110 detached
 <detached ...>

$ strace -p 1162111
strace: Process 1162111 attached
futex(0x197114c8, FUTEX_WAIT_BITSET_PRIVATE, 0, NULL, FUTEX_BITSET_MATCH_ANY^Cstrace: Process 1162111 detached
 <detached ...>

$ strace -p 1161813
strace: Process 1161813 attached
futex(0x58484a60ca0, FUTEX_WAIT_PRIVATE, 3, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=114240, si_uid=1135} ---
write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
rt_sigreturn({mask=[]})                 = 202
futex(0x58484a60ca0, FUTEX_WAIT_PRIVATE, 3, NULL^Cstrace: Process 1161813 detached
 <detached ...>

$ strace -p 1161827
strace: Process 1161827 attached
epoll_pwait2(14, ^Cstrace: Process 1161827 detached
 <detached ...>

$ 
kolkov · 3 months ago

@rstuart This is incredibly valuable — first GDB/strace analysis of the hang I've seen. Thank you.

Your data confirms what we've been suspecting: all 6 Bun Pool threads deadlocked on a single futex (0x6cab64c), with the HTTP Client thread stuck in epoll_pwait2 (likely waiting for SSE data).

This aligns with our root cause #1 from the source code analysis: the messages.stream() call has no client-side timeout, and the SSE connection can die silently. Your HTTP Client thread (Thread 4) is likely waiting for IO on a stale SSE socket, and the Bun Pool threads appear to be deadlocked on a shared mutex — possibly related to the HTTP Client state.

Workaround that helps

We found a hidden streaming watchdog in the code (exists since v2.1.50, disabled by default):

// Add to ~/.claude/settings.json
{
  "env": {
    "CLAUDE_ENABLE_STREAM_WATCHDOG": "1",
    "DISABLE_AUTOUPDATER": "1"
  }
}

This enables a 45s warning / 90s abort watchdog (v2.1.79+) that kills dead SSE connections and retries. It significantly reduced our stalls — though it may not prevent this specific deadlock if the mutex contention happens before the watchdog can fire.

What your data reveals about the deadlock

Thread 4 (HTTP Client) → epoll_pwait2     ← waiting for dead SSE socket
Thread 2-8 (Bun Pool)  → futex(0x6cab64c) ← all waiting on SAME mutex
Thread 1 (main)         → futex(different)  ← waiting for Bun Pool result
Thread 10-21 (tokio)    → futex             ← sandbox workers waiting

Likely sequence (hypothesis — needs confirmation):

  1. SSE connection stalls → HTTP Client blocks on epoll_pwait2
  2. Bun Pool threads try to process something that needs a shared lock
  3. Lock holder may be waiting for HTTP Client or another blocked resource → circular wait → deadlock
  4. Main thread waits for Bun Pool result → also blocked
  5. SIGTERM handler writes to pipe but main thread returns to futex WAIT — cannot break deadlock, only SIGKILL works

We also documented 6 Bun crashes + memory analysis

Beyond deadlocks, we've documented 6 mimalloc crashes on Windows (8-24 hour sessions, 10-26 GB committed memory). Full analysis including process memory breakdowns, cascade failures (IDE crashes, system-wide lag), and the hidden watchdog discovery: #33949, #36132.

Also worth noting: your .node file in /tmp is better-sqlite3 native addon — it leaks ~7 MB per Bash tool call. Related: #23095.

Can you dig deeper?

Your GDB/strace skills are exactly what this investigation needs. A few things that would be incredibly useful if you can reproduce the hang again:

  1. What is futex 0x6cab64c?info proc mappings in GDB might reveal if it's in mimalloc, JavaScriptCore, or Bun's own code
  2. Who holds the lock?thread apply all bt full might show which thread last acquired the mutex (though symbols are stripped)
  3. Does watchdog prevent it? — try with CLAUDE_ENABLE_STREAM_WATCHDOG=1 and see if the deadlock still occurs
  4. Memory state at hangcat /proc/<pid>/status | grep Vm to see VmRSS/VmSize/VmSwap during the hang
  5. Is it reproducible with --bare? — v2.1.81 added --bare flag that skips hooks/LSP/plugins, might narrow down the trigger

We're also setting up a dedicated research agent to investigate Bun internals systematically. Your GDB data is the first real look at what happens inside a hung Claude Code process — incredibly valuable.

The elephant in the room: Bun/Ink architecture

After reverse-engineering cli.js across 16 npm versions, documenting 6 mimalloc crashes, and now seeing this deadlock — we believe the current architecture (Bun + Ink/React + mimalloc) is fundamentally unsuitable for a long-running interactive CLI tool:

  • Bun/mimalloc: 12+ GB virtual per process, committed memory grows 0.6-5 GB/hour and never returns to OS, crashes after 8-24 hours even in idle (#36132)
  • Ink (React for terminal): full-screen redraws on every state change, 100% CPU loops, scroll position resets — #3648 (👍694, most popular issue ever)
  • 21 threads for what is essentially an HTTP client + terminal UI — your pstree shows the bloat clearly
  • No file locking on concurrent tool execution — agents overwrite each other's edits

The fundamental problem isn't the language — it's the architecture. Every Claude Code session spawns a full 21-thread process with its own Bun runtime, mimalloc heap, React/Ink renderer, and HTTP client. Run 7 agents = 7 × 1-6 GB = system collapse. Your pstree shows it perfectly: 21 threads per process for what should be a lightweight terminal client.

The correct approach is daemon + thin clients: one persistent service process manages LLM connections, sessions, and agent orchestration. Each terminal tab is just a lightweight client that connects to the daemon via IPC. If a client crashes — the daemon keeps working, session is preserved. No 12 GB virtual per tab, no 21-thread mutex deadlocks, no mimalloc accumulation across 7 independent processes.

This is the approach we're taking with our own tool (proprietary, Go-based) — daemon-based architecture where thin clients can work autonomously when the daemon is unavailable, but share resources (LLM pool, sessions, memory) when it's running. One daemon vs. seven 21-thread monsters fighting for the same pagefile.

Anthropic's models are brilliant — Opus 4.6 and Sonnet 4.6 are genuinely the best for coding. The architecture wrapping them needs a fundamental rethink.

littlett77 · 3 months ago

According to the pstree and strace investigations that I was also doing since last night, I believe that the same issue (bun stuck on http download sortof) is also affecting the Linux installer (claude-2.1.81-linux-x64 install)

littlett77 · 3 months ago
According to the pstree and strace investigations that I was also doing since last night, I believe that the same issue (bun stuck on http download sortof) is also affecting the Linux installer (claude-2.1.81-linux-x64 install)

UPDATE: after being stuck for few hours, it actually exited with error:

X Installation failed

Download stalled: no data received for 60 seconds

Try running with force to override checks
rtb11111 · 3 months ago

@kolkov Seriously, can you stop shitting up this thread with your AI-generated analyses which are clearly just there to promote your own AI projects? You're not adding anything to the discussion by pasting unsolicited, AI-generated engineering advice to Anthropic here. Do you think Anthropic engineers don't have access to LLMs??

kolkov · 3 months ago

@rtb11111 Anthropic engineers certainly have access to LLMs. But as practice shows, having access and knowing how to use them properly are two different things.

This is evident from the choice of tech stack (Bun/mimalloc that crashes after 8 hours even in idle, Ink/React for a terminal app that causes the most popular issue in the entire repo with 694 thumbsups), to the implementation (streaming watchdog written in February but hidden behind an undocumented env var for months while 150+ users report hangs daily).

Plenty of new features every release — prompt bar colors, session names, voice mode. Meanwhile, bugs that affect everyone's daily workflow remain unfixed for months, or worse — the fix exists in the code but isn't enabled.

Our "AI-generated analyses" include:

  • Reverse-engineering 16 versions of cli.js from npm packages
  • 6 documented Bun crashes with debug logs and memory dumps
  • Discovery of the hidden CLAUDE_ENABLE_STREAM_WATCHDOG that the community is now using as a workaround
  • GDB/strace deadlock analysis (contributed by @rstuart)
  • Process memory analysis showing 7 CLI processes consuming 26 GB commit

If this is "shitting up the thread" — what exactly have you contributed?

nicknash · 3 months ago

This is an incredibly frustrating issue, it makes Claude Code almost unusable since it began happening to me in the last few days.

kolkov · 3 months ago

Update: Switched from native (Bun) to npm (Node.js) — dramatic stability improvement

After 6 Bun crashes in 4 days, 26 GB commit from 7 processes, IDE crashes, and system deadlocks — we decided to switch back from the native installer (Bun 1.3.11) to the npm package (Node.js v22.17.0). Same cli.js, same settings, different runtime.

# How we switched (keep your settings!)
cp -r ~/.claude ~/.claude-backup          # backup first
rm ~/.local/bin/claude.exe                # remove native binary (NOT claude uninstall!)
npm install -g @anthropic-ai/claude-code  # install npm version

Results after first hours on Node.js

Memory — night and day:

| Metric | Bun (native) | Node.js (npm) |
|--------|-------------|--------------|
| Commit per process | 1-15 GB (grows forever) | 300-500 MB (stable) |
| Commit ≈ RSS ratio | Commit 10-15x larger than RSS | Commit ≈ RSS |
| 5 processes total | 26 GB commit | 1.6 GB commit |
| System RAM used | 70%+ (constantly swapping) | 47% (21 GB free) |
| Memory over time | Grows 0.6-5 GB/hour | Flat or decreasing |

Stability:

  • 0 mimalloc crashes (impossible on Node.js)
  • 0 "Tool bash not found" (no memory corruption)
  • 0 system deadlocks
  • 0 IDE crashes from memory pressure
  • V8 GC actually returns memory to OS (mimalloc never did)

What still remains (cli.js / server-side):

  • Streaming stalls — still happen (server-side issue)
  • Tool result loss — insertMessageChain() for-loop still non-atomic

What ALSO disappeared (we thought it was Ink, it was Bun):

  • Scroll resets (Full reset (scrollback changes)) — 316 per session on Bun → 0 on Node.js
  • Input field rendering corruption — text appearing below prompt, garbled input — gone
  • Scrolling history back and forth works smoothly — no jumps, no discomfort
  • We originally attributed all of this to Ink's renderer (#3648, 👍694). Debug logs prove it was Bun/mimalloc corrupting render state.

The theory: Bun/mimalloc was THE root cause

We originally identified 3 separate root causes (#33949). But switching runtimes suggests many symptoms may have been one root cause — mimalloc memory corruption:

  • "SSE connection dies" → corrupted HTTP client state
  • "Tool result lost" → corrupted JSONL write buffer (partially — for-loop bug is real too)
  • "Scroll jumps" → corrupted render state
  • "Tool bash not found" → corrupted tools registry
  • "21-thread deadlock" → corrupted event loop / mutex state
  • "System freeze" → mimalloc scavenger blocking all threads

All of these disappear or dramatically reduce on Node.js/V8.

Recommendation

If you're experiencing crashes, memory bloat, or instability — try the npm install. You lose ~200ms startup time and auto-updates, but gain a runtime that's been stable for 15+ years. The native Bun installer is the default, but the npm package is still fully supported (v2.1.83).

Note: You'll see an "npm deprecated" banner on each launch — it's just a message, ignore it.

forurinfo · 3 months ago

It seems to happen when my connection is inconsistent. Similar happens with all these AI chats that rely on SSE with a stable connection, just most of them can recover reasonably quickly when the connection is cut sporadically; Claude Code cannot recover like that for some reason.

negatedx · 3 months ago

Still occurring as of April 2026 (Claude Code in VS Code extension, Windows 11, Opus 4.6)

Experiencing the same hangs today — "Nebulizing" stalls for 4+ minutes with minimal token output. Tasks are not complex (e.g. fetching a build log and diffing it).

Key observation confirming the SSE stall theory: pressing Esc to cancel then typing "resume" causes Claude to respond instantly — proving the model isn't actually thinking, the connection is just stuck. Same finding as @khwerhahn's Feb 24 comment.

This started happening today (April 1, 2026) after not experiencing it previously. Happening intermittently across multiple conversations.

kolkov · 3 months ago

@negatedx Yes, after the source code leak, the scale of the problem was simply a revelation...
https://dev.to/kolkov/we-reverse-engineered-12-versions-of-claude-code-then-it-leaked-its-own-source-code-pij

d4rth-v4d3r · 3 months ago

I'm also being affected, small tasks are just too slow or just hangs indefinitely. I sometimes try /btw and ask what's going on but the tool says it's about to finish but sometimes it does other it just gives me false statements

kartik1225 · 3 months ago

Can confirm after version v2.1.89 It is affecting me at reading stage. and even after say continue it gets stuck there immidiatly.

baslr · 3 months ago

#35773

GearUnclear · 3 months ago

hello

juan-abia · 3 months ago

This is happening also on enterprise environments with LiteLLM.

We are using AWS Bedrock trough LiteLLM and for some specific prompts (I can start the same conversation in different sessions with the same plan, and they all get stuck. But sessions on other repos work) it always gets stuck. LiteLLM doesn't get any request while CC is stuck.

ongmichael · 3 months ago

I have been experiencing the same exact thing for over two weeks. The worst are bash tool calls but it gets stuck on just about every turn. It's almost completely useless.

Ethan-Ka · 3 months ago

Experiencing the same issue, not just during tool calls. It output some insight and then it gets stuck. I tried to prompt it again, to no avail. ✶ Contemplating… (4m 27s · ↓ 17 tokens)

fahad-cpp · 3 months ago

This is unrelated but claude chatbot on browser also completely hangs itself and the browser , and you cant interact with the website while it is hanged when you stop the website and refresh sometimes you can get it to complete the response but i cant get to complete a response using any Opus model , i havent tried using Haiku model but i did not have this problem until recently

Morriz · 3 months ago

Yeah, it is really bad since yesterday. REALLY BAD

mesour · 3 months ago

Yes I have exact same problem since ~yesterday.

andrix98 · 3 months ago

Same here

psycoder1 · 3 months ago

For the love of whatever the hell you believe in, please fix this s***. I am extremely tired of getting stuck 10 to 30 times a day!!!

psycoder1 · 3 months ago

I am seriously considering moving to openai codex. It is a vastly inferior product, but at least it is not stalling me 2 to 3 hours everyday.

psycoder1 · 3 months ago

Check google gemini cli. Turns out I had that thanks to company I work for. My team is using gemini cli exclusively at the moment. claude code is not usable currently.

mesour · 3 months ago

2026-04-11T20:27:32.431Z [ERROR] API error (attempt 1/11): undefined Connection error.
2026-04-11T20:33:03.950Z [ERROR] API error (attempt 1/11): undefined Request was aborted.

I found more information while claude code debug. It looks like errors with connection to Anthropic API. Claude code also says:

  Title: Opus API extreme latency and 10-minute timeouts in Claude Code
                                                                                                              
  Environment:    
  - Claude Code CLI v2.1.101                                                                                  
  - Model: claude-opus-4-6 (1M context)                                                                       
  - Platform: Linux (Docker)           
  - Context size at time of issues: ~53-55K tokens (well within limits)                                       
                  
  Issue:                                                                                                      
  Since approximately 2026-04-10, the Anthropic API for Opus exhibits extreme latency and full request
  timeouts when called from Claude Code.                                                                      
                  
  Observed behavior:                                                                                          
  1. 73+ second response times for standard API calls (source=repl_main_thread) with ~53K token context
  2. Full 10-minute timeouts — request sent at 20:17:15, error at 20:27:15: [ERROR] API error (attempt 1/11): 
  undefined Request timed out.                                                                                
  3. Subagent calls (Haiku 4.5) also affected — requests hang indefinitely until user interrupts manually     
                                                                                                         
  Evidence from debug log:                                                                                    
  2026-04-11T20:17:14.985Z [DEBUG] [API REQUEST] /v1/messages                                                 
  x-client-request-id=c771184e-a92c-4d41-89c0-21aec30f04e8 source=repl_main_thread                            
  2026-04-11T20:27:15.003Z [ERROR] API error (attempt 1/11): undefined Request timed out.                     
                                                                                         
  Earlier instance (73s response):                                                                            
  2026-04-11T20:04:44.268Z [DEBUG] [API REQUEST] source=repl_main_thread                                      
  2026-04-11T20:05:57.274Z [next log entry — ~73s gap]                                                        
                                                                                                              
  What we ruled out:                                                                                          
  - Not a network issue — other websites and services have normal latency                                     
  - Not context size — 53K tokens is well within the 1M window                                                
  - Not subagent-specific — happens on both main thread (Opus) and subagents (Haiku)
  - Issue persists across multiple sessions over ~2 days
ongmichael · 3 months ago

I've switched to Codex until this issue is fixed because it's almost completely unusable. Codex is working really well. To demonstrate just how bad this problem is, here are some stats for one such request to Claude code. As you can see it took 5 hours to complete this request with only 215,000 token consumed. Stats pulled right from Claude.

✻ Brewed for 5h 3m 17s

Token Usage:

  • Input tokens: ~180,000 (reading files, fetching docs, processing context)
  • Output tokens: ~35,000 (code generation, analysis, responses)
  • Total: ~215,000 tokens

Lines of Code Written (new files):

┌─────────────────────────────────────────────┬
│ File │ Lines │
├─────────────────────────────────────────────┼
│ variable.py (backend model) │ 52 │
├─────────────────────────────────────────────┼
│ variables.py (backend API) │ 155 │
├─────────────────────────────────────────────┼
│ integration_config.py (backend API) │ 213 │
├─────────────────────────────────────────────┼
│ variable.ts (frontend types) │ 33 │
├─────────────────────────────────────────────┼
│ integration.ts (frontend types) │ 23 │
├─────────────────────────────────────────────┼
│ useVariables.ts (hook) │ 53 │
├─────────────────────────────────────────────┼
│ useIntegrationConfig.ts (hook) │ 36 │
├─────────────────────────────────────────────┼
│ variables-tab.tsx (settings UI) │ 260 │
├─────────────────────────────────────────────┼
│ integrations-tab.tsx (settings UI, rewrite) │ 200 │
├─────────────────────────────────────────────┼
│ ToolboxNode.tsx (rewrite) │ ~300 │
├─────────────────────────────────────────────┼
│ Total new/rewritten │ ~1,325 │
└─────────────────────────────────────────────┴

Lines of Code Modified (edits to existing files):

┌─────────────────────────────┬
├─────────────────────────────┼
│ AgentBuilder.types.ts │ ~30 lines changed │
├─────────────────────────────┼
│ constants.ts │ ~90 lines added │
├─────────────────────────────┼
│ AgentBuilder.tsx │ ~80 lines changed │
├─────────────────────────────┼
│ settings/page.tsx │ ~15 lines changed │
├─────────────────────────────┼
│ client.ts (API client) │ ~30 lines added │
├─────────────────────────────┼
│ app.py (route registration) │ 4 lines added │
├─────────────────────────────┼
│ models/__init__.py │ 3 lines added │
├─────────────────────────────┼
│ Total edits │ ~250 │
└─────────────────────────────┴

Lines of Code Read: ~2,500 across 25+ files (backend models, routes, runtime, builder, types,
components, settings tabs, constants, hooks, API client)

Files touched: 18 modified/created, 25+ read for context

mesour · 3 months ago

@alfredxing @alii @chloeanT @cirospaciari @domdomegg @felixrieseberg @k6l3 @lovesegfault @Mic92 @natemcmaster @palcu @tengyifei
Anthropic is incompetent - I'm paying for the highest tier and they haven't been able to respond to my support ticket for two days. Their service is unusable, which is why I cancelled my subscription. Maybe that's the only thing that gets through to them. At least I'll try out the competing tools and maybe I won't go back.

See my comments above: https://github.com/anthropics/claude-code/issues/26224#issuecomment-4230146833

emmahyde · 3 months ago

This has been happening constantly this weekend.

kartik1225 · 3 months ago

Please stop shipping new features we really don't need buddy integration or any of new things and fix your basic workflow first. I am on the MAX plan and due to this i am not even able to utilize my token at full potential.

<img width="1146" height="449" alt="Image" src="https://github.com/user-attachments/assets/987315bb-770d-4961-aa43-11fb731ed6e5" />

DaveRune · 3 months ago

Just expressing my frustration too. I've been following this issue for nearly a month, I'm REALLY looking forward to a resolution to this.
I've finally cracked, while I'm sat here waiting for Claude to move for the umpteenth time in the last 3-4 hours, have some screenshots.

<img width="241" height="93" alt="Image" src="https://github.com/user-attachments/assets/5c7325c7-e260-4ab1-8fd1-1d6769515a3f" /><img width="323" height="25" alt="Image" src="https://github.com/user-attachments/assets/51d2efad-ff90-4d85-96d0-1d9f5d5cd79d" /><img width="300" height="41" alt="Image" src="https://github.com/user-attachments/assets/ee341a81-f4e3-4f8b-ac04-c0c2620c8b82" /><img width="239" height="25" alt="Image" src="https://github.com/user-attachments/assets/208d4ff5-3685-4703-9e0a-18a75ba61f85" /><img width="355" height="29" alt="Image" src="https://github.com/user-attachments/assets/bdc9ecec-7bb8-4f52-9301-3b68484ffc2f" />

thatcherfreeman · 3 months ago

I keep running into this problem in like half of my claude code sessions this week. I'll wait like 10-20 minutes where it'll be thinking with no change in the quantity of tokens generated, and then suddenly my Claude Pro usage rate limit is hit despite me getting no response from Claude. This hurts Anthropic's bottom line because I'm sure not going to waste extra usage spending on a prompt that has a high probability to just burning credits for half an hour without responding to me. Often restarting claude code makes zero difference on this behavior.

Ethan-Ka · 3 months ago

It appears that this is caused by the research or a tool call - The output from a file is too large that it either envelops the context window or overloads the model or something on the backend to cause this buffering/error on Anthropic’s side. I combat this by instructing in the prompt that the file is too large to read in one go, and that it should look at specific lines/sections of the file for changes. This does help in my experience.

thatcherfreeman · 3 months ago

So far the workarounds that have worked for me are that I noticed that when claude is provided by a third party like Bedrock, I have never gotten the unlimited thinking glitch in claude code cli. For my conventional claude subscription, it seems that the vscode claude code sidebar plugin hasn't seemed to run into the hanging issue for me yet.

rapidmountain · 3 months ago

So far we do not need to worry about AI taking over the World, when it can't even finish its thoughts :)

DaveRune · 3 months ago

It seems an interim "solution" is to pull the wool over your eyes to try and make you think something is actually happening...

https://github.com/user-attachments/assets/1fc1d420-3c17-4034-b265-0444962179bf

*edit. 30 mins later... this is worst I've ever seen it!

... later today ...

https://github.com/user-attachments/assets/13fdaf40-0968-4ea4-b36b-2d0ffaab151c

🙄

GearUnclear · 3 months ago
It seems an interim "solution" is to pull the wool over your eyes to try and make you think something is actually happening... Rider64.Iizztbr4bz.mp4 *edit. 30 mins later... this is worst I've ever seen it! ... later today ... Rider64.Osfc56epvm.mp4 🙄

Thank you for the video evidence! very helpful

josephyeewang · 3 months ago

i had this issue and just solved it (at least for me): https://github.com/anthropics/claude-code/issues/49563#issuecomment-4263801888

iveelane-fdatracker · 3 months ago

it's been two months and this is still happening. they need to use claude to fix it.

imthejuandi · 2 months ago

In my case the problem is that opus 4.7 and 4.7 1M are not yet recognized by github remote connection (at least according to claude itself) and it keeps giving API errors because of the model, I switched to sonnet and it works smoothly again.

kivocsa99 · 2 months ago
It seems an interim "solution" is to pull the wool over your eyes to try and make you think something is actually happening... Rider64.Iizztbr4bz.mp4 *edit. 30 mins later... this is worst I've ever seen it! ... later today ... Rider64.Osfc56epvm.mp4 🙄

can confirm that this happens on opus 4.7 via bedrock on my side , reverted back to opus 4.6 and iam not facing this problem , iam not familiar with how or if subscribers also have this issue , but it should be something with bedrock and how the api handles the new adaptive thinking for opus 4.7

madal3x · 2 months ago

Adding diagnostic data from a Hetzner dedicated server that may help narrow this down.

Setup: Max 5x, OAuth login, Hetzner dedicated server (AMD Ryzen 5 3600, 12 threads, 62GB RAM, Linux)

Key finding: non-interactive is fast, interactive is slow on the same machine.

claude -p "say hello" completes in 2.3 seconds — normal speed. But interactive sessions get ~0.7 tokens/sec, with simple ls commands taking 1-2+ minutes. The commands themselves never
execute — the API response streaming is what stalls.

The same account on my local macOS machine is fast.

Network is not the issue:

┌────────────────────────┬─────────┬────────────┐
│ Endpoint │ Connect │ First byte │
├────────────────────────┼─────────┼────────────┤
│ api.anthropic.com │ 0.021s │ 0.078s │
├────────────────────────┼─────────┼────────────┤
│ claude.ai │ 0.022s │ 0.087s │
├────────────────────────┼─────────┼────────────┤
│ ping api.anthropic.com │ 20.4ms │ — │
└────────────────────────┴─────────┴────────────┘

Server resources are not the issue:

  • CPU load: 0.32 across 12 threads
  • RAM: 13GB available
  • Disk: 98.9 MB/s
  • Tested from a tiny project directory (not a large repo)

Both Opus and Sonnet are equally slow.

This aligns with findings in #46652 and #44015 where switching from Max subscription to pay-per-token API on the same machine fixes performance. The issue appears to be in the Max/OAuth
serving path, with datacenter IPs possibly being deprioritized or routed to a slower capacity pool.

The non-interactive vs interactive distinction might be a useful clue — claude -p (single request-response) is fast, while multi-turn streaming sessions are severely throttled from the
same server.

---
You can also link to the related issues by mentioning #46652, #44015, and #47754 (the Cloudflare WAF blocking OAuth from server IPs, which suggests datacenter IP detection is already
happening on this path).

DownChapel · 2 months ago

I've taken a video of my experience yesterday (been suffering with this issue for at least the last week - certainly before 4.7 came out).

In this instance, it seems to get stuck with 670 tokens used at about the 30 second mark of the video. At about 9:30 I ask it "Are you doing anything?". At about 10:30 it starts working again and then carries on with the changes.

When it's working ok it shows code changes are happening (because the changes being made scroll by).

I'm using a plain Max Subscription (not bedrock) and logged in using the "Claude account with subscription" option.

I've tried uninstalling Claude (I'm using the Native Install) as well as removing my ~/.claude directory.

https://github.com/user-attachments/assets/13082cd7-98c0-4699-b230-3ea9b0b09986

madal3x · 2 months ago

What has worked for me is to give it ssh access via a key so without a password from your local machine and execute what it needs from local, and that is nearly as fast as any other local project.

DownChapel · 2 months ago

Below is the logs from a recent session. From this, it looks like the request is just timing out after 10 minutes and then retrying.

2026-04-22T09:54:37.108Z [DEBUG] [API REQUEST] /v1/messages x-client-request-id=841d7d4a-0321-4999-8a3f-f7d9fe8b3c61 source=repl_main_thread
2026-04-22T09:55:03.119Z [DEBUG] Fast mode unavailable: Fast mode requires extra usage billing · /extra-usage to enable
2026-04-22T09:55:07.107Z [WARN] Slow first byte: no stream chunk 30.0s after request sent (attempt 1)
2026-04-22T09:56:38.891Z [DEBUG] Restarting sleep inhibitor to maintain prevention
2026-04-22T09:56:38.895Z [DEBUG] Stopped sleep inhibitor, allowing sleep
2026-04-22T09:56:38.897Z [DEBUG] Started caffeinate to prevent sleep
2026-04-22T10:00:38.892Z [DEBUG] Restarting sleep inhibitor to maintain prevention
2026-04-22T10:00:38.894Z [DEBUG] Stopped sleep inhibitor, allowing sleep
2026-04-22T10:00:38.896Z [DEBUG] Started caffeinate to prevent sleep
2026-04-22T10:04:37.120Z [ERROR] API error (attempt 1/11): undefined Request timed out.
2026-04-22T10:04:37.154Z [DEBUG] Fast mode unavailable: Fast mode requires extra usage billing · /extra-usage to enable
2026-04-22T10:04:37.746Z [DEBUG] Fast mode unavailable: Fast mode requires extra usage billing · /extra-usage to enable
2026-04-22T10:04:37.760Z [DEBUG] [API REQUEST] /v1/messages x-client-request-id=caf62ecd-cb28-4823-abfe-a9675bd1110e source=repl_main_thread

DaveRune · 2 months ago

Anyone have any findings to share on whether this could be VPN related?

<img width="688" height="41" alt="Image" src="https://github.com/user-attachments/assets/843565ad-1682-4c22-b581-4df8a0ff48b0" />

DownChapel · 2 months ago
Anyone have any findings to share on whether this could be VPN related? <img alt="Image" width="688" height="41" src="https://private-user-images.githubusercontent.com/5797291/583930050-843565ad-1682-4c22-b581-4df8a0ff48b0.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzcyNzAyMzUsIm5iZiI6MTc3NzI2OTkzNSwicGF0aCI6Ii81Nzk3MjkxLzU4MzkzMDA1MC04NDM1NjVhZC0xNjgyLTRjMjItYjU4MS00ZGY4YTBmZjQ4YjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MjdUMDYwNTM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTcwNDRiOTVhNjVkMDBjNmNjNGRlMjUzNWZkOTc3MTQ5ZWNkNGQxNjBkMTE0YTNlMzYxNWVhODExNmM0YzQxMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.801NMy03kIxz3YbH3ztWKkAyWmbdvFYH-ZAEMPb2Zhw">

I'm seeing this when I'm not on a VPN.

viddirunars91-ops · 2 months ago

This is also happening to me all the time now. This is causing real issues for my work. Do we know when this will be fixed?

meouwu-dev · 2 months ago

Sometimes it just freezes for 8 minutes, and then it starts reading files. Now, whenever it thinks for more than 10 minute, I press ESC and resubmit the same prompt. Most of the time, it freezes again, so I have to repeat this several times until, by luck, one attempt finally starts responding.

However, those canceled prompts still count toward token usage. I now use low effort for all models because at least it produces output instead of thinking forever.

This bug is extremely painful. Please fix it, or at least provide a workaround.

DaveRune · 2 months ago

I was having a good run with no hangs until just now.

<img width="314" height="134" alt="Image" src="https://github.com/user-attachments/assets/f07c43e0-dc6e-4462-a814-d44b52369929" />

I gave up waiting the first time and prompted it to continue, I still had to wait. It kicked in and completed the task in under 5 seconds after waiting a total of ~18 minutes.

I saw something like this issue was reported as a bugfix. It's not fixed :(

I wish it would not lie. "almost done thinking" just say "waiting for server" or "you're in a queue" or whatever is actually going on.
<img width="418" height="30" alt="Image" src="https://github.com/user-attachments/assets/57780e3a-9dee-4fd8-ab1b-f6407badc548" />

bio-la · 2 months ago

same issue here with new installation, deleting cached files and previous versions etc. nothing is helping.

Novaera · 2 months ago
I was having a good run with no hangs until just now. <img alt="Image" width="314" height="134" src="https://private-user-images.githubusercontent.com/5797291/585783321-f07c43e0-dc6e-4462-a814-d44b52369929.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Nzc1NjA4NzgsIm5iZiI6MTc3NzU2MDU3OCwicGF0aCI6Ii81Nzk3MjkxLzU4NTc4MzMyMS1mMDdjNDNlMC1kYzZlLTQ0NjItYTgxNC1kNDRiNTIzNjk5MjkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MzBUMTQ0OTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Nzk0NGMyNWY5ZmEzZWRhOGYyYjQ0OWZlM2ZmODQxZTcwOGVkMjk3MjFmZDczMzMyNWNmMDEzNzNlZmViNWZlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.B36OTw-oaEpaNuY8OTJ5EA7-oJ7P5aLDMvbkGohipPg"> I gave up waiting the first time and prompted it to continue, I still had to wait. It kicked in and completed the task in under 5 seconds after waiting a total of ~18 minutes. I saw something like this issue was reported as a bugfix. It's not fixed :( I wish it would not lie. "almost done thinking" just say "waiting for server" or "you're in a queue" or whatever is actually going on. <img alt="Image" width="418" height="30" src="https://private-user-images.githubusercontent.com/5797291/586025595-57780e3a-9dee-4fd8-ab1b-f6407badc548.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Nzc1NjA4NzgsIm5iZiI6MTc3NzU2MDU3OCwicGF0aCI6Ii81Nzk3MjkxLzU4NjAyNTU5NS01Nzc4MGUzYS05ZGVlLTRmZDgtYWIxYi1mNjQwN2JhZGM1NDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MzBUMTQ0OTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTJiOGI3YzNiZTFhM2YxYjk0MDFkN2I5NTA1MmQzNWZhNzJlNGM2ODUxNTkxYzU1NWQxYzViMDI4YjFiNTk1NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.fUMffbbvZ1VRgaUr7FTcgwOISfRF0PJuxlj-hm345QI">

After losing a lot of time debugging on Dev Mode, downgrading the npm package @anthropic-ai/claude-code, etc., the solution was simply restarting the OS and boom, my Claude Code was back to life.

poof86 · 2 months ago

Rebooting doesn't help for me. To me it seems to be a queue you are placed in when a certain amount of tokens are used for thinking. It always stalls when a round number of tokens are used 10.0k etc

jrhip · 2 months ago

Same issue here, using Sonnet 4.5 with claude --model claude-sonnet-4-5-20250929 does not exhibit this problem.
It seems to be connected with "thinking".

I haven't manage to demonstrate this reliably yet, but it might be connected with having large files of readable numeric or non-code data in the working directory.

LuisSpader · 2 months ago

Same issue here for at least 1 month. I'm just considering using Codex and cancel my Claude subscription since this is simply unusable!

linanwx · 2 months ago

I think the only way to solve this problem is to unsubscribe from Claude and try other AI software.

thatcherfreeman · 2 months ago

I haven't run into the issue since I switched to the vscode Claude code sidebar extension. It's nice too because you can expand the thinking and see all the tokens generated in real time, so then you know if it's frozen or not. In the terminal version of Claude code, you really can't tell if it's frozen when it's been thinking for a while.

DaveRune · 2 months ago

Something that might shed some more light on this.

I've just been planning a task, I've sent 5 messages discussing the implementation with no delays.
As soon as it came time to write code....
It took 7 minutes and 11 seconds to start using tokens
<img width="615" height="42" alt="Image" src="https://github.com/user-attachments/assets/41466756-f391-40f3-a2c7-86c1d3d3d5fc" />

Wait... now I'm just stunned!
It took 30.6k tokens to read one 24 line file!?
<img width="669" height="203" alt="Image" src="https://github.com/user-attachments/assets/4aff39df-bf59-46f9-b261-1e056e374307" />
Then 50k for two files before it starts writing code!? IconManifest is 14 lines! WTF!?
<img width="598" height="205" alt="Image" src="https://github.com/user-attachments/assets/bf7b70ac-d3ae-476a-b0b0-1a676b8e9b15" />
This was not a complicated task. It just blew roughly 25% of a session on this.

  • edit - Apparently it did lots of thinking and my new coding standards document caused it to think a lot.

Any update from Anthropic on this delay issue?

yegor256 · 2 months ago

To trouble shoot this issue, try to run this simple command in command line:

curl https://downloads.claude.ai/claude-code-releases/latest

In my case it didn't work because of the HTTPS_PROXY environment variable with a wrong value.

ShellyShaylo1 · 1 month ago

SAME ISSUE HERE:

Environment:

  • Claude Code 2.1.150 (latest)
  • macOS 26.3.0, Mac Mini M1
  • Local connection (not remote) — rules out network
  • Fresh sessions, minimal context — rules out context pressure
  • Happens on plain text responses, not just tool calls

Behavior:
Responses stall mid-stream indefinitely. Interrupting (Ctrl+C) and sending any message — even a single word — causes an
immediate response at normal speed. This is 100% reproducible and has been ongoing for several weeks.

What's been ruled out: network, Mac Mini load, context size, Claude Code version.

The interrupt-and-resend workaround confirms this is a stream stall, not slow inference.

alex-shvetsov · 1 month ago

In my case a constantly restarting Spring app was causing it. Claude Code stream stalls for minutes when a Docker container is restart-looping on the host

Environment:
Claude Code 2.1.150 (opus 4.7) on Linux (7.0.3-arch1-2). VLESS-Reality. Project uses Docker Compose with a bridge network. RAM 7 Gb available during repro.

Behavior:
Claude starts streaming a response, emits some tokens, then the stream stalls for several minutes. TCP stays open, no errors logged. Curl requests to api.anthropic.com from the same host stay fast throughout. Stops the moment the looping container is killed.

Claude's explanation:

_A container with restart: always was crashing every ~10 s. Each recreation rewrites iptables/nftables rules and briefly holds the kernel-wide netfilter write lock — stalling all packets, including those on the tunnel interface. Short requests don't notice (single RTT), but a long-lived SSE stream does: VLESS-Reality multiplexes all flows over one TCP connection, so a single retransmit on the tunnel TCP stream blocks every in-flight HTTP stream inside it (TCP head-of-line blocking). The next restart-burst hits before recovery, so the Claude stream stays starved._

phpmac · 1 month ago

+1, still experiencing this on the latest version (macOS, fish shell).

In addition to the general hanging described here, I also hit issue #60194 with 100% reproduction rate - Ctrl+O during a pending permission prompt causes the session to hang every single time.

But even without Ctrl+O, tool calls (Edit, Bash, Write) sometimes just hang with no response. The spinner keeps going but nothing happens. No error, no output. Have to Esc and retry.

This is happening frequently enough that it significantly impacts daily workflow. Would really appreciate a fix.

Neige-Neige · 1 month ago

Adding a data point — same SSE/streaming stall, but on Opus 4.8 and even at low effort, which the existing reports (mostly 4.6/4.7) don't cover.

Environment

  • Claude Code 2.1.156 (latest at time of writing), global install
  • Windows 11 Pro (26200)
  • Model: claude-opus-4-8
  • Anthropic API (Pro/Max account)

Symptoms

  • Reproduces on a brand-new session with a trivial prompt (literally test).
  • Stream emits a few hundred tokens (~900) then goes idle; status line sits at Thinking… / still thinking with low effort for 1–5+ minutes. Token count stops increasing during the hang — consistent with the client waiting on SSE events described here.
  • Sometimes ends as a malformed/truncated tool call: The model's tool call could not be parsed (retry also failed).
  • It does eventually complete if left alone (matches the 5–20 min self-recovery others report).

New data points beyond existing reports

  • Happens on Opus 4.8, not just 4.6/4.7.
  • Happens with /effort low — lowering effort does not avoid it.
  • Happens with 1M context disabled (plain 200k) as well as with [1m] — so it's not specific to the 1M tier (cf. #59092).

Ruled out locally

  • RAM: ~6 GB free of 16 GB. CPU idle.
  • Network: 8–11 ms ping to api.anthropic.com.
  • CLI is on the latest published version.
  • Same account + same MCP connectors run fine on Opus 4.6 on macOS — switching this Windows machine to Opus 4.6 also restores normal speed. The variable is the Opus 4.8 / high-thinking path, not the machine, network, or config.
astinov · 1 month ago

Bug is still here with Opus 4.8. This is getting to the point where it seriously hinders the product. Anthropic, take notice and treat this with the proper urgency

astinov · 1 month ago

If this is some "hidden" throttling of Max subscription users to force them into going the API token route, that would be very disapointing behavior on Anthropic side

gabriel-ing · 1 month ago

Same bug, sonnet-4.5 on windows.

<img width="671" height="421" alt="Image" src="https://github.com/user-attachments/assets/e00f23ca-bb75-4156-a6c6-dac6764995e7" />

Where the transcript shows "thought for 4s", this was 4 seconds of token usage increasing and output being seen in ctrl+o , followed by several minutes of nothing happening at all.

M4CC · 1 month ago

Since a few days now I have constant stalling on my side too. Tried to reload windows and doesn't seem to help, I need to restart VSC, it seems to work for a few prompts and then goes back to stalling. It's quite disruptive.

andresilvafss · 1 month ago

Confirming this on macOS with the VS Code extension, on the latest version (2.1.162) — still present in the newest build. Same signature: SSE hang, token counter never advances, intermittent, and the UI never recovers (Stop fails).

Environment: macOS (Darwin 23.6.0); extension builds seen failing: 2.1.159 and 2.1.162 (darwin-x64); CLAUDE_CODE_EFFORT_LEVEL=max, model claude-opus-4-8, permission defaultMode=auto; no MCP servers; no streaming hooks.

Extension log signature when it hangs:

  • Error in API request: Request was aborted.
  • Failed to interrupt Claude: Query closed before response received (~16x per single Stop press)
  • Slow first byte: no stream chunk 30.0s after request sent (31x in one session)
  • [Stall] stream_idle_partial lastChunkAgeMs=15002 bytesTotal=0 idleDeadlineMs=300000
  • Streaming stall detected: 62.5s … 84.2s gap between events

Ruled out locally with measurements: network (0% packet loss; api.anthropic.com first byte ~215–268ms; sustained 60MB download stable at ~9.5MB/s); no VPN/proxy/AV; not conversation size (failing turns were short, no subagents); no MCP; no auto-compaction in one of the episodes.

The abort doesn't seem to be surfaced to the UI, which keeps showing "Thinking" forever while Stop fails with "Query closed before response received" — the query is already dead while the UI still thinks it's streaming. Client request IDs for the aborted /v1/messages calls are available if useful.

LukeSheppardSD · 1 month ago
Same bug, sonnet-4.5 on windows. <img alt="Image" width="671" height="421" src="https://private-user-images.githubusercontent.com/58074671/600908865-e00f23ca-bb75-4156-a6c6-dac6764995e7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA3NjI4NjYsIm5iZiI6MTc4MDc2MjU2NiwicGF0aCI6Ii81ODA3NDY3MS82MDA5MDg4NjUtZTAwZjIzY2EtYmI3NS00MTU2LWE2YzYtZGFjNjc2NDk5NWU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjA2VDE2MTYwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiMDBiZjEyODhiYTdkZjZiM2MzNmM2MTJiYjlkZjQwNzY2ZDYxMjYzMDYxYzI3NDdlMGIzM2JiOTUzZGJlMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.ShS3q9YIOhwI7EtAqcIkmNf-XQuxOqby6LWQTV9qBCY"> Where the transcript shows "thought for 4s", this was 4 seconds of token usage increasing and output being seen in ctrl+o , followed by several minutes of nothing happening at all.

Still getting this too, been getting it for months. So frustrating having to kill the task and type "continue" over and over.

JohnnyTheCoder1 · 1 month ago

I have a similar issue on my end.
I have an i 9 14900 kf, 64GB of ddr5 6000 mhz ram, os this is not a bottleneck on my end. I type Hello claude, it will just sit there, the timer increases but no thinking message, or nothing shows for several minutes, then suddently it thinks and it hsows output. I have also observed this behaviour: Pollinating… (8m 11s · ↓ 31.1k tokens) and it has been stuck like this for 6 minutes.

EDIT: I am also experiencing this weird issue, it just hangs like this ✶ Whirring… (1m 46s) I have no idea on how to fix it. I have tried ctrl+c and saying continue, or just typing a message and deleting it, but nothing seems to solve this weird bug. I have completly reinstalled Claude Code, but it didn't resolve it.

Guiny-Time · 1 month ago

Same here. The task just stuck after running two mcp method. I waited for 10 min but nothing happened🤔.

noxx · 1 month ago

Same for me on wsl, dont know what to do

andrecasal · 1 month ago

It's been happening to me all week. It works well without tool calls (just chatting), but tool calls make it terminate prematurely.

claude
╭─── Claude Code v2.1.173 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                    │ Tips for getting started                                                                                  │
│                 Welcome back André!                │ Run /init to create a CLAUDE.md file with instructions for Claude                                         │
│                                                    │ ───────────────────────────────────────────────────────────────────────────────────────────────────────── │
│                      ▗ ▗   ▖ ▖                     │ What's new                                                                                                │
│                                                    │ Fixed Fable 5 model names with a `[1m]` suffix not being normalized — Fable 5 includes 1M context by def… │
│                        ▘▘ ▝▝                       │ Fixed a spurious "sandbox dependencies missing" startup warning on Windows when sandbox was enabled in s… │
│   Opus 4.8 (1M context) with hi… · Claude Max ·    │ Sub-agents can now spawn their own sub-agents (up to 5 levels deep)                                       │
│   andre@andrecasal.com's Organization              │ /release-notes for more                                                                                   │
│       ~/…/Projeto de Engenharia Informática        │                                                                                                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 ▎ Meet Fable 5, our newest model for complex, long-running work. Try anytime with /model.
 ▎ Included in your plan limits until Jun 22, then switch to usage credits to continue.

❯ you are a senior designer. Your mission is to make it obvious that the slider represents 1h of time.                                                            
  ⎿  Async hook SessionStart completed

⏺ I'll start by exploring the codebase to find the slider in question.                                                                                  

  ---
  Let me first understand the project structure and locate the slider.
  
  ★ Insight ─────────────────────────────────────
  Before designing, I need to find the slider component and understand what data it controls. The recent commits mention a "datetime picker to jump to any past
  hour" and "scrubbing" — so this slider likely scrubs through time within an hour.
  ─────────────────────────────────────────────────

  ---
  Let me explore the project.                                                                                                                         

✻ Sautéed for 6s

❯ go ahead and explore                                                                                                                                            

⏺ ★ Insight ─────────────────────────────────────
  I'll explore the repo to find the slider, understand what it scrubs through, and see the current UI before proposing design changes.
  ─────────────────────────────────────────────────

  I'll look at the project structure and find the slider.

  (Exploring — let me run the searches.)

✻ Brewed for 3s
dyspop · 1 month ago

Tool calls (shell script) burned my tokens and left me with nada

TJ11000 · 1 month ago

Until this is fixed upstream, here's a drop-in CLAUDE.md workaround that contains the
damage instead of trying to prevent it. It won't stop the stall / leak / fabrication —
nothing user-side can — but it turns "model barrels ahead on corrupted context" into
"model stops and flags it," which is the failure mode you actually want.

The idea: a non-coercive instruction telling the model that, when an expected tool
result or user turn is missing, it should emit a rare sentinel token of your choosing
and stop, instead of guessing. It passes normal retries through, doesn't pressure the
model (pressure plausibly contributes to the fabrication), and is a single block you
delete when the bug is fixed.

It catches the model at its response boundary, so it won't stop an action already
mid-flight, a silent hang, or plain hallucination — the full list of gaps, plus the
exact snippet, is in the writeup: https://gist.github.com/TJ11000/85cf292f65697921b8b2f607c81844a2

Not a fix — just a seatbelt.

kristapszs · 28 days ago

Last days claude code is unusable. I got stuck almost on every request and chat. When it works, it works very long on simple tasks. currently stuck in "starting session" for the last 20 minutes.

TJ11000 · 28 days ago

Follow-up to the seatbelt CLAUDE.md workaround I posted earlier — same "can't fix it upstream, so make it cheaper to deal with" idea, but from the other end.

Where the seatbelt tries to contain the stall while it's happening, this is a tiny after-the-fact detector: a dependency-free Python script that scans your Claude Code .jsonl transcripts and prints where the stall fingerprints show up — dead-air gaps (model went quiet on its own, no user input in between), near-empty "phantom" turns after a gap, and the could not be parsed retry markers.

It won't catch silent death or plain hallucination, and a long gap can be a healthy slow turn — so it's a tripwire, not proof. It just makes "did this session actually stall, and where?" a one-command question instead of scrolling. Limits are spelled out in the README.

Free, CC BY, no install beyond python3 stall_scan.py your.jsonl: https://github.com/TJ11000/claude-stall-tools

Detector + seatbelt = measure it / contain it. Still not a fix — just better instruments.

TJ11000 · 27 days ago

A follow-up on the handling side, in case it's useful to others in this thread.

After a stall, the natural next step is to ask a fresh agent to "continue from where it stopped." I kept finding that reading the stalled transcript to pick up context could wreck the agent that read it — the corruption sits at the end of the transcript (often as a confident "your actual question was X" that isn't what was asked), so reading backward toward it adopts it as truth.

What worked for me: don't read the wreck in the main agent; delegate; read forward (oldest→newest) so the genuine user turns anchor first; and cross-check a backward "find the spot" pass against a forward "judge it" pass — they fail in opposite directions, so agreement is a signal.

Wrote it up (method only, no script this time, honest limits section): https://github.com/TJ11000/claude-stall-toolsSAFE_READING.md.

Companion to the stall_scan.py detector in the same repo. Not a fix — just a way to handle the wreckage without spreading it. Defensive handling only.

TJ11000 · 27 days ago

Another handling-side note, in case it's useful here.

Separate from the stall itself, there's a quieter failure I kept hitting in long, otherwise-healthy sessions: the model floats a guess (a number, a name), states it flatly, and a few turns later — when asked to back it up — it defends the guess by inventing a source rather than walking it back. One soft guess snowballs into fabricated support, and every individual turn still reads as confident.

What helped me: have the model wrap unverified values in brackets with a "guess, no source" label, e.g. [~30% — unverified]. A flat number is a stake the model keeps defending; a bracketed one is already flagged as not-load-bearing, so a later turn has a clean lever to retract instead of fabricating.

Wrote it up (convention + a CLAUDE.md snippet, honest limits — it's a hypothesis, not a measured fix): https://github.com/TJ11000/claude-stall-toolsBRACKET_VALVE.md.

Companion to the seatbelt snippet in the same repo. Not a fix — like a vaccine, it won't prevent fabrication, it may reduce how bad it gets. Defensive use only.

TJ11000 · 27 days ago

Added another small companion to the repo — PRESSURE_LAYERING.md.

Same family as the seatbelt and the bracket valve, but a step back: it's about where you put the hard rules in your instructions. Short version — keep the always-loaded base low-pressure (norms the model already knows, stated as understood, not commands it's ordered to obey at every step) and push strict, checkable constraints down to the per-task layer that can actually enforce them.

In a small, informal run on a single non-Claude (fabrication-prone) model, a heavy command-and-prohibition framing was what drove fabricated sources — and the bracket convention only held on top of a low-pressure base. Under a heavy-handed setup the bracket peeled off on the follow-up turn and gave false safety.

Not a fix and not proof — a convention with a small, single-model observation behind it; the limits (incl. not reproduced on a frontier model) are in the file. Sharing in case the framing helps anyone fighting the same fabrication-under-pressure pattern.

https://github.com/TJ11000/claude-stall-tools/blob/main/PRESSURE_LAYERING.md

(Not an engineer — I just tinker with my bikes. Got here by feel from using the thing, and the research turned out to be standing nearby.)

jas0xf · 26 days ago

I chased one flavor of this "stuck on thinking" freeze with decrypted packet captures, and on my connection it traced to the IPv6 path to Anthropic, not Claude. On a hung turn the request uploads fine, the server sends HTTP 200 + message_start, then 0 bytes come back until the client times out. Same machine and account, large (>100 KB) requests: over IPv6 no response 15 of 28 (54%); over IPv4, 0 of 20. Forcing traffic onto IPv4 makes it go away.

I can't see past the TLS endpoint, so I can't say whether it's Anthropic, Cloudflare, or my ISP — and this only covers the network-path version of the freeze (if your IPv6 is clean, it's something else).

I packaged the fix into a small CLI I wrote: claude-unstuck (MIT). claude-unstuck doctor runs a couple of real turns over each path and prints your numbers without changing anything; sudo claude-unstuck on forces IPv4 and is reversible. Happy to share raw captures if useful.

pernakor · 16 days ago

Deterministic repro for the "stuck generating / queued-but-never-sent" cluster: laptop sleep + network change → the agent session never recovers (isRunning stays held, hadFirstResponse=false)

TL;DR — Close the lid, move to a different network, reopen, let the session resume/compact → the turn spins forever, then the timer/spinner vanish and the turn dies producing no output and no error. After that, the input field only queues messages; nothing is ever dispatched until a full app restart. The renderer stays responsive at ~0 % CPU, so this is a state desync, not a crash or busy-loop. Reproduced 3×, with the app's own logs naming the failure.

Environment

OS: Windows 11 (ARM64 / Snapdragon)
Claude Desktop: MSIX 1.15962.1.0 (arm64), local agent mode (Cowork)
Regression: rock-solid on 1.15200.0; began immediately after the silent auto-update to 1.15962.x on 2026‑06‑28.
Deterministic reproduction

Have an active agent-mode conversation.
Sleep the laptop (close the lid).
Move to a different network and wake / log back in.
Resume the conversation (or let the on-resume auto-compaction fire).
→ spinner runs with no streamed tokens → timer & spinner disappear → no response, no error → every subsequent message only queues. Restart required to recover.
Root cause — straight from the app's own main.log (one occurrence, timestamps unedited):

09:39:50 [error] [sessions-bridge] Poll error, backing off: net::ERR_INTERNET_DISCONNECTED
09:40:25 [info] Interrupting session local_<id>
09:40:25 [info] [LocalSessionManager] drained 1 deferred send(s) for local_<id>
09:40:25 [info] [LocalSessionManager] isRunning held by unechoed input at result for local_<id>
09:50:03 [info] [LocalSessionManager] isRunning held by unechoed input at result for local_<id>
09:52:06 [info] [CCD CycleHealth] healthy cycle for local_<id> (123s, hadFirstResponse=false)
09:52:06 [info] [LocalSessionManager] isRunning held by unechoed input at result for local_<id>
What these three signatures mean, in order:

net::ERR_INTERNET_DISCONNECTED — the network transition kills the bridge connection. The bridge only "backs off"; it never recovers the in-flight query.
hadFirstResponse=false — the query cycle completes having never received the first streamed response. (This is the user-visible "spinner then nothing.")
isRunning held by unechoed input at result — and this is the actual bug: isRunning is never cleared, even after connectivity returns. The session is permanently pinned to isRunning = true, so the UI shows an eternal spinner and the send pipeline can only queue new input. Note drained deferred send(s) runs — but the flag is immediately re-held, so the queue never actually dispatches.
Why this is high-impact

It silently destroys the in-progress turn (no error surfaced) and forces a full restart.
The trigger — close the lid / change Wi‑Fi — is something virtually every laptop user does daily, so the blast radius is large.
This looks like the root cause, with a deterministic repro, for a cluster of reports that were previously closed as not planned / cannot reproduce specifically because they had no trigger: #11106, #66310, #57497, #61718, and the SSE‑hang #26224. The missing ingredient in all of them is network change during sleep/resume.
Suggested fixes

On a lost stream / network transition, reset isRunning instead of leaving it "held by unechoed input."
Re-establish the stream and drain the send queue once connectivity returns (the drained deferred send(s) path already exists — it just runs while the flag is still pinned).
Surface the dead connection in the UI (a "connection lost / reconnecting" state + retry) rather than an infinite silent spinner with a vanishing timer.
Make Stop/Esc reliably clear isRunning so users can recover without a full restart.
I can share full main.log / claude.ai-web.log and exact timestamps from all three occurrences on request.

dojkasd0009 · 16 days ago

Workaround that fixed it for me most times: turn on a vpn connection, hit esc in claude code, send the message again and he is back working on things. I don't know why this works. Maybe he's using another API route.