What is the exact message?
The heading is always the same, and one or more reason lines follow it. Anthropic prints an example shaped like this:
Unable to connect to Anthropic servicesThe line under it names what failed, and differs from machine to machine. Anthropic's examples:
Failed to connect to api.anthropic.com: ECONNREFUSEDConnection to api.anthropic.com timed out after 10 secondsA proxy is configured via HTTPS_PROXY. Check that it allows connections to the host above.Your machine prints one failure reason, not all of them. Anthropic documents that when either check fails, Claude Code prints the reason and exits, and that when the failed probe went through a proxy the message also names the environment variable that configured it — so the proxy line in the last example arrives in addition to a failure line, not instead of one.
What does it mean?
During first-run setup, before showing the sign-in step, Claude Code checks that it can reach api.anthropic.com and platform.claude.com. When either check fails it prints the reason and exits. So this message is the product refusing to start a sign-in it knows cannot work, rather than a request that was tried and lost.
The check is sent through the same proxy configuration as API requests, and each probe is given 10 seconds. That is why the message can name HTTPS_PROXY: it is reporting the hop the probe actually used.
What causes it
- A proxy that does not allow these two hosts. The message names the variable, so the fix is on that proxy's allowlist.
- A proxy URL with the
https://scheme on an older version. Anthropic documents that before v2.1.222 the check used a different proxy transport with no timeout, so it could stall onChecking connectivity...indefinitely and then fail, even though API requests through the same proxy succeeded. - A network that is genuinely open but cannot reach Anthropic. Anthropic names the honest dead end: Claude Code may not be available in your country.
How do I fix it?
- Print the proxy variables in the shell you start
claudefrom. Anthropic documents that Claude Code readshttps_proxy,HTTPS_PROXY,http_proxyandHTTP_PROXY, using the first one that is set.echo $HTTPS_PROXYon macOS or Linux,echo $env:HTTPS_PROXYin PowerShell. If one is set, that is the hop the probe had to cross. - If the message names a proxy variable, check its value, then ask the network team to allow the host. Anthropic's step is to confirm the value points at the right proxy and ask for HTTPS to the host in the message. The check probes
api.anthropic.comandplatform.claude.com, so allow both while the request is open. - Work through the API connection checks. Anthropic points at the same
curltest and firewall guidance it gives for Claude Code connection errors; they apply to this probe too. - If you are on a version before v2.1.222 and your proxy URL starts with
https://, update. Anthropic documents that behaviour as the old check's: before v2.1.222 it used a different proxy transport with no timeout, so it could sit onChecking connectivity...indefinitely and then fail even though API requests through the same proxy work. - If your network is open and it still fails, check availability. Anthropic's own next step is its list of supported countries.
When the check is skipped
Anthropic documents four cases where the check does not run at all, because the sign-in is going somewhere other than Anthropic's own endpoints:
- A managed settings file, an MDM policy or a policy helper sets
forceLoginMethodto"gateway". - One of those sources sets
forceLoginGatewayUrlwithoutforceLoginMethod. - A managed settings source on the machine exists but cannot be read, since that source may hold the gateway configuration.
- On a machine with no managed settings, your own
~/.claude/settings.jsonnames a gateway withforceLoginMethodandforceLoginGatewayUrl.
With the first two, Claude Code opens the sign-in step on the Cloud gateway screen rather than an Anthropic sign-in method. Every one of the four needs a managed-settings source, or a gateway named in your own settings file, so if you have never configured a gateway the check is running on your machine.
How do I know it is fixed?
- Claude Code gets past the check and shows the sign-in step, instead of printing the reason and exiting.
- The probe finishes well inside its 10 seconds rather than running to the limit.
- After signing in, an ordinary turn works — which confirms the same proxy path carries model requests, not only the check.
Where these answers come from
- The message lines, the two hosts, the 10-second probes, the proxy variable naming, the pre-v2.1.222 stall, every configuration that skips the check and the fix steps: Anthropic's error reference, read November 20, 2026.
- The proxy configuration the check shares with API requests: Anthropic's network configuration page, read November 20, 2026.
forceLoginMethodandforceLoginGatewayUrl: Anthropic's settings reference, read November 20, 2026.
Common questions
Why does this appear before I have signed in?
Because it is a check, not a failed request. Anthropic documents that during first-run setup Claude Code checks it can reach api.anthropic.com and platform.claude.com before showing the sign-in step, and exits with the reason when either check fails.
What does the ten seconds refer to?
Each probe gets ten seconds. Anthropic documents that Claude Code sends the check through the same proxy configuration as API requests and gives each probe 10 seconds.
Why does the API work while this fails?
Before v2.1.222 the check used a different proxy transport with no timeout, so behind a proxy URL with the https:// scheme it could stall on Checking connectivity... and then fail even though API requests through the same proxy succeed. Updating fixes that specific case.
Can I skip the check?
Only through a gateway configuration. Claude Code skips the check when managed settings, an MDM policy or a policy helper sets forceLoginMethod to gateway, or sets forceLoginGatewayUrl without forceLoginMethod, and in that case the sign-in step opens on the Cloud gateway screen instead. These are administrator settings, not something a home install turns off.
Which host is failing?
The line under the message names it — api.anthropic.com or platform.claude.com. The check probes both, so it is worth allowing both on the proxy while you are fixing the one the message named.