{"slug": "claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy", "title": "Claude works in the browser but Claude Code can't connect: a 7-step proxy checklist", "summary": "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.", "body_md": "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.\n\nEach 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.\n\nOpen 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.\n\nA subscription URL is not a proxy address. Neither is the remote port of a node. You need the port your client listens on locally.\n\nzsh or bash on macOS and Linux\n\n```\nexport HTTPS_PROXY=\"http://127.0.0.1:7890\"\nexport HTTP_PROXY=\"$HTTPS_PROXY\"\nclaude\n```\n\nPowerShell on Windows has no export command\n\n```\n$env:HTTPS_PROXY = \"http://127.0.0.1:7890\"\n$env:HTTP_PROXY = $env:HTTPS_PROXY\nclaude\n```\n\nClaude Code reads these variables once at startup. Quit the running session and start it again after any change.\n\nThe 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.\n\nThe name HTTPS_PROXY describes the kind of request being proxied. The local proxy address itself still starts with http://.\n\nClaude Code uses the first one that is set, in this order\n\nA lowercase https_proxy left in your .zshrc years ago will override the uppercase one you just exported.\n\n```\nenv | grep -i proxy\necho $NO_PROXY $no_proxy\n```\n\nIf 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.\n\nRun /status inside a session and read the Proxy row. It shows the active proxy URL and marks a value it cannot parse as invalid.\n\nIf the address is missing its http:// scheme, Claude Code stops at launch with an error that names the variable.\n\nFor more detail, start with debug logging\n\n```\nclaude --debug\n```\n\nThe log goes to ~/.claude/debug/ and is not printed in the terminal.\n\n```\ncurl -x http://127.0.0.1:7890 -I https://api.anthropic.com\n```\n\nIf 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.\n\n**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.\n\n**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.\n\n```\n{\n  \"env\": {\n    \"HTTPS_PROXY\": \"http://127.0.0.1:7890\",\n    \"HTTP_PROXY\": \"http://127.0.0.1:7890\"\n  }\n}\n```\n\nMiss one and sign-in hangs.\n\nDisclosure. 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)", "url": "https://wpnews.pro/news/claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy", "canonical_source": "https://dev.to/anticheatin/claude-works-in-the-browser-but-claude-code-cant-connect-a-7-step-proxy-checklist-38o6", "published_at": "2026-11-15 06:05:30+00:00", "updated_at": "2026-11-15 06:21:51.688283+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["Claude Code", "Anthropic", "NailongVPN", "Clash Verge Rev", "FlClash"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy", "markdown": "https://wpnews.pro/news/claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy.md", "text": "https://wpnews.pro/news/claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy.txt", "jsonld": "https://wpnews.pro/news/claude-works-in-the-browser-but-claude-code-can-t-connect-a-7-step-proxy.jsonld"}}