[BUG] settings.json Proxy Configuration Doesn't Work for Claude (But CLI Does)
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?
My app needs to have no proxy to work.
If I do this in ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "<base-url>",
"ANTHROPIC_AUTH_TOKEN": "<token>",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
"CLAUDE_CODE_TELEMETRY_DISABLED": "1",
"https_proxy": "",
"HTTP_PROXY": "",
"http_proxy": "",
"HTTPS_PROXY": ""
},
"model": "haiku"
}
Claude blocks. It takes the proxy that is in my bashrc.
Now, if I do this:
HTTPS_PROXY="" HTTP_PROXY="" https_proxy="" http_proxy="" claude
Claude works.
I should note that I tried NO_PROXY="*", and it doesn't work.
What Should Happen?
Claude should be able to reach my base URL without a proxy, just like it does when we pass proxy arguments with the command.
Error Messages/Logs
❯ bonjour
⎿ API Error: Connection error. (after several minutes)
Steps to Reproduce
Steps to Reproduce
Prerequisites:
- A proxy is configured in your system bashrc (e.g.,
export https_proxy=...) - Your API URL works without the proxy (e.g.,
curl --proxy "" https://<base-url>succeeds)
Test 1 - settings.json (FAILS):
{
"env": {
"ANTHROPIC_BASE_URL": "<base-url>",
"https_proxy": "",
"HTTP_PROXY": "",
"http_proxy": "",
"HTTPS_PROXY": ""
}
}
Result: Claude blocks
Test 2 - CLI (WORKS):
HTTPS_PROXY="" HTTP_PROXY="" https_proxy="" http_proxy="" claude
Result: Claude connects successfully
Expected: Both methods should work the same way.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.25
Platform
Other
Operating System
Other Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
❯ /doctor
Diagnostics └ Currently running: native (2.1.25)
└ Path: /home/<user>/.local/share/claude/versions/2.1.25
└ Invoked: /home/<user>/.local/share/claude/versions/2.1.25
└ Config install method: native
└ Search: OK (bundled)
Updates
└ Auto-updates: enabled
└ Auto-update channel: latest
└ Stable version: 2.1.7
└ Latest version: 2.1.25
Version Locks
└ 2.1.25: PID 180758 (running)
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Ok I installed claude from the binary. Maybe the is the problem.. I'm ready to close exept if someone confirms the bug with others installs ?
I will try with npm later and if yes, it's a duplicate of https://github.com/anthropics/claude-code/issues/14165
Confirming I am seeing this as well. Regardless of how it is provided (bash env or settings.json env) versions newer than 2.1.22 do not honor NO_PROXY.
Do you have Claude's installation via the binary? Or npm ?
This is the binary install. It is affecting everyone on our team.
The issue is still present with the recently released 2.1.29, FYI.
ok thanks for your reply @bhilton
So for now the workaround is to run claude with env vars in the command directly
HTTPS_PROXY="" HTTP_PROXY="" https_proxy="" http_proxy="" NO_PROXY="*" claude
Sorry, I think this Issue may be discussing two different problems.
Duplicate of https://github.com/anthropics/claude-code/issues/22752
Are people still seeing this on 2.1.38+?
2.1.38 fixed one proxy issue for me but I still need to set env variables before running the Claude binary to ensure everything works.
I think the problem is that some underlying libraries will read the proxy variables when Claude starts up and those libraries are not impacted by the changes that Claude Code makes based on the settings.json envs. They already set their internal variables for the proxy and won't reload from the environment.
I don't have this problem anymore (claude 2.1.62)
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.