Claude Code "Connection error" / "fetch failed": causes and fixes

Is there an outage right now?

Claude Code official status is operational. If this error persists, it is likely an implementation or environment issue on your side.

View Claude Code status

What this error means

Claude Code cannot reach the Anthropic API (api.anthropic.com). Causes include network, corporate proxy/firewall, DNS, TLS (clock skew), or an API-side outage.

Common causes

  • Unstable network or offline
  • Corporate proxy/firewall blocking api.anthropic.com
  • Blocked via VPN / zero-trust
  • DNS resolution failure
  • System clock skew breaking TLS verification
  • Anthropic API-side outage

How to fix

  1. 1.Check your network and reconnect
  2. 2.Set HTTPS_PROXY / HTTP_PROXY correctly behind a proxy
  3. 3.Allow traffic to api.anthropic.com in firewall/VPN
  4. 4.Change DNS / reconnect
  5. 5.Set the correct system date and time
  6. 6.Wait and retry
  7. 7.Check status at top of page and Claude API

When waiting helps (and when it won't)

If API-side, it recovers over time. Most cases are your own network/proxy config—waiting will not help, so check the items above.

Alternatives when Claude Code is down

CodexCursorGitHub CopilotClineWindsurfContinue

Related errors

FAQ

What is Connection error / fetch failed?

Claude Code cannot reach the Anthropic API (api.anthropic.com). Causes include network, corporate proxy/firewall, DNS, TLS (clock skew), or an API-side outage.

How do I fix Connection error / fetch failed?

Check your network and reconnect / Set HTTPS_PROXY / HTTP_PROXY correctly behind a proxy / Allow traffic to api.anthropic.com in firewall/VPN / Change DNS / reconnect / Set the correct system date and time / Wait and retry / Check status at top of page and Claude API

Compare Claude Code with others