ECONNRESET: socket hang up
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 1–100
Ranked by community engagement (reactions weighted over comments).
- Persistent ECONNRESET Errors on macOS Network Connections
- [Bug] Anthropic API Error: Overloaded
- [BUG] ECONNRESET errors - Unable to connect to API despite healthy network
- [Bug] Anthropic API Error: Internal server error (500)
- [BUG] Claude Code sustained ~80% ECONNRESET failure rate — March 30, 2026 specifically from Boston Area
- [BUG] Cowork ECONNRESET on macOS - Unable to connect to API (Max plan)
- [BUG] Connection-level errors (ECONNRESET, EPIPE, ETIMEDOUT) are never retried — immediate failure with zero recovery
- [BUG] Bedrock Bearer Token (ABSK) authentication broken in v2.1.94
- [Bug] Anthropic API Error: ECONNRESET with exhausted retries in Claude desktop app
- [BUG] Intermittent ECONNRESET on both desktop app and standalone CLI, no VPN/proxy
- [Bug] 2.1.69 TUI hangs on Windows due to config directory creation failure (EEXIST)
- [BUG] ECONNRESET issues
- [BUG] Persistent ECONNRESET / "Connection lost mid-response" on all Code surfaces while raw HTTPS to api.anthropic.com is healthy (Windows 11, v2.1.229)
- [BUG] Opus 4.8 medium effort spends 46k output tokens on hidden thinking for a simple coding turn
- [BUG] Unable to connect to API (ECONNRESET) v2.1.50
- Connection Timeout: Persistent API Request Failure After 10 Retry Attempts
- [BUG] API Error: Unable to connect to API (ECONNRESET)
- [BUG] ECONNRESET on corporate network - TLS fingerprinting blocks Bun while curl/Node.js work
- [BUG] Persistent mid-stream ECONNRESET on large-context sessions (v1/messages?beta=true)
- Frequent ECONNRESET failures with Opus 4.6 (1M context)
- [BUG] Claude Code hangs with Unable to connect to API (ECONNRESET) on every prompt — both CLI and in-app, persists across networks and clean reinstall
- Dispatch/Cowork: ECONNRESET when connecting to API
- [BUG] Stale connection pool after sleep/wake/network change causes ECONNRESET on next API call
- [Bug] Anthropic API Error: ECONNRESET - Unable to establish connection
- [BUG] Claude Code + Cowork fail with ECONNRESET on every network and client — chat works fine
- [BUG] Frequent "API Error: Unable to connect to API (ECONNRESET)" in Claude Code
- [BUG] Cowork - Server busy / ECONNRESET on macOS - started ~14h UTC, May 25 2026
- [BUG] ECONNRESET on every API call — macOS 26 Tahoe, Darwin 25.4.0, ARM64
- [BUG] [BUG] Cowork Windows 11 Pro: ECONNRESET - NAT rule creation fails with "duplicate name" error despite no existing NAT rules
- API Error: Unable to connect to API (ECONNRESET)
- [BUG] ECONNRESET Errors with pro subscription on Ma
- [BUG]
- [Bug] Anthropic API Error: Unable to connect to API (ECONNRESET)
- [BUG] ECONNRESET errors in session
- Recurring ECONNRESET during active sessions, exhausting all 10 retry attempts
- [BUG] Cowork: all tasks fail with retry loop then ECONNRESET — fails across networks incl. phone hotspot, survived clean reinstall, worked hours earlier same day (macOS 15.7.3, M3)
- [Bug] Frequent ECONNRESET errors with failed retry logic in autonomous sessions
- Orphaned bg-pty-host (spare) busy-loops at 100% CPU for days after its daemon dies
- [Feature] OnApiRetry hook event for observability and control over internal retry behavior
- [BUG] macOS: long sessions die with ECONNRESET — macOS TCP send-buffer default (autosndbufmax=4MB) bursts the growing context upload; one sysctl fixes it
- [BUG] Regression 2.1.220 → 2.1.221 (Windows native): direct API connections die with ECONNRESET after first chunk when a Winsock LSP (Proxifier v3) is registered
- [BUG] Desktop-only: CLI exit 143 / system_error on cycles past ~5 min — bare CLI works fine with same binary, same model, same context
- [BUG] 953 empty [] files in ~/.claude/todos/ causes ECONNRESET on every API request
- [BUG] Interactive mode fails with ECONNRESET while -p (print) mode works fine
- `claude` crashes when the Anthropic API is down
- [BUG] Claude Code 2.1.228 repeatedly fails with ECONNRESET on Windows 11, while 2.1.220 works normally
- [BUG] Unable to connect to API (ECONNRESET)
- [BUG] Persistent intermittent ECONNRESET ("socket closed unexpectedly") on Claude Code — macOS, multi-day, recurring across sessions
- Fresh project sessions rapidly accumulate hidden tool-result context and then fail with ECONNRESET
- Resume loses most context: parentUuid chain breaks on unpersisted messages
- [FEATURE] Show error reason in retry status line
- Desktop fails to recover from mid-session SSH disconnect — reattaches to orphaned remote process instead of spawning fresh
- [BUG] Claude code stopped working
- [BUG] Cowork incompatible with VPN - Hyper-V NAT routing prevents VM from reaching Claude API
- [BUG] [BUG] Persistent ECONNRESET on v2.1.228 (post-fix) — all networks, all local causes eliminated incl. full AV uninstall; claude.ai chat works fine on same account
- [BUG] ECONNRESET on every request — Windows 11; curl and Node.js connect fine; both native and npm installs fail
- [BUG] ECONNRESET on streaming API calls: bundled Bun HTTP client fails while Node.js/curl succeed identically (Windows, VPN-independent, survives reinstall)
- Remote Control (server mode): 'failed to disconnect' — TypeError reading 'session_url'
- ECONNRESET reliably triggered by image upload (even <1MB, single/first images)
- [FEATURE] Make MCP tool call timeout configurable (MCP_TOOL_TIMEOUT)
- [Feature Request] Add named/titled conversation sessions with resumption by name
- Frequent streaming stalls and ECONNRESET during complex tasks
- [BUG] Cowork VM cannot reach Claude API on Windows 11 Pro — missing WinNAT rule
- [BUG] Win 11 Pro, 24H2, Build 26100.7840, Hyper-V enabled, ECONNRESET error
- [FEATURE] Local Preservation of Full Chat Logs in VSCode Claude UI Extension
- [BUG] 2.1.221+ fails with ECONNRESET / "Connection closed mid-response" when a third-party Winsock LSP is present; no diagnostic points to the cause
- Background daemon sessions fail permanently on transient socket errors — no retry/reconnect
- Bug: `tengu_disable_keepalive_on_econnreset` heuristic never triggers on Bun's native fetch errors
- Claude Code API not connecting
- Bug: ECONNRESET ('terminated') during streaming with partial data kills the session — no retry, no fallback
- [Bug] API Connection Error: ECONNRESET across all models and sessions
- You've hit your limit · resets 12pm (Europe/London)
- [BUG] Claude CoWork showing Content Security Policy error after Mac OS update
- [BUG] WAF Rules
- [BUG] Cowork Windows: VM boots and authenticates but has zero internet connectivity — all outbound TCP fails (Win 11 Pro, Build 26200)
- [BUG] Windows Desktop: "Claude will be back" crashes, Settings inaccessible, Get Help non-functional, Cowork ECONNRESET (Max Plan)
- [Urgent] Widespread ECONNRESET mid-stream — long streamed responses die, short ones survive
- Frequent ECONNRESET on large-context Opus 5 (1M) sessions — RSTs originate from server edge, with SACK gaps on upload
- [BUG] I am always getting the API Error: Connection dropped...
- [BUG] Regression after 2.1.139: streaming connection resets after first SSE chunk and retries 10 times
- [BUG]
- [Bug] Anthropic API Error: ECONNRESET connection reset during message requests with excessive retry loops
- [BUG] Server is Busy & "API Error: Unable to connect to API (ECONNRESET)" errors for 48+ hours in cowork
- [BUG] Read tool can inject huge partial file output into context, causing repeated ECONNRESET on follow-up turns
- Claude Code tab in Desktop App stuck on "Tinkering..." then ECONNRESET
- Persistent ECONNRESET (errno=0) on api.anthropic.com/v1/messages?beta=true — fails through all 10 retries
- [BUG] Same-cwd concurrent Claude Code sessions trigger persistent ECONNRESET / socket closed
- A bug with Cowork
- [Bug] Multiline content paste not working in CLI input
- [BUG]
- OTEL telemetry ECONNRESET makes Claude Code CLI unusable
- [BUG] ECONNRESET on WSL2 Ubuntu 22.04 - TLS 1.3 decode error with embedded runtime
- [BUG] Cowork VM fails to reach API on corporate/institutional network
- [BUG] ECONNRESET on a fresh 2.1.39 install
- [BUG]
- [ERROR] Error streaming, falling back to non-streaming mode: Connection error.
- [Bug] ECONNRESET on Windows during API stream after first chunk received
- [Bug] Anthropic API Error: Connection closed mid-response after content blocks streamed
- [BUG] claude code desktop not connecting and says check internet connection - Windows OS , using latest claude release 1.22209.3
- [BUG] ECONNRESET recurs on Claude Code CLI while curl succeeds simultaneously (v2.1.209, arm64 macOS)