ECONNRESET: socket hang up — page 2
The peer tore the TCP connection down mid-request.
229 issues · 70 open · 159 resolved (69%) · first seen May 14, 2025
First response · network
What to do now
Most likely: A DNS, proxy, TLS or socket layer interrupted the connection.
- Check whether the same request works without the current VPN or corporate proxy.
- Verify DNS and certificate trust without disabling TLS verification.
- Capture the hostname and exact socket code before escalating.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is still growing. 102 new reports in the last 90 days vs 78 in the 90 before — +31%. The open backlog peaked at 70 in 2026-08 and sits at 70 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
157 of these reports name the Claude Code build they were running, spanning 94 releases. Heaviest reporters:
- Claude Code v2.1.220
- Claude Code v2.1.222
- Claude Code v2.1.226
- Claude Code v2.1.234
- Claude Code v2.1.227
- Claude Code v2.1.177
- Claude Code v2.1.39
- Claude Code v2.1.218
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 29 days across 159 closures. Of the 159 closures with a recorded reason, 21% were closed as completed and 126 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
50 of these issues post a workaround someone says worked. The highest-engagement ones:
- Persistent ECONNRESET Errors on macOS Network Connections
- …n Bun. That's the same reason it "just works" through Warp. Workaround (Linux/macOS) Add to or : For a more reliable OS-level fix, build an LD PRELOAD shim that forces on every TCP socket: Also lower the TCP keepalive pr…
Found in the thread of #5674 · still open - [BUG] Bedrock Bearer Token (ABSK) authentication broken in v2.1.94
- …inary with identical environment variables works correctly. Workaround Pin to v2.1.92: shell AWS BEARER TOKEN BEDROCK CLAUDE CODE USE BEDROCK=1 AWS REGION claude /home/.../.local/share/claude/versions/2.1.92 -p "hello"`…
Found in the description of #44929 · resolved - [Bug] Anthropic API Error: ECONNRESET with exhausted retries in Claude desktop app
- …ries in the same file quote their paths and are unaffected. Workaround: quote the path in the hook command, or use forward slashes. Windows hook paths arguably should be quoted by the client.</p <h2 dir="ltr" class="mt-3…
Found in the description of #83994 · still open - [BUG] Intermittent ECONNRESET on both desktop app and standalone CLI, no VPN/proxy
- …ards kept working, so Private Relay was the sole cause. Two workarounds — either one is enough 1. Global: System Settings → Apple ID → iCloud → iCloud+ Features → Private Relay → off. 2. Per network (preferred): leave Pr…
Found in the thread of #87424 · still open - [BUG] ECONNRESET issues
- …fall-back to HTTP/1.1 viable? 3. A (or equivalent) env-var workaround so users on networks where Bun-h2 misbehaves can keep working while a fix lands. 4. A flag that turns on Bun fetch's (the error message itself recomm…
Found in the thread of #28557 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 101–200
Ranked by community engagement (reactions weighted over comments).
- [BUG] /compact hangs indefinitely with no error in desktop local-agent (multi-session) mode — process alive, transcript frozen, UI counter climbs forever
- [BUG] ECONNRESET on home Wi-Fi — curl succeeds at exact same moment Claude Code fails
- 1M-context session becomes unrecoverable: ECONNRESET on large uncached requests, and /compact fails with the same error
- Intermittent ECONNRESET / Connection error on /v1/messages — auth OK, transport-level reset, 3 macOS machines
- [BUG] Claude Code connection error on macOS (Max Plan) - Linux works fine on same IP
- [BUG] -ECONNRESET
- [BUG] Severe latency on Sonnet 4.6 in VS Code extension despite green status page (Jun 6, 2026)
- Intermittent `socket connection was closed unexpectedly` (ECONNRESET) on startup — ~40-70% failure rate across parallel startup fetches
- [BUG] ECONNRESET / "Unable to connect to API" — Claude Code client fails while curl, Node, and the network all succeed (Windows native v2.1.150 + desktop app)
- Mid-stream ECONNRESET on /v1/messages is fatal; SSE side-channel auto-reconnects, main stream does not
- [BUG] Persistent ECONNRESET + 500 errors on all tasks — Max plan, macOS, 4 days
- [BUG] ECONNRESET on long-lived requests after upgrade to 2.1.139 — downgrade to 2.1.138 fixes it
- [BUG] Cowork ECONNRESET on Windows 10 Pro - Chat works fine
- ⎿ API Error: Unable to connect to API...
- [Bug] Anthropic API Error: ECONNRESET - Connection Reset During Session
- [Bug] Claude Code not following user commands, generating unintended code
- [BUG] ECONNRESET on streaming connections - Claude Code 2.1.107 (macOS arm64)
- [Bug] Claude Code CLI responses extremely slow (2+ minutes latency)
- [FEATURE] Feature Request: SSE keep-alive / heartbeat during tool execution
- [BUG] Cowork (Windows): Screenshot/image uploads fail silently — regression since ~March 30, 2026
- [BUG] [2.1.92] Persistent "Connection error" on flaky networks; all MCP servers disconnect simultaneously; 2.1.85 works fine
- Telegram plugin: SNI-based DPI on institutional networks silently blocks all bot traffic — diagnostic and workaround
- Telegram plugin: polling exits permanently on network errors during long sessions
- [BUG] ECONNRESET on every API call — macOS 26.3.1 Tahoe, Intel x86_64
- Claude Desktop slow startup — eager loading of all conversations + stale worktree validation
- Telegram plugin (0.0.1) crashes on network interruption
- [BUG] No TLS configuration escape hatch — Bun runtime ignores NODE_OPTIONS, corporate firewalls block connections
- [BUG] OTEL telemetry ECONNRESET propagates to main event loop, making CLI unusable
- [BUG] API Error: Unable to connect to API (ECONNRESET)
- [BUG] - Intermittent ECONNRESET / "undefined Connection error" in VS Code extension
- [BUG] API Error: Unable to connect to API (ECONNRESET)
- [BUG] Cowork Windows - ICS-type HNS network creates ghost NAT that doesn't route and blocks WinNAT
- [BUG] Cowork ECONNRESET on macOS (Mac Mini M4) — VM boots fine, API never responds through MITM proxy
- [BUG] Cowork Windows - API Error: Unable to connect to API (ECONNRESET)
- [BUG] Cowork - Unable to connect to Claude API on Windows (ECONNRESET / Request timed out)
- [Desktop] VM startup failure - HcnCreateEndpoint failed (0x80070490)
- [BUG] Cowork fails to start workspace on Windows - ECONNRESET while regular chat works
- [Bug] Manual compaction fails with "Conversation too long" error when auto-compact enabled
- ECONNRESET kills session — needs auto-retry/reconnect
- [BUG] Claude Code fails to reconnect after network change (ECONNRESET) — requires process restart
- [BUG] Retry mechanism fails to recover from connection loss - stale HTTP/2 connection pool not reset
- [BUG] Claude Code fails on networks with broken IPv6 (ECONNRESET)
- [BUG] ECONNRESET errors with IPv6 on Starlink - workaround: force IPv4
- [Bug] Ctrl+G with micro editor erases input text on exit
- I have run into the dreaded authentication token expiration...
- [Bug] File modification conflict: "Read it again before attempting to write it" error requires restart
- Bug Report
- API Error (Connection error.) · Retrying in 1 seconds…...
- Claude likes to ask me to do the work rather than do it itself and stops
- [Bug] ECONNRESET on interactive turns after 15–20 seconds with Claude Sonnet model
- [BUG] ECONNRESET on streaming connections behind multi-layer NAT (macOS 26.6.1, v2.1.231)
- macOS: Read of an image >~200KB deadlocks every subsequent API call (surfaces as ECONNRESET after retry ladder); session permanently poisoned incl. --resume
- [BUG] VS Code extension: ECONNRESET/ECONNREFUSED while bundled binary works when launched directly (2.1.226)
- [Bug] Streams die under long thinking gaps: 180s first-party idle abort + retry permanently disabled after one visible block
- [BUG] Claude code working very poorly when internet connection is done via tethering
- [BUG] ECONNRESET in Claude Desktop in-app Claude Code, while standalone CLI works on same machine/network
- [Windows] Persistent ECONNRESET on streaming API connections due to missing SO_KEEPALIVE (~346s pattern)
- Claude Desktop: EventEmitter memory leak causes ECONNRESET after running multiple Code sessions
- [BUG] `codex_sandbox` firewall rules cause intermittent ECONNRESET in VS Code extension (Windows)
- [BUG] /compact fails with ECONNRESET at only 35% context data — no recovery path when API is intermittently unstable
- [BUG] API Error: Unable to connect to API (ECONNRESET)
- [BUG] Persistent ECONNRESET error on Mac for 2 weeks - UNABLE TO USE CLAUDE FOR ANYTHING FOR ANY SESSION
- [BUG] API error
- [Bug] Windows UTF-8 encoding corruption with non-ASCII characters in file writes
- [Bug Report] Claude Code failing to complete tasks correctly
- [Regression] Cowork OAuth fails with ERR_CONNECTION_RESET on macOS 26.2 after update to v1.2.234
- [FEATURE] VS Code Extension: Local API proxy for Remote-SSH like Copilot
- [FEATURE] Re-read CLAUDE_CODE_CLIENT_CERT in expiration
- [BUG] Claude Code cannot connect - Cloudflare TLS fingerprint rejection (ECONNRESET/ETIMEDOUT)
- [Bug] Unexpected Korean text insertion in Chinese context
- [BUG] Cowork "sdk-daemon not connected" — persists through reinstalls on Windows (v1.1.5749)
- [Bug] Auto-Compress causes team member state hallucination and incorrect termination status
- [Bug] Messages not delivered to team lead after agent spawned in auto-compressed session
- [Bug] Cloudflare deployment documentation outdated for current model
- [BUG] Connection pool reuses sockets past the 400s Cloudflare idle timeout, causing ECONNRESET
- [Bug] ECONNRESET bursts from Cloudflare ZAG edge during streaming responses
- [BUG] Desktop app: long streaming responses drop with ECONNRESET since v1.24012.11 auto-update
- [BUG]: Persistent intermittent ECONNRESET immediately after first streamed chunk, Windows, multiple CLI versions and networks.
- [BUG] Desktop: error-banner "Try again" submits a new user turn (origin.kind:"human") instead of retrying the failed request
- Streaming `/v1/messages` resets with ECONNRESET after the first chunk on Windows — system Node & undici stream fine, only Claude Code's bundled client fails
- [Bug] Claude Code Desktop bundled CLI connection failures (ECONNRESET) — npm CLI unaffected
- [BUG] API Error: Connection closed mid-response (ECONNRESET on every streaming request) with third-party Anthropic-compatible endpoint — works on 2.1.220, broken on 2.1.224
- [BUG] Deterministic ECONNRESET / "Connection closed mid-response" on requests above ~100 KB (mainland China + full-tunnel VPN)
- [Regression in 2.1.221] Windows: every streaming API request gets instant ECONNRESET, 10 retries, ~200s per response (CLI + Desktop GUI)
- ECONNRESET retry storms correlate to-the-second with usage-credit boundary events — edge resets connections instead of returning 429
- [BUG] Frequent "API Error: Unable to connect to API (ECONNRESET)" mid-session on Windows — network verified healthy, Tailscale ruled out
- Recurring ECONNRESET connection drops, not tied to compaction
- Sustained ECONNRESET on streaming connections - Claude Code VS Code extension (Santiago, Chile / SCL region)
- Turns fail on network path change while host is online — identical commute workload degraded 0% → 33% since May (Desktop, bundle 2.1.219)
- Intermittent/recurring ECONNRESET on api.anthropic.com — network verified healthy throughout (Windows, CLI 2.1.100 and extension 2.1.220)
- Response stalled mid-stream regression introduced in 2.1.216 (0 occurrences on 2.1.210, 3-4% on 2.1.217/2.1.218)
- [BUG] Every session >200k tokens (1M-context beta) becomes permanently unrecoverable once prompt cache goes cold: ECONNRESET on all requests incl. /compact — threshold data + isolation experiments + validated workaround
- ECONNRESET / misleading error when reloading a renamed session (bridge "Epoch mismatch (409)")
- SIGABRT crash on VPN connect/disconnect (network route change) — regression in 2.1.177, still present in 2.1.202
- [BUG] --resume fails with ECONNRESET when transcript contains large base64 screenshots; fresh sessions fine; stripping images fixes it (v2.1.201, macOS)
- [BUG] Cowork Scheduled tasks fail with ECONNRESET error while Chat mode works normally
- [BUG] connectio problem
- [DOCS] Connection-drops section omits that partial responses are preserved and the spinner no longer gets stuck at "running tool" (v2.1.179)
- [Bug] ECONNRESET errors with VPN connections to Anthropic API
- [BUG] Persistent ECONNRESET on macOS — works in curl, fails in CLI and VS Code extension; root cause appears to be ProtonVPN WireGuard system extension leaving 12 utun interfaces + conflicting IPv6 routes