[BUG]
Preflight Checklist
- [x] I have searched existing issues 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 fails to connect to the API on every single command, including a plain "hello" prompt, with "Connection refused — a firewall or proxy may be blocking it (ConnectionRefused)", retrying through all 10 attempts and never succeeding. This happens on every launch, consistently and reproducibly.
Network connectivity itself is confirmed healthy: curl -v https://api.anthropic.com/v1/messages succeeds (TLS 1.3 handshake, HTTP/2, expected 405 response, resolved to 160.79.104.10). The failure is specific to Claude Code's HTTP client, not the network.
Environment Info
Platform: macOS (darwin), Apple Silicon
Architecture: arm64 (confirmed via file $(which claude) — Mach-O 64-bit executable arm64, matches uname -m — arm64, so no architecture mismatch)
Claude Code Version: 2.1.266 (native installer, already latest per claude update)
Terminal: default macOS Terminal
What Should Happen?
Claude Code should connect to the Anthropic API normally, the same way curl does from the identical machine and network.
Error Messages/Logs
✻ Connection refused — a firewall or proxy may be blocking it (ConnectionRefused) · Retrying in 1s · attempt 2/10
Steps to Reproduce
Launch claude
Enter any prompt, e.g. hello
Immediately get Connection refused (ConnectionRefused), retrying, all 10 attempts fail
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.266 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_