[BUG] Claude Code + Cowork fail with ECONNRESET on every network and client — chat works fine
Preflight Checklist
- [ ] 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?
Preflight
- Searched existing issues, this specific combination not yet reported
- Single bug report
- Using latest version (2.1.224)
What's wrong
Claude Code CLI and Cowork both fail immediately with API Error: Unable to connect to API (ECONNRESET) on every attempt, including the very first message. Regular Claude.ai chat works perfectly on the same account, same machine, same network.
Environment
- MacBook Air, M1, 2021, 8GB RAM
- macOS 14
- Claude Code v2.1.220
- Claude Pro plan
History
On initial install, Claude Code failed to connect until VPN and firewall were fully disabled; even after uninstalling those tools, leftover Bitdefender components had to be manually removed before it worked. After that fix, everything worked normally for about a week. The ECONNRESET error then returned and nothing below has resolved it since.
Steps already tried since the error returned (all failed, same error every time)
- Home network
- Phone hotspot (rules out router/ISP)
- Full local config reset:
rm -rf ~/.claude+ freshclaude login - Updated CLI to latest version
- Claude Desktop app — same ECONNRESET
- Checked status.anthropic.com — all green
- Confirmed no active VPNs, firewalls, or startup scripts
Diagnostic — curl -v https://api.anthropic.com**
* TLS handshake, Server hello / Certificate / CERT verify / Finished — all OK
* SSL connection using TLSv1.3
* Server certificate verify ok
* ALPN: server accepted h2
< HTTP/2 404
< server: cloudflare
Full TCP + TLS handshake completes cleanly, server responds. This rules out network, DNS, TLS, and certificate issues.
Conclusion
Since chat works but Code + Cowork don't, across 2 networks, 2 clients (CLI + Desktop), and a full credential/config reset — this points to something server-side specific to Code/Cowork request handling for this account, not a local environment issue.
Duration: ongoing for ~2 weeks. Also submitted via support.claude.com with no response after 16 days.
What Should Happen?
Claude Code and Cowork should connect to the API and respond normally, the same way regular Claude.ai chat does on this account.
Error Messages/Logs
"API Error: Unable to connect to API (ECONNRESET)"
Steps to Reproduce
- Open Claude Code CLI (v2.1.220) on macOS 14, MacBook Air M1 2021
- Run
claudeand type any message, e.g. "hej" - Error appears immediately: "Unable to connect to API (ECONNRESET)"
- Retries automatically, fails every attempt (10/10)
- Same result running
claude login/claude logout - Same result on a second network (phone hotspot)
- Same result after
rm -rf ~/.claude+ fresh login - Same result in Claude Desktop app (Cowork tab) — separate client, same account
- Regular chat on claude.ai works fine on the same account/network, ruling out account-level auth issues
Diagnostic: curl -v https://api.anthropic.com completes a full TLS handshake and gets HTTP/2 404 from Cloudflare — confirms network/DNS/TLS are not the cause.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.25927.0
Claude Code Version
2.1.224
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
5 Comments
+1, same issue on a second, independent account. Claude Code CLI and Cowork both fail with the same retry/connection-failure pattern; Claude.ai chat works fine on the same account.
What I've ruled out (matches the OP's list closely):
• Tested on 3 separate networks: home wifi, two different 5G routers, phone hotspot — same failure on all
• Ran /doctor — same failure
• Full logout, deleted local credentials, fresh login on both Claude Code and Cowork — same failure persists
• Chat works normally on the same account/machine the whole time
Ongoing about 1 week. Also opened a support.claude.com case, explicitly asked for human escalation — got only generic Fin AI Agent auto-replies, and one follow-up generated a second, separate conversation ID instead of merging into the existing case. No human response yet.
Given two independent accounts hitting the identical signature, this looks server-side and account/entitlement-related rather than a local environment issue. Flagging for visibility since support hasn't resolved it either.
Same issue here, started ~2 days ago. Windows, Claude Code 2.1.227 (latest), Max plan. Nearly every request fails with Connection dropped (ECONNRESET) · Retrying, including the first message in a fresh empty workspace. Reproduces on both the Desktop app and the CLI.
Confirmed it's not my network:
5 consecutive curl -X POST https://api.anthropic.com/v1/messages → all 401, zero resets
netsh winhttp show proxy = Direct access (no proxy)
No VPN (all disabled), Windows Defender Network Protection disabled
claude.ai in the browser works perfectly at the same moment, same machine/network
Already tried (none fixed it): updated 2.1.222→2.1.227, clean reinstall, sign out/in, ANTHROPIC_API_TIMEOUT_MS + UV_THREADPOOL_SIZE env vars, empty workspace.
This matches the documented HTTP/2 connection-pool ECONNRESET pattern (#67091, #51164). The requested upstream fix is more aggressive TCP keepalive / force-closing the pool on ECONNRESET instead of reusing a dead socket.
bumping it again , i cant work with claude for 2 days, it feels that i am wasting my money on max plan when i cant even work!
Same here still - emailed Anthropic, got a message from Fred and told him that I want to get in touch with a human. Have been waiting for 2 days now.
Another data point supporting the client-side / stale-connection-pool diagnosis, with two observations I haven't seen elsewhere in this thread: a transcript-size correlation (matching #51164) and small requests failing inside the same process while fresh connections from other processes succeed at the same moment.
Environment
en0), no proxy env, no content-filter/network system extensions, no NODE/TLS env overridesSymptom timeline (extracted from session transcripts,
isApiErrorMessage: trueentries)ENOTFOUNDUnable to connect to API (ECONNRESET)across many concurrent sessionsECONNRESET/Connection dropped (ECONNRESET), 6 of them within one hourNetwork is exonerated — the failure follows the machine
curlprobes tohttps://api.anthropic.com/v1/modelssucceed on both IPv4 and IPv6, connect in 20–50 ms, clean TLSErrors track accumulated session size (matches #51164)
Error count per session vs. its transcript (
.jsonl) size:| Transcript size | API errors |
|---|---|
| 25 MB | 10 |
| 10 MB | 1 |
| 9 MB | 1 |
| 6 MB | 1 |
| 5 MB | 2 |
| 4 MB (×3 sessions) | 6 |
| < 1 MB (vast majority of ~300 sessions/month) | rare one-offs |
I'm a heavy user (multiple concurrent sessions, subagent fan-outs, 11 sessions > 6 MB in the last 30 days). My coworkers never see this. That's consistent with the failure tracking re-uploaded request size / long-lived streams, not account or network.
Same-process observation (stale-pool smoking gun?)
During the 08-11 burst, the CLI's own auxiliary requests (the auto-mode permission classifier — small, non-streaming) failed with "temporarily unavailable" at the same moments the main streaming requests were resetting — while a plain
curlfrom a separate process on the same machine succeeded instantly. Everything sharing the CLI process's connection pool failed together; everything on a fresh connection worked. That's exactly the "pool keeps reusing a dead socket instead of force-closing on ECONNRESET" behavior suggested here and in #67091/#62045.Extraction method (for anyone who wants to contribute the same data)
(Exclude the session you run this from — its own tool output echoes the error strings.)
Happy to provide debug logs or run instrumented builds against the 25 MB session if that helps.