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
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
### 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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- macos
- 領域
- api, cli, desktop, networking
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100