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

未关闭
#93,031 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api:anthropic area:networking duplicate platform:macos
主要语言
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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。