Claude works in the browser but Claude Code can't connect: a 7-step proxy checklist A developer at NailongVPN published a seven-step checklist for fixing Claude Code connection timeouts that occur when claude.ai loads fine in a browser but the terminal CLI cannot reach Anthropic's API. The guide attributes most failures to proxy environment variables not being set in the launching shell, SOCKS addresses (which Claude Code does not support), or NO_PROXY exclusions, and recommends setting HTTPS_PROXY and HTTP_PROXY with an http:// prefix, verifying via /status and claude --debug, and persisting the values in the env block of ~/.claude/settings.json so background agents inherit them. If claude.ai loads in your browser but Claude Code times out in the terminal, the browser is using your system proxy and the CLI is not. Claude Code is a terminal process and only reads proxy environment variables. In almost every case the cause is one of three things. The variable is not set in the shell that launched it, the address is a SOCKS address, or NO PROXY is excluding the request. Each step below gives you an answer in under a minute. Facts come from the official Claude Code network configuration page, checked on 15 November 2026. Open the settings of Clash Verge Rev, FlClash or whatever client you run and look for the HTTP port or mixed port. 7890 and 7897 are common. Use the number your own client shows. A subscription URL is not a proxy address. Neither is the remote port of a node. You need the port your client listens on locally. zsh or bash on macOS and Linux export HTTPS PROXY="http://127.0.0.1:7890" export HTTP PROXY="$HTTPS PROXY" claude PowerShell on Windows has no export command $env:HTTPS PROXY = "http://127.0.0.1:7890" $env:HTTP PROXY = $env:HTTPS PROXY claude Claude Code reads these variables once at startup. Quit the running session and start it again after any change. The docs state that Claude Code does not support SOCKS proxies. An address starting with socks5:// will not work. Use the HTTP or mixed port with an http:// prefix. The name HTTPS PROXY describes the kind of request being proxied. The local proxy address itself still starts with http://. Claude Code uses the first one that is set, in this order A lowercase https proxy left in your .zshrc years ago will override the uppercase one you just exported. env | grep -i proxy echo $NO PROXY $no proxy If it contains anthropic.com, claude.ai or a bare asterisk, those requests skip the proxy. Entries can be separated by spaces or commas, and an asterisk bypasses everything. On a work laptop, remove only the entry that is in the way. Run /status inside a session and read the Proxy row. It shows the active proxy URL and marks a value it cannot parse as invalid. If the address is missing its http:// scheme, Claude Code stops at launch with an error that names the variable. For more detail, start with debug logging claude --debug The log goes to ~/.claude/debug/ and is not printed in the terminal. curl -x http://127.0.0.1:7890 -I https://api.anthropic.com If response headers come back, the path from your terminal through the proxy works and the problem is in the variables. If it times out or the connection is refused, the problem is the client or the node, so go back to step 1. WSL, containers and remote servers. Inside these, 127.0.0.1 is the environment itself, not the client on your Windows or Mac host. Use an address the environment can reach and enable LAN access in the client. Making it permanent, and background agents. Put the variables in the env block of ~/.claude/settings.json. The docs point out that background agents do not inherit the shell you are typing in, so settings are the only place that reaches them reliably. { "env": { "HTTPS PROXY": "http://127.0.0.1:7890", "HTTP PROXY": "http://127.0.0.1:7890" } } Miss one and sign-in hangs. Disclosure. I work on NailongVPN nailongvpn.com and wrote this while helping users debug. A longer version covering Cursor, GitHub Copilot and API errors is at https://nailongvpn.com/en/ai-connectivity https://nailongvpn.com/en/ai-connectivity