[BUG] HTTPS_PROXY is not applied to the Anthropic API POST requests when set in ~/.claude/settings.json

Resolved 💬 7 comments Opened Nov 15, 2025 by bobilumia Closed Mar 1, 2026

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?

HTTPS_PROXY behaves differently when set using an environment variable and when set using settings.json.

With HTTPS_PROXY defined using export HTTPS_PROXY=..., everything works as expected and the Anthropic API POST requests go through the proxy.
When HTTPS_PROXY is defined in settings.json (and not in the environment variable), some of the traffic goes through the proxy, but the Anthropic API POST requests go directly to the internet and bypass the proxy.

What Should Happen?

HTTPS_PROXY in settings.json should apply to the Anthropic API POST requests, as if it was defined using the environment variable.

Error Messages/Logs

Steps to Reproduce

Prerequisites: install mitmproxy

  1. Open the macOS Terminal.
  2. Run:

export NODE_EXTRA_CA_CERTS=/Users/username/.mitmproxy/mitmproxy-ca-cert.pem
_(Replace the path with the location of your mitmproxy certificate.)_

  1. Run:

export HTTPS_PROXY=http://127.0.0.1:8080/

  1. In another Terminal window, run:

mitmproxy --set view_filter=https://api.anthropic.com/v1

  1. Run:

claude

  1. Observe the api.anthropic.com POST requests appearing in mitmproxy:

<img width="854" height="451" alt="Image" src="https://github.com/user-attachments/assets/07a763a5-a5e0-4c8b-99fb-19cd2c426033" />

  1. Close claude.
  2. Run:

unset HTTPS_PROXY

  1. Set ~/.claude/settings.json as follows:
{
"env": { "HTTPS_PROXY": "http://127.0.0.1:8080" }
}
  1. Clear the mitmproxy flows window.
  2. Run claude again.
  3. Observe that the api.anthropic.com POST requests no longer appear in mitmproxy:

<img width="849" height="450" alt="Image" src="https://github.com/user-attachments/assets/92453e95-f74e-477a-9796-bf9953c9441d" />

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.42 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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