anthropics / anthropics/claude-code

[BUG] Persistent ECONNRESET on Claude Code (desktop + CLI) on office network — resolved only by VPN or mobile hotspot, no local config changes made

Aberta
#93,031 2 comentários 0 reações 0 responsáveis Ver no GitHub
api:anthropic area:networking duplicate platform:macos
Linguagem predominante
Python
Estrelas
145k
Forks
23.1k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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 (both desktop app and CLI) fails consistently with API Error: Connection dropped (ECONNRESET) on our office Wi-Fi network, retrying up to 10 times before failing outright — this happens even on simple tasks like reading a single file. claude.ai chat works flawlessly on the same machine, network, and account throughout.

The issue started September 8, 2026 with no changes made on our side — I'm Head of IT/Technology for the organization and can confirm no firewall, proxy, or security policy changes were made in the relevant timeframe.

Critically: the same ISP (e&, Dubai, UAE) works fine via personal VPN, mobile hotspot, and home Wi-Fi — only this specific office circuit reproduces the failure. Basic curl tests to api.anthropic.com (including a streaming POST to /v1/messages) succeed cleanly with the connection staying intact, while actual Claude Code session traffic resets. This suggests the issue is specific to how Claude Code handles its connections (long-lived/streaming, possibly IP-based rather than hostname-based) rather than basic network connectivity or DNS.

This closely matches previously reported issues #2935 (Claude Code connecting to raw IPs instead of hostnames, breaking on networks with stricter policies — closed as not planned), #85979 (persistent ECONNRESET across multiple networks with all local causes eliminated), and #87424 (intermittent ECONNRESET with no VPN/proxy).

### What Should Happen?

Claude Code should maintain a stable connection to api.anthropic.com on this network, consistent with claude.ai's behavior on the same network and machine, and consistent with Claude Code's own behavior on VPN/hotspot/home Wi-Fi using the same ISP.

### Error Messages/Logs

```shell
API Error: Connection dropped (ECONNRESET)
✻ Cooked for 2m 52s

Reading device-storage.ts
file_path: /Users/[USER]/Sites/meeting-scheduler-monorepo/apps/kiosk/src/lib/device-storage.ts
🔴 Request failed · Retrying (5/10) · 35s

Diagnostic curl output (connection succeeds, for contrast):
* SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://api.anthropic.com/
< HTTP/2 404
* Connection #0 to host api.anthropic.com left intact

* upload completely sent off: 121 bytes
< HTTP/2 401
{"type":"error","error":{"type":"authentication_error","message":"x-api-key header is required"}}
* Connection #0 to host api.anthropic.com left intact

DNS already set to 8.8.8.8 — not a resolution issue.
```

### Steps to Reproduce

Connect to office Wi-Fi (e&, Dubai, UAE)
Run any Claude Code task, including simple file reads (e.g., reading a single source file)
Observe API Error: Connection dropped (ECONNRESET), with retry counter climbing (e.g. "Retrying (5/10)")
Task eventually fails after exhausting retries
Compare: enable personal VPN, or switch to mobile hotspot (same ISP, e&) — task completes successfully with no errors
Compare: curl -v https://api.anthropic.com/ and curl -v -N https://api.anthropic.com/v1/messages on the same failing network — both complete cleanly with connection intact, no reset

### Claude Model

Sonnet (default)

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

_No response_

### Claude Code Version

2.1.236 (Claude Code)

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

iTerm2

### Additional Information

This was working until 7th September.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

No source file or test is named. First reproduce on the office Wi-Fi, then compare Claude Code with VPN, hotspot, and home Wi-Fi while reviewing the connection behavior for session traffic; use the successful curl and streaming POST results as the baseline. Done means Claude Code completes the same task reliably on the office network without ECONNRESET retries.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
macos
Domínio
api, cli, desktop, networking
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
38/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.