[BUG] ECONNRESET on home Wi-Fi — curl succeeds at exact same moment Claude Code fails

Open 💬 1 comment Opened Jul 6, 2026 by zdadic1

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 throws ECONNRESET errors intermittently on home Wi-Fi. At the exact moment Claude Code fails, a plain curl request to the identical endpoint succeeds cleanly (HTTP/2 401 with valid cert — not a Cloudflare block, not TLS interception).

Environment:

  • Claude Code version: 2.1.179
  • OS: macOS (Apple Silicon)
  • Terminal: zsh / PyCharm
  • Login: Claude Max plan

What was ruled out:

  • MTU set to 1492 — persisted
  • IPv6 disabled — persisted
  • Cloudflare block — no cf-mitigated header, clean 401 returned
  • CrowdStrike Falcon TLS interception — real Google Trust Services cert in chain
  • General network failure — browser, curl, claude.ai web all work simultaneously

Pattern:

  • Works consistently on mobile hotspot (same binary, same machine)
  • Fails on home Wi-Fi, returns within an hour even after restart
  • Only Claude Code's HTTP client is affected, not curl or system networking

Related: #35768 (same root cause identified — configureGlobalAgents custom HTTP agent)

What Should Happen?

Claude Code should connect successfully to api.anthropic.com on home Wi-Fi, the same way curl and the system browser do on the identical network at the identical moment.

Error Messages/Logs

✻ Unable to connect to API (ECONNRESET) · Retrying in 10s · attempt 6/10

curl test run simultaneously — succeeds cleanly:
HTTP/2 401
server: cloudflare
issuer: C=US; O=Google Trust Services; CN=WE1
SSL certificate verify ok
{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}

Steps to Reproduce

  1. Connect Mac to home Wi-Fi (not mobile hotspot)
  2. Run any claude prompt in terminal: claude "what is 2+2"
  3. Observe ECONNRESET error appearing, with retries also failing
  4. Immediately run curl in a separate terminal tab:

curl -v https://api.anthropic.com/v1/messages \
-H "x-api-key: test" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-6","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'

  1. curl returns clean HTTP/2 401 while Claude Code is still failing

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.201

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗