VS Code extension ignores proxy settings from ~/.claude/settings.json and environment variables

Resolved 💬 8 comments Opened Dec 29, 2025 by larryro Closed Mar 27, 2026

Description

The VS Code extension does not respect proxy settings, while the CLI works correctly with the same configuration.

Environment

  • OS: Linux (Ubuntu)
  • CLI Version: 2.0.76
  • VS Code Extension Version: 2.0.75

Configuration

~/.claude/settings.json

{
  "model": "opus",
  "env": {
    "BASH_DEFAULT_TIMEOUT_MS": "600000",
    "BASH_MAX_TIMEOUT_MS": "1800000",
    "HTTP_PROXY": "http://127.0.0.1:10808",
    "HTTPS_PROXY": "http://127.0.0.1:10808"
  }
}

VS Code settings.json

{
  "http.proxySupport": "on",
  "http.proxy": "http://127.0.0.1:10808",
  "http.proxyStrictSSL": false,
  "claudeCode.environmentVariables": [
    { "name": "HTTP_PROXY", "value": "http://127.0.0.1:10808" },
    { "name": "HTTPS_PROXY", "value": "http://127.0.0.1:10808" }
  ]
}

Behavior

| Setting | CLI | VS Code Extension |
|---------|-----|-------------------|
| ~/.claude/settings.json env vars | ✅ Works | ❌ Ignored |
| Shell HTTP_PROXY / HTTPS_PROXY | ✅ Works | ❌ Ignored |
| VS Code http.proxy setting | N/A | ❌ Ignored |

Steps to Reproduce

  1. Configure proxy in ~/.claude/settings.json as shown above
  2. Configure proxy in VS Code settings as shown above
  3. Launch VS Code with proxy environment variables:

``bash
export HTTP_PROXY=http://127.0.0.1:10808
export HTTPS_PROXY=http://127.0.0.1:10808
code --proxy-server=http://127.0.0.1:10808
``

  1. Try to use Claude Code extension - it hangs on "Imagining..." and cannot connect to the API
  2. In the same terminal, run claude CLI - it works correctly

Verification

The proxy itself works correctly:

curl -x http://127.0.0.1:10808 https://api.anthropic.com/v1/messages
# Successfully connects through proxy

Expected Behavior

The VS Code extension should respect proxy settings from:

  1. ~/.claude/settings.json env section (shared with CLI)
  2. VS Code's http.proxy setting
  3. HTTP_PROXY / HTTPS_PROXY environment variables

Workaround

Currently the only workaround is to use proxychains4 to force the proxy:

proxychains4 code

Root Cause (Suspected)

Node.js native fetch (used by the Anthropic SDK) does not automatically respect HTTP_PROXY environment variables. The extension may need to configure a proxy-aware HTTP agent.

View original on GitHub ↗

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