How to Use Claude Code Behind a Corporate Proxy

Configure Claude Code to use an approved corporate proxy. Check the proxy tunnel and origin response separately without exposing API keys or disabling TLS.

Written by the Mexela Editorial Team. Technical guides are reviewed by the Mexela Technical Team under the Mexela Editorial Policy.

PROXY OPTIONS

Choose a proxy endpoint for this integration

After verifying the configured client, compare private proxy options and pricing. Check the endpoint protocol, authentication and destination compatibility for the runtime that will make your requests.

Claude Code can use a corporate HTTP or HTTPS proxy. Start with the approved proxy address from your network team, verify that it can reach the right destination, and then start a fresh Claude Code session. A working browser is not enough: the terminal and the desktop app can use different settings.

Configure the process that runs Claude Code

For a terminal session, put the approved proxy URL in HTTPS_PROXY or HTTP_PROXY before launching Claude Code. The scheme in the value describes the connection to the proxy; it does not change an HTTPS API into an HTTP destination. Anthropic documents the lookup order as lowercase https_proxy, uppercase HTTPS_PROXY, lowercase http_proxy, then uppercase HTTP_PROXY. If a stale variable has higher priority, changing the later one will not fix the route. Compare variable names without dumping their values into logs.

Use NO_PROXY only for the destinations your organization exempts. A remote MCP connection and an IDE or Claude Desktop session are not necessarily governed by the same settings as a fresh terminal. See Anthropic’s network configuration and scope rules and the general proxy environment guide.

Test the tunnel before troubleshooting Claude Code

In PowerShell 7, set MEXELA_CORPORATE_PROXY to the approved proxy URL, MEXELA_APPROVED_STATUS_URL to a permitted HTTPS status endpoint that supports HEAD, and MEXELA_TEST_CA to the approved origin trust bundle in PEM format. Use a URL without tokens or API keys. This isolates connectivity; it does not call Claude or send a prompt.

curl.exe --silent --show-error --head --output NUL --connect-timeout 5 --max-time 10 --noproxy "" --proxy "$env:MEXELA_CORPORATE_PROXY" --cacert "$env:MEXELA_TEST_CA" --write-out "CONNECT=%{http_connect} origin=%{http_code}\n" "$env:MEXELA_APPROVED_STATUS_URL"
Observation What to check next
CONNECT 200, origin 401 The tunnel reached an HTTPS endpoint that wants credentials. This does not mean Claude Code is signed in.
407 at CONNECT The proxy expects different authentication. Check the approved method with your network team.
Certificate validation failed Check the organization’s trust chain and the endpoint name. Do not turn off validation.

Know when the proxy is not the problem

Anthropic does not document SOCKS proxies as supported for Claude Code. Where the company inspects TLS, follow the documented certificate procedure, including NODE_EXTRA_CA_CERTS where applicable, and restart the process after changing startup variables. The certificate file in the curl command applies to curl, not Claude Code. Keep proxy credentials out of shared configuration, shell history, screenshots and diagnostic output.

Once the curl check passes, compare it with a fresh Claude Code session in the same terminal and with the same approved proxy assignment. If only Claude Code fails, check environment inheritance, provider-specific destinations and client settings before replacing a proxy. The developer integration hub has separate client guides.

Verification, December 5, 2026: The PowerShell curl example was exercised with a local HTTPS origin and CONNECT proxy. The fixture returned CONNECT 200 and origin 401; missing trust material failed before an origin request. Claude sign-in, model calls and corporate certificate policy were not part of this test.