Unable to connect to API (ConnectionRefused) — retries exhausted, never connects
Bug Description
Claude Code cannot connect to the API. On startup (and on any command), it repeatedly fails with:
Unable to connect to API (ConnectionRefused) · Retrying in 11s · attempt 8/10
It cycles through all 10 retry attempts and never connects, so Claude Code is completely unusable locally. The failure is consistent and reproducible on every launch. The ConnectionRefused error suggests the connection to api.anthropic.com is being actively rejected rather than timing out.
Notably, the in-app /bug report also hangs at "Submitting report…" and never sends — consistent with the same connection being blocked — so I'm filing here instead.
Steps to Reproduce
- Launch Claude Code in iTerm or VSCode.
- The connection immediately begins retrying.
- All 10 attempts fail with
ConnectionRefused.
Expected: Claude Code connects to the API normally.
Actual: Every connection attempt is refused; the client never reaches the API.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.191
- Feedback ID: 21e73a22-e867-4851-af46-04b8e7606c59
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗