anthropics / anthropics/claude-code
[BUG] ECONNRESET on all requests — curl, node https, and node fetch all succeed to api.anthropic.com on the same machine
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
### 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 v2.1.260 fails with ECONNRESET on every launch. curl, Node's https module, and Node's fetch all reach api.anthropic.com successfully from the same machine at the same time, so the network path is healthy and the failure appears specific to Claude Code's bundled HTTP client.
The Claude desktop app's Code tab fails identically with "Connection problem", while regular Claude chat works normally.
Error on every launch:
Welcome to Claude Code v2.1.260
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ECONNRESET
claude --debug produces no additional output beyond the above.
Evidence the network is fine:
- curl -v https://api.anthropic.com → HTTP/2 404, TLS 1.3 handshake completes, valid cert
- node -e "require('https').get('https://api.anthropic.com', r => console.log(r.statusCode))" → 404
- node -e "fetch('https://api.anthropic.com').then(r => console.log(r.status))" → 404
Ruled out:
- Fails on both home Wi-Fi and cellular hotspot
- No VPN — NordVPN removed, systemextensionsctl list → 0 extensions after reboot
- scutil --nc list empty
- No proxy — env | grep -i proxy empty, scutil --proxy shows defaults only
- No ANTHROPIC_* env vars
- Fresh config — rm -rf ~/.claude ~/.claude.json, still fails
- Clean npm reinstall after removing native install at ~/.local/share/claude
- Fails on both 2.1.251 and 2.1.260
- IPv6 disabled at the interface, no change
- DNS switched to
### What Should Happen?
Claude Code should connect to api.anthropic.com and start a session.
### Error Messages/Logs
```shell
$ claude
Welcome to Claude Code v2.1.260
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ECONNRESET
Please check your internet connection and network settings.
Note: Claude Code might not be available in your country. Check supported
countries at https://anthropic.com/supported-countries
$ curl -v https://api.anthropic.com
< HTTP/2 404
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* Server certificate: CN=api.anthropic.com, issuer Google Trust Services
* server: cloudflare
$ node -e "require('https').get('https://api.anthropic.com', r => console.log('Status:', r.statusCode))"
Status: 404
$ node -e "fetch('https://api.anthropic.com').then(r => console.log('Status:', r.status))"
Status: 404
```
### Steps to Reproduce
1. Run `claude` in Terminal on macOS
2. It fails immediately with "Failed to connect to api.anthropic.com: ECONNRESET"
3. Run `curl -v https://api.anthropic.com` from the same shell — returns HTTP 404 successfully
4.
### Claude Model
None
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
_No response_
### Claude Code Version
2.1.260 (Claude Code)
### Platform
Anthropic API
### Operating System
macOS
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
claude doctor output:
Running: native (2.1.260)
Platform: darwin-arm64
Config install method: native
Search: OK (bundled)
Auto-updates: enabled
No installation issues found.
Node: v24.14.1
Plan: Pro
Installed via: sudo npm install -g @anthropic-ai/claude-code (which claude → /usr/local/bin/claude)
Additional note: IPv6 to api.anthropic.com resets during the TLS handshake
(curl -6 → "Recv failure: Connection reset by peer"), while IPv4 succeeds.
However, disabling IPv6 at the interface did not resolve the issue, and curl,
node https, and node fetch all fall back to IPv4 without problems.
Also tested: the Claude desktop app's Code tab fails identically with
"Connection problem". Regular Claude chat works normally on the same machine
at the same time.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start by reproducing the failure with the `claude` entry point on macOS, then compare its connection behavior with the reported `curl`, Node `https`, and Node `fetch` commands. The issue is done when Claude Code starts a session against api.anthropic.com without ECONNRESET and the regression is covered by an appropriate test.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- macos, node.js
- Domaine
- api, networking
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- À clarifier
- Accessibilité débutants
- 38/100