| Error | API Error: Connection dropped (ECONNRESET). A VPN, firewall, or security software can cause this. Check those or switch networks, then try again. |
|---|---|
| Older versions | Before v2.1.227 it read Unable to connect to API (ECONNRESET) |
| Mid-response form | API 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 |
| Fix | curl test, HTTPS_PROXY, check ANTHROPIC_BASE_URL, firewall hosts, quit VPN / Docker, switch network |
| Reports | 4 people on GitHub, 26 Nov to 4 Dec 2026 (#112450, #112458, #112995, #114047). No Anthropic reply on these issues |
| Checked | 5 Dec 2026, against the sources listed below |
Fix it (Anthropic's steps)
- Test the connection from the same shell.
On Windows PowerShell usecurl -I https://api.anthropic.comcurl.exe -I https://api.anthropic.com, so the built-inInvoke-WebRequestalias isn't used. - Behind a corporate proxy, set it before starting Claude Code:
(PowerShell:export HTTPS_PROXY=https://proxy.example.com:8080$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. - Check
ANTHROPIC_BASE_URL. Runecho $ANTHROPIC_BASE_URL(echo $env:ANTHROPIC_BASE_URLin PowerShell) and look for it in theenvblock 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). - Allow the hosts listed in Claude Code's network access requirements in your firewall.
- Rule out local network software. On macOS, a disconnected or uninstalled VPN can leave a
utuninterface or routing rule behind (checkifconfig, 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.conffor an unreachable nameserver. - 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.comover IPv4 were reset when the handshake offered the post-quantum key shareX25519MLKEM768, on two different ISPs. Plain X25519, TLS 1.2 and IPv6 worked. The reporter's workaround wasBUN_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/loginfailed withread ECONNRESETwhilecurland 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
- Claude API error 529 overloaded_error
- Claude Code: Failed to authenticate / 403
- Claude Code not working in VS Code
Sources
Read 5 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.
- Claude Code docs: error reference, Unable to connect to API / Connection dropped: code.claude.com/docs/en/errors
- Claude Code docs: network configuration (HTTPS_PROXY): code.claude.com/docs/en/network-config
- anthropics/claude-code #111982 (X25519MLKEM768 handshake resets over IPv4): github.com/anthropics/claude-code/issues/111982
- anthropics/claude-code #112450 (every request and /login reset; TLS 1.2 works): github.com/anthropics/claude-code/issues/112450
- anthropics/claude-code #112995 (Desktop Code tab fails, CLI works): github.com/anthropics/claude-code/issues/112995
- anthropics/claude-code #114047 (all networks since 3 Dec; resumed sessions hit hardest): github.com/anthropics/claude-code/issues/114047
- anthropics/claude-code #112458 (multi-agent workflow failures): github.com/anthropics/claude-code/issues/112458
- reviewready CLI: one command that checks an AI app repo before it ships
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- CLAUDE.md security check: find risky instructions in agent rules files