{"id":1143,"date":"2026-12-05T22:07:12","date_gmt":"2026-12-05T20:07:12","guid":{"rendered":"https:\/\/mexela.com\/blog\/claude-code-proxy\/"},"modified":"2026-12-05T22:07:12","modified_gmt":"2026-12-05T20:07:12","slug":"claude-code-proxy","status":"publish","type":"post","link":"https:\/\/mexela.com\/blog\/claude-code-proxy\/","title":{"rendered":"How to Use Claude Code Behind a Corporate Proxy"},"content":{"rendered":"<p>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.<\/p>\n<h2 id=\"claude-settings\">Configure the process that runs Claude Code<\/h2>\n<p>For a terminal session, put the approved proxy URL in <code>HTTPS_PROXY<\/code> or <code>HTTP_PROXY<\/code> before launching Claude Code. The scheme in the value describes the connection <em>to the proxy<\/em>; it does not change an HTTPS API into an HTTP destination. Anthropic documents the lookup order as lowercase <code>https_proxy<\/code>, uppercase <code>HTTPS_PROXY<\/code>, lowercase <code>http_proxy<\/code>, then uppercase <code>HTTP_PROXY<\/code>. 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.<\/p>\n<p>Use <code>NO_PROXY<\/code> 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 <a href=\"https:\/\/code.claude.com\/docs\/en\/network-config\">Anthropic\u2019s network configuration and scope rules<\/a> and the <a href=\"\/blog\/http-proxy-https-proxy-no-proxy\/\">general proxy environment guide<\/a>.<\/p>\n<h2 id=\"test-tunnel\">Test the tunnel before troubleshooting Claude Code<\/h2>\n<p>In PowerShell 7, set <code>MEXELA_CORPORATE_PROXY<\/code> to the approved proxy URL, <code>MEXELA_APPROVED_STATUS_URL<\/code> to a permitted HTTPS status endpoint that supports HEAD, and <code>MEXELA_TEST_CA<\/code> 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.<\/p>\n<pre id=\"claude-connect\"><code class=\"language-powershell\">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\"<\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th>Observation<\/th>\n<th>What to check next<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CONNECT 200, origin 401<\/td>\n<td>The tunnel reached an HTTPS endpoint that wants credentials. This does not mean Claude Code is signed in.<\/td>\n<\/tr>\n<tr>\n<td>407 at CONNECT<\/td>\n<td>The proxy expects different authentication. Check the approved method with your network team.<\/td>\n<\/tr>\n<tr>\n<td>Certificate validation failed<\/td>\n<td>Check the organization\u2019s trust chain and the endpoint name. Do not turn off validation.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"claude-limits\">Know when the proxy is not the problem<\/h2>\n<p>Anthropic does not document SOCKS proxies as supported for Claude Code. Where the company inspects TLS, follow the documented certificate procedure, including <code>NODE_EXTRA_CA_CERTS<\/code> 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.<\/p>\n<p>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 <a href=\"\/blog\/proxy-setup-developer-guides\/\">developer integration hub<\/a> has separate client guides.<\/p>\n<p><strong>Verification, December 5, 2026:<\/strong> 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure Claude Code to use an approved corporate proxy. Check the proxy tunnel and origin response separately without exposing API keys or disabling TLS.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[189],"tags":[],"_links":{"self":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1143"}],"collection":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/comments?post=1143"}],"version-history":[{"count":0,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1143\/revisions"}],"wp:attachment":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/media?parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/categories?post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/tags?post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}