[BUG] ECONNRESET on every request — Windows 11; curl and Node.js connect fine; both native and npm installs fail
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?
Since 5 Aug 2026, every request from Claude Code fails immediately with "Unable to connect to API (ECONNRESET)" and retries until giving up (attempt N/10). There was a brief partial recovery on the morning of 6 Aug (replies that cut off mid-stream), then full failure again. The Anthropic status page shows all systems operational and the Aug 4-5 incidents resolved, so this is not the fleet-wide incident.
Diagnostic evidence, all from the same machine (Windows 11, build 10.0.26200), same terminal, within minutes of each other:
- curl to api.anthropic.com: succeeds, TLS handshake completes
- Plain Node.js v24.19.0: fetch("https://api.anthropic.com/v1/messages", {method:"POST"}) returns HTTP 401, i.e. connects to the API without issue
- Claude desktop app / claude.ai: work normally from this machine
- Claude Code: ECONNRESET on every request, on BOTH install variants — native install (2.1.222) and a fresh npm install (2.1.223)
- Reproduces identically on two independent networks (home broadband + mobile hotspot), ruling out router/ISP
- Clean environment: no proxy configured, claude doctor reports clean, all previously-tried workarounds removed (hosts-file pin deleted and verified; NODE_OPTIONS --dns-result-order=ipv4first had no effect)
This is the same fingerprint as #56059 (macOS, closed as duplicate) and #56711 / #13657 (both closed, both labelled platform:macos): curl and Node.js reach the API fine, only Claude Code's bundled runtime fails. My results reproduce this on Windows, where I believe no open issue currently exists.
Note the npm package (2.1.223) no longer offers a workaround: it is now a wrapper (cli-wrapper.cjs) that downloads and launches the same native binary, so both install methods exercise the same runtime.
Also raised with support (conversation 215475376021706). Happy to run any diagnostic build or provide debug logs.
What Should Happen?
Any prompt should receive a response. The same machine's curl, Node.js (fetch returns HTTP 401, i.e. connects fine) and the Claude desktop app all reach api.anthropic.com successfully — only Claude Code fails to connect.
Error Messages/Logs
Unable to connect to API (ECONNRESET) · Retrying in 3s · attempt 4/10
API error (attempt N/10): Connection error. code=ECONNRESET
(repeats until giving up; identical on native 2.1.222 and npm 2.1.223)
Steps to Reproduce
- Windows 11 (build 10.0.26200), Claude Code native install 2.1.222 or npm install 2.1.223 (both reproduce)
- Open Command Prompt, cd to any folder, run: claude
- Type any prompt (e.g. "hi") and press Enter
- Every request fails with ECONNRESET and retries until giving up
Not reproducible via other clients on the same machine, same terminal, same minutes:
- curl to api.anthropic.com succeeds (TLS completes)
- node -e "fetch('https://api.anthropic.com/v1/messages',{method:'POST'})" returns HTTP 401 (connects fine)
- Claude desktop app / claude.ai work normally
Also reproduces identically on a second network (mobile hotspot). No proxy; claude doctor clean; hosts-file workaround removed and verified; NODE_OPTIONS=--dns-result-order=ipv4first had no effect.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown - worked normally until 4 Aug 2026; failure began 5 Aug and persists across 2.1.222 (native) and 2.1.223 (npm), so it appears time-correlated rather than version-correlated
Claude Code Version
2.1.223 (Claude Code) - also reproduces on native install 2.1.222
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
happy to provide more screenshots if required.
3 Comments
duplicate of : https://github.com/anthropics/claude-code/issues/84404
Update — confirmed as the #84404 regression on my machine. Downgrading the npm CLI to 2.1.139 fully restores it: complete streamed responses, zero ECONNRESET, same machine/network/config that failed on 2.1.222 and 2.1.223 minutes earlier. I am on the standard api.anthropic.com endpoint (Max subscription), not a custom endpoint — so the regression is not endpoint-specific. It also explains the "partial recovery" I reported on 6 Aug (streams starting then cutting mid-response). Note the workaround does not help the desktop app's built-in Code feature, which runs its own managed CLI that users cannot pin — that path remains fully broken. Happy to test any candidate build.
Regression bisected to an exact release: 2.1.221 (published 3 Aug).
Fresh npm installs on the same machine, tested minutes apart, standard api.anthropic.com endpoint, Windows 11, Max subscription:
So the streaming regression was introduced in 2.1.221 and persists through 2.1.224. This matches my failure onset (5 Aug) and presumably #84404's. The desktop app's built-in Code feature (app updated 7 Aug) also still fails, streams cutting after the first tokens. Currently pinned to 2.1.220, which is fully stable.