OmniscioGuidesECONNRESET
Claude Code: connection dropped (ECONNRESET)
Last checked against Anthropic's documentation on November 13, 2026. By the Omniscio team. Updated .
What does the message look like?
You get this one line, with the code in brackets:
Connection dropped (ECONNRESET)On a version before 2.1.227 the same failure printed only the generic message and the code, without naming the kind of failure:
Unable to connect to API (ECONNRESET)If that is the line you are seeing, claude update is worth doing first. The newer message names the failure in plain words.
What does ECONNRESET actually mean?
ECONNRESET is the connection's own error code. The line to api.anthropic.com had opened, and then the other end, or something in between, closed it abruptly.
Anthropic puts it in the same family as the other "cannot connect" errors, so it carries the same three common causes.
- No internet access.
- A VPN that blocks
api.anthropic.com. - A required corporate proxy that is not configured.
What it is not: your API key, your account or the model. None of those were reached.
Do I need to do anything about it?
Claude Code already retries this one for you, so a single drop is not worth acting on.
Claude Code tries again up to 10 times on its own, waiting a little longer between each attempt. If the connection drops before Claude has produced any part of its answer, Claude Code asks again and carries on, even if a little text had already appeared on your screen.
There is one narrower case. If the drop lands after Claude has done its thinking but before any answer or tool call has started, Claude Code retries up to two times in quick succession. If it still drops there, the turn ends with a different line:
Connection lost before a response was producedThat message means the retries ran out. Sending the message again is the step.
How do I stop it happening every time?
Work down this list. Each step tests one link in the chain. If you do not use a company proxy, a gateway or Docker, skip to the last one.
- Test the API from the same shell. Run
curl -I https://api.anthropic.com, orcurl.exe -I https://api.anthropic.comin PowerShell so the built-in alias is not used. If that fails too, the problem is the network rather than Claude Code. - Set the proxy. Behind a company proxy, set
HTTPS_PROXYbefore launching Claude Code, for exampleHTTPS_PROXY=http://proxy.company.com:8080 claude. The corporate proxy guide walks through the rest. - Using a company gateway? If a gateway or relay sits between Claude Code and Anthropic, it may be rejecting extra data Claude Code sends. Ask whoever runs it to allow that, or point
ANTHROPIC_BASE_URLback athttps://api.anthropic.comand try again, which tells you whether the gateway is the cause. - Check the firewall. The hosts Claude Code needs are on Anthropic's network configuration page. Hand that list to whoever manages your network.
- Rule out a container runtime. Docker Desktop and similar runtimes can intercept outbound traffic. Quit them and retry.
Is this the same as "Socket is closed"?
No. They look alike and they are not the same.
Socket is closed means an answer was being sent to you and the connection closed while it was still arriving. The most common cause Anthropic names is a company proxy on Windows cutting the response off partway.
ECONNRESET is the connection itself being reset. Both point at something between Claude Code and the API, but they are different messages with different checks.
Our connection errors guide covers the rest of the family, including ECONNREFUSED and a stalled stream, and the corporate proxy guide goes deeper on a locked-down network.
Where these answers come from
- Claude Code error reference, for the message, the three common causes, the
curltest, the gateway tool search note and the firewall list. Read November 13, 2026. - The same page's retry section, for the 10 retries, the two quick retries and
Connection lost before a response was produced. Read November 13, 2026. - The same page's Socket is closed entry, for how the two differ.