Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / Connection dropped (ECONNRESET)
Fix · Claude Code

Claude Code: Connection dropped (ECONNRESET)

Fix: something between Claude Code and api.anthropic.com closed the connection. From the same shell, run curl -I https://api.anthropic.com (curl.exe in PowerShell), check HTTPS_PROXY and ANTHROPIC_BASE_URL, and try another network. If curl works and every network fails, it's probably not your setup: users saw this in late Nov and early Dec 2026 too (see below).

At a glance
ErrorAPI Error: Connection dropped (ECONNRESET). A VPN, firewall, or security software can cause this. Check those or switch networks, then try again.
Older versionsBefore v2.1.227 it read Unable to connect to API (ECONNRESET)
Mid-response formAPI Error: Connection lost mid-response. The response above may be incomplete.
Usual causes (Anthropic docs)No internet, a VPN that blocks api.anthropic.com, a corporate proxy that isn't configured, a gateway, a leftover VPN tunnel, Docker Desktop
Fixcurl test, HTTPS_PROXY, check ANTHROPIC_BASE_URL, firewall hosts, quit VPN / Docker, switch network
Reports4 people on GitHub, 26 Nov to 4 Dec 2026 (#112450, #112458, #112995, #114047). No Anthropic reply on these issues
Checked5 Dec 2026, against the sources listed below

Fix it (Anthropic's steps)

  1. Test the connection from the same shell.
    curl -I https://api.anthropic.com
    On Windows PowerShell use curl.exe -I https://api.anthropic.com, so the built-in Invoke-WebRequest alias isn't used.
  2. Behind a corporate proxy, set it before starting Claude Code:
    export HTTPS_PROXY=https://proxy.example.com:8080
    (PowerShell: $env:HTTPS_PROXY = "https://proxy.example.com:8080".) In Claude Desktop sessions where the app manages the connection, Claude Code reads proxy variables only from managed settings and ~/.claude/settings.json.
  3. Check ANTHROPIC_BASE_URL. Run echo $ANTHROPIC_BASE_URL (echo $env:ANTHROPIC_BASE_URL in PowerShell) and look for it in the env block of your settings files. A leftover value sends requests to an old proxy or gateway. If it deliberately points at your gateway and every request ends in Connection dropped, Anthropic's docs say to check that the gateway and its upstream accept tool search fields (defer_loading, tool_reference).
  4. Allow the hosts listed in Claude Code's network access requirements in your firewall.
  5. Rule out local network software. On macOS, a disconnected or uninstalled VPN can leave a utun interface or routing rule behind (check ifconfig, remove the VPN's network extension). Docker Desktop and similar runtimes can intercept outbound traffic: quit them and retry. On Linux and WSL, check /etc/resolv.conf for an unreachable nameserver.
  6. Switch networks, as the message says, to tell a local problem from a path problem. Intermittent failures are retried automatically.

When it fails on every network

Users reported three patterns in the last two weeks. None has an answer from Anthropic on GitHub yet.

  • The TLS handshake is reset. In #111982 (24 to 25 Nov), connections to api.anthropic.com over IPv4 were reset when the handshake offered the post-quantum key share X25519MLKEM768, on two different ISPs. Plain X25519, TLS 1.2 and IPv6 worked. The reporter's workaround was BUN_FEATURE_FLAG_DISABLE_IPV4=1 claude, and the resets stopped on their own a couple of hours later. In #112450 (26 Nov, Vietnam) the same test pointed the same way (post-quantum handshake reset, TLS 1.2 fine), but the IPv4 workaround didn't help on a network without IPv6. There, even /login failed with read ECONNRESET while curl and Claude Desktop chat worked.
  • Long or resumed sessions fail, new short ones work. In #114047 (Windows, 2.1.332 and 2.1.336, from 3 Dec), every network failed with Connection dropped and Connection lost mid-response; packet captures showed a bare TCP reset from Anthropic's address, and "resumed large sessions" were hit hardest while "fresh small sessions mostly work". In #112995, the Desktop app's Code tab kept failing mid-response on a slow mobile hotspot while the CLI worked on the same machine, and new sessions answered short messages.
  • Many agents at once. In #112458, agents in a large multi-agent workflow failed with both messages.

If you're in one of these, a fresh session is the cheapest thing to try. Then run /feedback with the time it happened, so the request IDs reach Anthropic.

Connection lost mid-response

Anthropic's docs: this variant means "the connection dropped" after Claude had already produced text or a tool call. Re-sending could run the same tool calls twice, so Claude Code keeps what was completed and adds the notice instead. Check what was done before you ask it to continue.

Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review

FAQ

What does 'Connection dropped (ECONNRESET)' mean in Claude Code?

The TCP connection to the API was reset before the request finished. Anthropic's docs list no internet, a VPN blocking api.anthropic.com, an unconfigured corporate proxy, gateways, leftover VPN interfaces and Docker Desktop as common causes.

How do I test it?

Run curl -I https://api.anthropic.com from the same shell (curl.exe in PowerShell). If curl fails, fix the network or proxy first.

curl works but Claude Code still fails. Why?

Check ANTHROPIC_BASE_URL for a leftover proxy or gateway, quit VPNs and Docker Desktop, and try another network. In late Nov 2026 users also saw TLS handshake resets that hit only some connections.

Why do new sessions work but my old session fails?

One user on Windows found fresh small sessions mostly worked while resumed large sessions kept getting reset (#114047). Anthropic hasn't explained it yet.

Related errors

Sources

Read 5 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools