Skip to content

Claude Code Login Callback Fails With a Proxy: Fixes

Most proxy login failures come down to an unsupported SOCKS proxy, a browser on the wrong machine or a leftover API key, and the paste-code route finishes login either way.

The three most common causes

The three most common causes
ItemWhat you seeWhat fixes it
SOCKS5 proxy or a proxy URL without http://Startup error naming the proxy variable, or login never connectsUse an HTTP proxy and write the full URL, http://LOGIN:PASSWORD@HOST:PORT
Browser on another machine (WSL2, SSH, container)The browser signs you in, then shows a connection error for a localhost addressSign in through the printed URL and paste the code at "Paste code here"
Leftover ANTHROPIC_API_KEY"This organization has been disabled" or 403 after a successful loginunset ANTHROPIC_API_KEY, remove it from your shell profile, check /status

Source: Claude Code documentation (troubleshooting, authentication and network configuration pages), read 19 November 2026.

How the login is supposed to go

On first launch Claude Code opens a browser window. After you sign in, the browser either goes back to the CLI or shows a login code. When it shows a code, you paste it at the "Paste code here if prompted" prompt, and the terminal ends with "Login successful".

If the browser does not open, press c to copy the login URL and open it yourself. The same works when a long URL wraps in a narrow or SSH terminal.

The proxy variables you export are read by Claude Code when it starts. Your browser has its own proxy settings, so a browser that works on its own does not prove that Claude Code's traffic is going where you think.

Checks in order

  1. Step 1

    Reset the login: type /logout, close Claude Code, run claude again. If the browser does not open, press c and open the URL yourself.

    Expected result The terminal shows "Login successful" and asks you to press Enter.

  2. Step 2

    Use the paste-code route if the browser shows a localhost error or a code: copy the URL, sign in on your own machine and paste the code at "Paste code here". If pasting does nothing, use the terminal's other paste shortcut or run claude auth login instead.

    Before continuing If you see "OAuth error: Invalid code", the code expired or was cut when copied. Press Enter and finish the login quickly.

  3. Step 3

    Check the proxy type and URL: Claude Code does not support SOCKS, and the URL needs the http:// scheme. Start Claude Code, run /status and read the Proxy row; it marks a value it cannot parse as invalid.

  4. Step 4

    Look for a leftover key: run unset ANTHROPIC_API_KEY, remove any export line from ~/.zshrc, ~/.bashrc or ~/.profile, then run /status to confirm the active login method.

  5. Step 5

    Read the log: start claude --debug and open the newest file in ~/.claude/debug/. Look for the host or port that fails.

Proxy variables for Claude Code

# set before launching Claude Code; it reads them once at startup
export HTTPS_PROXY="http://LOGIN:PASSWORD@HOST:PORT"
export HTTP_PROXY="http://LOGIN:PASSWORD@HOST:PORT"
export NO_PROXY="localhost,127.0.0.1"

# sign in, then check the Proxy row
claude
# inside Claude Code: /status

# fallback when the browser cannot return to localhost
claude auth login

# check what exit IP the proxy gives (outside Claude Code)
curl -x "http://LOGIN:PASSWORD@HOST:PORT" https://ipinfo.io/json

Example only: replace the placeholders with your own values. NO_PROXY with localhost is a harmless precaution, not a documented fix for the callback.

Hosts and exit country

Login needs claude.ai and platform.claude.com (the OAuth token exchange goes through the latter); sign-in opens a claude.com page that redirects to claude.ai; SSO organizations also need sso.claude.com; model traffic goes to api.anthropic.com. If a filter between you and the proxy blocks one of them, login fails even though the proxy itself works.

The exit IP's country matters too. Anthropic publishes the list of countries it supports, and a 403 on the install host is described in the docs as usually a proxy or filter, or an unsupported region. Check the exit with the curl line above before you change anything else.

Specific symptoms

Browser says it cannot reach localhost after you approve

Check Are you on WSL2, SSH or a container, so that the browser runs on a different machine than Claude Code?

Fix Use the printed login URL on your own machine and paste the code at "Paste code here", or run claude auth login.

Stop when Once login says "Login successful", do not keep changing proxy settings.

Login works without the proxy but not with it

Check Run /status and read the Proxy row; check the scheme and that the proxy is HTTP, not SOCKS5.

Fix Switch to an HTTP proxy with a full URL and restart Claude Code, because variables are read only at startup.

Stop when If /status shows the right proxy and the log still fails on one host, ask whoever manages the filter to allow the hosts in the previous section.

403 or "organization has been disabled" right after login

Check Is ANTHROPIC_API_KEY set in your shell profile, and is your subscription active?

Fix unset ANTHROPIC_API_KEY, remove it from the profile and confirm with /status.

Stop when If the subscription itself is not active, a proxy cannot fix it.

A fixed HTTP exit for Claude Code with Proxy302

  1. Step 1

    Open the static residential page, choose the country Claude supports where you work, and pick HTTP as the protocol. A one-day lease is US$0.50 and 30 days is US$7.99; there is no free trial.

  2. Step 2

    Open My assets and copy HOST, PORT, USERNAME and PASSWORD. HTTP is on port 2222.

  3. Step 3

    Export HTTPS_PROXY and HTTP_PROXY as http://USERNAME:PASSWORD@HOST:PORT, start claude, run /status and check the exit with the curl line above.

FAQ

Does Claude Code work with a SOCKS5 proxy?

No. The network configuration page says Claude Code does not support SOCKS proxies, so use an HTTP or HTTPS proxy.

What do I do if the browser cannot return to localhost after login?

Sign in through the URL the terminal shows, then paste the code the browser displays at the "Paste code here" prompt. claude auth login reads the code too.

Why does Claude Code ignore my proxy change?

It reads the proxy variables once at startup, so restart it after changing them. /status shows the proxy it is using.

Does a proxy change what my Claude subscription allows?

No. It changes the network path only. Plan limits and account rules stay the same.

Further reading

Setup guides Proxy302 publishes on GitHub on the same topic:

Reference links

5
  1. Claude Code docs: Troubleshoot installation and login

    Official documentation · Confirmed on:

    Read on 19 November 2026. The login section lists: Reset your login (/logout, close, run claude again); press c to copy the login URL when the browser does not open; "OAuth error: Invalid code. Please make sure the full code was copied"; "403 Forbidden" after login (check the subscription and proxies); "This organization has been disabled" caused by a leftover ANTHROPIC_API_KEY; and, for WSL2, SSH and containers, signing in through the printed URL and pasting the code at the "Paste code here" prompt, or running claude auth login. A 403 on the download host is described as usually a proxy or filter, or an unsupported region.

  2. Claude Code docs: Authentication

    Official documentation · Confirmed on:

    Read on 19 November 2026. On first launch Claude Code opens a browser to log in; if the browser does not open, press c to copy the login URL; if the browser shows a login code instead of redirecting back, paste it at the "Paste code here if prompted" prompt; success shows "Login successful"; /logout signs out; when ANTHROPIC_API_KEY is set and approved it is used instead of the subscription login, and unset ANTHROPIC_API_KEY falls back to the subscription; /status shows which method is active.

  3. Claude Code docs: Enterprise network configuration

    Official documentation · Confirmed on:

    Read on 19 November 2026. Claude Code reads HTTPS_PROXY and HTTP_PROXY (lowercase variants too) and NO_PROXY, set before launch and read once at startup; credentials go in the proxy URL as http://username:password@host:port; "Claude Code does not support SOCKS proxies"; a proxy URL without a scheme can stop launch with an error naming the variable; /status shows the Proxy row and claude --debug writes a log to ~/.claude/debug/; the hosts to allow include api.anthropic.com, claude.ai, claude.com, platform.claude.com (also used for OAuth token exchange) and sso.claude.com for SSO.

  4. Anthropic supported regions

    Official documentation · Confirmed on:

    Read on 19 November 2026: the page lists the countries, regions and territories Anthropic can support access from (Ukraine with the exception of Crimea, Donetsk and Luhansk).

  5. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, quantity limits, no free trial.

Ready to try it?

Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.