Preflight Checklist
What's Wrong?
Claude Code v2.1.83 completely ignores NO_PROXY. When proxy environment variables are set (HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY), Claude Code routes all API requests through the forward proxy, even when the target is listed in NO_PROXY. This causes 502 errors when the forward proxy cannot properly handle the streaming API connection.
This is a regression — issue #22004 was reportedly fixed in 2.1.38 but the bug has returned in 2.1.83.
What Should Happen?
Claude Code should respect NO_PROXY and bypass the forward proxy for destinations listed in it, matching the documented behavior:
Bypass proxy for specific requests - space-separated format
export NO_PROXY="localhost 192.168.1.1 example.com .example.com"
Verified Test Matrix
Tested with claude -p "say ok" --model <model> against a local API proxy:
| Test |
Proxy Env Set |
NO_PROXY Value |
Result |
| 1 |
None |
None |
EXIT 0 (works) |
| 2 |
ALL_PROXY=socks5://... |
— |
502 (fails) |
| 3 |
HTTP_PROXY, HTTPS_PROXY |
— |
502 (fails) |
| 4 |
All proxies |
* |
502 (fails) |
| 5 |
HTTP_PROXY, HTTPS_PROXY |
localhost 127.0.0.1 <target-ip> |
502 (fails) |
| 6 |
ALL_PROXY=socks5://... |
localhost 127.0.0.1 <target-ip> |
502 (fails) |
Additional Observations
curl correctly respects NO_PROXY with the same environment — only Claude Code is affected
- Setting proxy vars to empty string in settings.json env also does not work (the shell env vars still take priority)
- The only workaround is to unset proxy vars entirely before launching:
HTTP_PROXY="" HTTPS_PROXY="" ALL_PROXY="" claude
NO_PROXY="*" has no effect — documented to bypass all, but is ignored
- SOCKS proxy (
ALL_PROXY=socks5://...) is not supported per docs, but Claude Code still attempts to use it instead of falling back to direct connection
- The 502 errors come from the forward proxy — the target API server's logs show zero incoming requests during failed tests
Steps to Reproduce
- Have a forward proxy running (e.g.,
export HTTP_PROXY=http://proxy:8080)
- Have a local API endpoint that works via
curl (bypasses proxy via NO_PROXY)
- Configure
ANTHROPIC_BASE_URL to point to the local endpoint
- Set
NO_PROXY to include the local endpoint's IP
- Run
claude -p "hello" — observe 502 errors
- Run
HTTP_PROXY="" HTTPS_PROXY="" claude -p "hello" — observe success
Claude Code Version
2.1.83
Platform
Linux (native binary)
Related Issues
Preflight Checklist
What's Wrong?
Claude Code v2.1.83 completely ignores
NO_PROXY. When proxy environment variables are set (HTTP_PROXY,HTTPS_PROXY, orALL_PROXY), Claude Code routes all API requests through the forward proxy, even when the target is listed inNO_PROXY. This causes 502 errors when the forward proxy cannot properly handle the streaming API connection.This is a regression — issue #22004 was reportedly fixed in 2.1.38 but the bug has returned in 2.1.83.
What Should Happen?
Claude Code should respect
NO_PROXYand bypass the forward proxy for destinations listed in it, matching the documented behavior:Verified Test Matrix
Tested with
claude -p "say ok" --model <model>against a local API proxy:ALL_PROXY=socks5://...HTTP_PROXY,HTTPS_PROXY*HTTP_PROXY,HTTPS_PROXYlocalhost 127.0.0.1 <target-ip>ALL_PROXY=socks5://...localhost 127.0.0.1 <target-ip>Additional Observations
curlcorrectly respectsNO_PROXYwith the same environment — only Claude Code is affectedHTTP_PROXY="" HTTPS_PROXY="" ALL_PROXY="" claudeNO_PROXY="*"has no effect — documented to bypass all, but is ignoredALL_PROXY=socks5://...) is not supported per docs, but Claude Code still attempts to use it instead of falling back to direct connectionSteps to Reproduce
export HTTP_PROXY=http://proxy:8080)curl(bypasses proxy viaNO_PROXY)ANTHROPIC_BASE_URLto point to the local endpointNO_PROXYto include the local endpoint's IPclaude -p "hello"— observe 502 errorsHTTP_PROXY="" HTTPS_PROXY="" claude -p "hello"— observe successClaude Code Version
2.1.83
Platform
Linux (native binary)
Related Issues