Claude Code unable to connect through corporate proxy in WSL

Resolved 💬 3 comments Opened Mar 5, 2025 by im-utkarsh Closed Mar 6, 2025

Description
Claude Code is unable to connect to Anthropic services when running behind a corporate proxy.
OS: Windows with WSL (Ubuntu)

Error Message
Unable to connect to Anthropic services

Failed to connect to api.anthropic.com: fetch failed

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

Proxy Configuration Already Set

  • HTTP_PROXY and HTTPS_PROXY environment variables set
  • npm proxy configured using npm config set proxy and npm config set https-proxy
  • Git proxy configured

Required Access
As per documentation, Claude Code needs access to:

  • api.anthropic.com
  • statsig.anthropic.com
  • sentry.io

Expected Behavior
Claude Code should be able to connect to Anthropic services through the corporate proxy in WSL environment.

Actual Behavior
Connection fails with the above error message despite proxy configuration at system and npm level.

Additional Context

  • This appears to be a proxy configuration issue specific to WSL environment
  • All other tools (npm, git) work correctly with the proxy settings

Troubleshooting Steps Taken

  1. Checked that Claude Code is available in my country
  2. Configured proxy settings in WSL environment
  3. Verified other tools can access internet through proxy

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗