[BUG] NO_PROXY completely ignored — Claude Code v2.1.83 routes all traffic through forward proxy regardless

Resolved 💬 6 comments Opened Mar 27, 2026 by wignerStan Closed Apr 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and found related but stale issues (#22004, #22752)
  • [x] This is a single bug report
  • [x] I am using the latest version (2.1.83)

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

  1. curl correctly respects NO_PROXY with the same environment — only Claude Code is affected
  2. Setting proxy vars to empty string in settings.json env also does not work (the shell env vars still take priority)
  3. The only workaround is to unset proxy vars entirely before launching: HTTP_PROXY="" HTTPS_PROXY="" ALL_PROXY="" claude
  4. NO_PROXY="*" has no effect — documented to bypass all, but is ignored
  5. 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
  6. The 502 errors come from the forward proxy — the target API server's logs show zero incoming requests during failed tests

Steps to Reproduce

  1. Have a forward proxy running (e.g., export HTTP_PROXY=http://proxy:8080)
  2. Have a local API endpoint that works via curl (bypasses proxy via NO_PROXY)
  3. Configure ANTHROPIC_BASE_URL to point to the local endpoint
  4. Set NO_PROXY to include the local endpoint's IP
  5. Run claude -p "hello" — observe 502 errors
  6. Run HTTP_PROXY="" HTTPS_PROXY="" claude -p "hello" — observe success

Claude Code Version

2.1.83

Platform

Linux (native binary)

Related Issues

  • #22004 — marked stale, reportedly fixed in 2.1.38 but regressed
  • #22752 — duplicate of #22004
  • #33642 — OAuth token refresh breaks with forward proxy (related)

View original on GitHub ↗

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