A proxy is a go-between server that Claude Code can send its network traffic through. CLAUDE_CODE_PROXY_RESOLVES_HOSTS is an environment variable, a setting passed to Claude Code from your shell. It is now listed with the other proxy variables, such as HTTPS_PROXY, NO_PROXY, CLAUDE_CODE_HTTP_PROXY and CLAUDE_CODE_HTTPS_PROXY.
When it is set and your machine cannot look up a server name (the lookup fails with EAI_AGAIN or ENOTFOUND), a websocket connection, a long-lived two-way link to a server, is now left to the proxy to resolve. Before, Claude Code stopped with a "could not resolve" error. Some names are never handed over:
names that mean your own machine (loopback)
names that point at cloud metadata services
names with an empty part, such as two dots in a row
Why
On networks where only the proxy can look up outside names, such as sandboxed or proxy-only setups, these connections can now go through instead of failing at the name lookup.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added sinceA small documentation edit on Connect Claude Code to Claude for Government touched a line naming HTTPS_PROXY after this was published.If your devices use a web proxy that you manage, add `HTTPS_PROXY` and `HTTP_PROXY` (the proxy's address, for example `http://proxy.example.corp:8080`) and `NO_PROXY` (your bypass list, keeping `localhost`, `127.0.0.1`, and `::1`) to the s…government/deploy-claude-code/configuresee the edit
Added sinceA small documentation edit on Connect Claude Code to Claude for Government touched a line naming NO_PROXY after this was published.If your devices use a web proxy that you manage, add `HTTPS_PROXY` and `HTTP_PROXY` (the proxy's address, for example `http://proxy.example.corp:8080`) and `NO_PROXY` (your bypass list, keeping `localhost`, `127.0.0.1`, and `::1`) to the s…government/deploy-claude-code/configuresee the edit
Confirmed sinceAnthropic's documentation has since written up NO_PROXY, on Network proxy.* **Marketplace credential helpers.** Unless the environment that starts Claude Desktop already sets proxy variables, a plugin marketplace's [`credentialHelper`](https://claude.com/docs/third-party/claude-desktop/extensions#how-a-marketpla…third-party/claude-desktop/network-proxysee the edit
Confirmed sinceAnthropic's documentation has since written up HTTPS_PROXY, on MCP, plugins, skills, and hooks.* **Proxy**: the executable gets `HTTPS_PROXY` and `HTTP_PROXY` for the marketplace's host. If the server that issues your token needs a different proxy, set it inside the executable. For details, see [Traffic that bypasses the app proxy](…third-party/claude-desktop/extensionssee the edit
Confirmed sinceAnthropic's documentation has since written up CLAUDE_CODE_PROXY_RESOLVES_HOSTS, on Tools reference.If a watch behind a proxy fails with `could not resolve <host>`, restart Claude Code v2.1.319 or later with [`CLAUDE_CODE_PROXY_RESOLVES_HOSTS`](https://code.claude.com/docs/en/env-vars#variables) set to `1` so the proxy looks up the hostn…tools-referencesee the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhat setting `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` actually changes is not stated.
Anthropic's documentation agreesAnthropic's documentation has since written up CLAUDE_CODE_PROXY_RESOLVES_HOSTS, on Tools reference.
Anthropic's release notes agreeFixed Monitor's WebSocket watch failing with "could not resolve" behind a proxy when CLAUDE_CODE_PROXY_RESOLVES_HOSTS is set and the machine…