VS Code extension ignores proxy settings from ~/.claude/settings.json and environment variables
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
- Configure proxy in
~/.claude/settings.jsonas shown above - Configure proxy in VS Code settings as shown above
- 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
- Try to use Claude Code extension - it hangs on "Imagining..." and cannot connect to the API
- In the same terminal, run
claudeCLI - 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:
~/.claude/settings.jsonenvsection (shared with CLI)- VS Code's
http.proxysetting HTTP_PROXY/HTTPS_PROXYenvironment 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.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗