[BUG] Frequent "API Error: Unable to connect to API (ECONNRESET)" mid-session on Windows — network verified healthy, Tailscale ruled out

Status Closed — duplicate
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Aug 1, 2026 · closed Aug 19, 2026

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 repeatedly fails mid-session with:

API Error: Unable to connect to API (ECONNRESET)

Pattern:

  • Sessions start fine. After several minutes of normal work (reading/editing many small text files in a batch-editing task), the error appears.
  • After the error, Claude Code hangs and retries for a long time (e.g. "Cogitated for 6m 40s", "Crunched for 5m 59s") before eventually recovering and continuing.
  • It recurs multiple times per session, and seems to get more frequent as the session goes on.
  • This started suddenly. The same machine, network, and workflow ran fine for ~6 months before this began.

What I have already ruled out:

  • Basic connectivity is healthy: curl.exe -I https://api.anthropic.com returns instantly with a normal Cloudflare response (HTTP/1.1 404, CF-RAY: SJC).
  • Fully quitting and restarting Claude Code does not prevent it — a fresh session with a fresh (small) context hits the same error after a few minutes.
  • Tailscale fully exited — no change, error still occurs.
  • Usage limits are not the cause (Max plan, ~35% of all-models limit used at the time of errors).

What Should Happen?

Sessions should maintain a stable API connection throughout; transient network errors should fail fast and retry quickly instead of hanging for 5-6 minutes.

Error Messages/Logs

Steps to Reproduce

  1. Start Claude Code (native Windows install) in a project directory.
  2. Run a batch task: sequentially read and edit dozens of small .txt caption files.
  3. Work proceeds normally for several minutes.
  4. "API Error: Unable to connect to API (ECONNRESET)" appears; the client retries for 3–7 minutes before recovering.
  5. Repeats multiple times per session.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.220 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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