[BUG] Claude Code fails in both desktop app and CLI on Windows 11, with two different errors, while chat and curl work
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?
Claude Code is unusable on this machine. Desktop app Code
sessions and the CLI both fail, with different errors.
Chat in the desktop app works normally throughout.
Environment
- Windows 11
- Claude Code CLI 2.1.226
- Claude desktop app, latest version
- Claude Pro
- PowerShell, conda base environment active
Desktop app behaviour
Response begins streaming, sometimes completing a full
paragraph and a tool call, then the connection drops.
API Error: Connection closed mid-response.
Retries run to 10/10 without succeeding. In one case the
response completed fully and a "Server error" card was
still shown.
CLI behaviour
Worked briefly after a fresh login, then began failing
with a different error:
Unable to connect to API (ECONNREFUSED)
Retrying in 5s - attempt 5/10
Started immediately after the most recent app update.
Worked fine for months before that.
Network is fine
curl.exe -I https://api.anthropic.com returns HTTP 404
normally from the same PowerShell session where the CLI
fails, so the path to api.anthropic.com is reachable.
Ruled out
- Two separate accounts, same failure on both
- Home wifi and mobile hotspot, same failure on both
- Opus 5 at max effort, Sonnet 5 at high, Opus 4.7 at xhigh
- Windows Firewall allows Claude on private and public
profiles
- No VPN running, no Windows proxy configured, no Docker
- No ANTHROPIC_ or _PROXY environment variables
(Get-ChildItem Env: returns nothing for either)
- conda deactivate made no difference
- NODE_OPTIONS="--dns-result-order=ipv4first" made no
difference
- Clean reinstall of the desktop app including deletion of
%APPDATA%\Claude and %USERPROFILE%\.claude
Chat in the desktop app works normally throughout. Only
Code sessions fail, on both surfaces.
What Should Happen?
Claude Code should complete a turn and return a full
response. Instead the connection drops mid-response in the
desktop app, and the CLI cannot connect at all.
Error Messages/Logs
Desktop app:
API Error: Connection closed mid-response. The response
above may be incomplete.
Request failed · retrying (8/10) · 1m 38s
CLI:
Unable to connect to API (ECONNREFUSED)
Retrying in 5s · attempt 5/10
Network check from the same PowerShell session:
PS C:\Users\aryan> curl.exe -I https://api.anthropic.com
HTTP/1.1 404 Not Found
Server: cloudflare
CF-RAY: a27c8f633cb7ff77-BOM
Steps to Reproduce
- Open the Claude desktop app on Windows 11
- Start a Code session in any project folder
- Send any message, including a bare "hi"
- The response begins streaming, then the connection
drops. Retries run to 10/10 without succeeding.
Also reproduces in the CLI (claude in PowerShell), though
with a different error: ECONNREFUSED, connection never
established.
Chat in the same desktop app works normally throughout.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.226 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗