claude-code - 💡(How to fix) Fix [BUG] Claude Code stream dies after first chunk — constant silent stalls, extensive diagnostics attached [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46745Fetched 2026-04-12 13:34:10
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

Code Example

47:44.486Z  Stream started - received first chunk
47:44.488Z  Fast mode unavailable...
48:10.466Z  Fast mode unavailable...   <- 26 second gap
48:44.518Z  Fast mode unavailable...   <- 30 second gap
49:14.499Z  Fast mode unavailable...   <- 30 second gap
50:14.516Z  Fast mode unavailable...   <- 60 second gap

---

curl -s -o NUL -w "%{time_total}" https://api.anthropic.com/v1/messages -X POST \
  -H "content-type: application/json" -H "x-api-key: test" \
  -d "{\"model\":\"claude-sonnet-4-20250514\",\"max_tokens\":1,\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}"
0.104056

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report
  • I am using the latest version of Claude Code

Environment

  • Platform: Anthropic API (native installer)
  • Claude CLI version: 2.1.101
  • OS: Windows 11 Pro 25H2 (Build 26200.8037)
  • Shell: PowerShell / Git Bash
  • Hardware: Ryzen 9 9950X3D, RTX 5090, Realtek PCIe 5GbE
  • ISP: Google Fiber 5Gbps
  • Plan: Max 20x
  • Node.js: v24.11.1

What's Wrong?

Claude Code silently stalls during model responses. Every session, multiple times per session, for months. Recently became significantly worse — stalls that used to resolve in 20-40 minutes now never resolve.

Symptom pattern:

  • Timer keeps ticking, spinner keeps spinning, UI is responsive (not frozen)
  • Token counter jumps to ~193-264 tokens then freezes permanently
  • Interrupting and retrying the same prompt stalls again immediately
  • Not tied to specific prompts — happens on both trivial and complex tasks
  • Happens roughly 1 in 3 queries across all established projects
  • Brand new empty projects work fine; projects with existing large source files trigger it
  • /learn skill (reads docs, lists files) works fine; follow-up tasks that read and analyze large code files stall

Debug log evidence:

Running with --debug shows the stream receives its first chunk, then goes silent with exponentially growing gaps:

47:44.486Z  Stream started - received first chunk
47:44.488Z  Fast mode unavailable...
48:10.466Z  Fast mode unavailable...   <- 26 second gap
48:44.518Z  Fast mode unavailable...   <- 30 second gap
49:14.499Z  Fast mode unavailable...   <- 30 second gap
50:14.516Z  Fast mode unavailable...   <- 60 second gap

Key finding — curl proves network is fine:

curl -s -o NUL -w "%{time_total}" https://api.anthropic.com/v1/messages -X POST \
  -H "content-type: application/json" -H "x-api-key: test" \
  -d "{\"model\":\"claude-sonnet-4-20250514\",\"max_tokens\":1,\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}"
0.104056

The API responds in 0.1 seconds from this machine. The problem is inside Claude Code's HTTP client/stream handling, not the network.

Exhaustive elimination list:

NETWORK:

  • curl to the API returns in 0.1 seconds
  • Stalls on ethernet (Google Fiber 5Gbps) AND phone hotspot (completely different network path, different ISP, different adapter)
  • IPv6 disabled on adapter — still stalls
  • TCP global parameters all normal (Auto-Tuning normal, ECN disabled, standard RTO)
  • No third-party network filter drivers installed on adapter
  • DNS resolves correctly for both A and AAAA records

ACCOUNT:

  • Same account (same org, same Max 20x plan) works fine on a friend's machine in the same city
  • Not rate limited — 30% weekly usage, 28% of 5hr usage at time of testing

CLAUDE CODE BINARY:

  • Native installer binary — stalls
  • npx @anthropic-ai/claude-code@latest (runs through system Node, not bundled runtime) — stalls
  • Node.js v22 — stalls
  • Node.js v24 — stalls

WINDOWS ENVIRONMENT:

  • Windows Defender real-time protection fully disabled — still stalls
  • Mullvad VPN fully uninstalled, no leftover WinTUN adapters — still stalls
  • Clean CC install (deleted entire ~/.claude, reinstalled) — still stalls
  • No hooks configured — still stalls
  • No MCP servers — still stalls
  • No plugins with hooks — still stalls
  • NODE_OPTIONS="--dns-result-order=ipv4first" — still stalls (also confirmed connections were still IPv6; env var may not affect native binary)
  • WSL2 Ubuntu — still stalls (expected since WSL2 NATs through Windows network stack)
  • Copied project to new folder without .claude/ directory — still stalls
  • CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING removed — still stalls
  • Effort level low — still stalls
  • Different models (Opus 4.6, Sonnet) — both stall

What works:

  • Brand new projects with no existing source files (CC generating code from scratch works fine)
  • Trivial prompts ("write a haiku about cats") work fine
  • /learn skill that reads documentation and lists files works fine
  • The exact same account on a different Windows machine works fine

Hypothesis:

Something in Claude Code's HTTP/2 streaming client breaks specifically when processing large-context requests (e.g. 64KB+ source files with extended thinking). The stream receives an initial burst of tokens (~200), then goes dead. The connection stays alive but no data arrives. The issue is machine-specific but not network-specific, not account-specific, and not tied to the native binary vs npm runtime.

Related: #26224 — same symptom pattern but this case is far more severe (constant, not intermittent) and includes extensive diagnostic elimination.

What Should Happen?

Tokens should stream continuously without multi-minute stalls. The stream should not die after the first chunk.

Error Messages/Logs

Steps to Reproduce

  1. Launch Claude Code on a project with existing source files (e.g. a 64KB Python file)
  2. Run /learn or similar documentation-reading skill (works fine)
  3. Send a follow-up prompt that requires reading and analyzing the large source file
  4. Token counter reaches ~200 tokens then freezes permanently
  5. UI remains responsive (timer ticking, spinner spinning, can type)
  6. Stream never resumes (previously would resume after 20-40 minutes, now never resumes)

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.101

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

extent analysis

TL;DR

The issue is likely related to Claude Code's HTTP/2 streaming client handling large-context requests, and a potential workaround could be to adjust the request size or implement a retry mechanism.

Guidance

  1. Verify the request size: Check if the request size is exceeding a certain threshold, causing the stream to stall. Consider adjusting the request size or splitting large requests into smaller chunks.
  2. Implement a retry mechanism: Introduce a retry mechanism to handle stalled streams, allowing the client to retry the request after a certain timeout period.
  3. Investigate HTTP/2 client settings: Review the HTTP/2 client settings in Claude Code to ensure they are optimized for handling large-context requests.
  4. Test with smaller source files: Test the application with smaller source files to determine if the issue is specific to large files.
  5. Compare with previous working versions: Compare the current version of Claude Code with previous working versions to identify potential changes that may have introduced the issue.

Notes

The issue seems to be machine-specific, but not network-specific or account-specific. The fact that brand new projects with no existing source files work fine suggests that the issue may be related to the handling of large source files.

Recommendation

Apply a workaround, such as adjusting the request size or implementing a retry mechanism, as the root cause of the issue is unclear and may require further investigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING