CLAUDE ERRORS

Claude Code Error Code Troubleshooting

Locate Claude Code installation, login, proxy, certificate, rate limit, corporate network, and permission issues by error type.

First, identify which layer the error is in

INSTALL

Install / Runtime

command not found, Node version, npm permissions, WSL path, and native installer issues.

AUTH

Login / Authentication

OAuth callback, API key, Console organization, SSO, and local auth state issues.

NETWORK

Network / Proxy

Corporate proxy, firewall, certificates, timeouts, 403/429, and unreachable required domains.

Common errors and fixes

claude: command not found

Common cause: The install directory isn't on PATH, or the current shell hasn't reloaded its configuration.

Fix: Open a new terminal, or add the Claude Code install directory to PATH and reload your shell configuration.

export PATH="$PATH:$HOME/.local/bin"
source ~/.zshrc
Node version not supported / silent crash

Common cause: The Node version is below the official requirement, or WSL is invoking the Windows-side Node.

Fix: Upgrade Node, or use the official native installer. On WSL, confirm the path with which node / which npm to make sure it comes from the Linux environment.

node -v
which node
which npm
EACCES / permission denied

Common cause: The global npm directory is owned by root, or a previous sudo install left permissions in a bad state.

Fix: Don't install Claude Code with sudo. Change the npm prefix to a user directory, or use the native installer.

npm config set prefix ~/.npm-global
export PATH="$HOME/.npm-global/bin:$PATH"
Waiting for authentication...

Common cause: The browser OAuth callback isn't reaching the local CLI - common with remote SSH, devcontainers, strict firewalls, or blocked localhost callbacks.

Fix: Confirm the browser and CLI can reach each other on the same machine. If needed, log out, restart Claude Code, and complete authentication again.

/logout
# 关闭 Claude Code 后重新运行
claude
SELF_SIGNED_CERT_IN_CHAIN / certificate error

Common cause: A corporate proxy or security gateway is injecting a self-signed CA that Node doesn't trust by default.

Fix: Ask IT for the corporate CA bundle and specify it via NODE_EXTRA_CA_CERTS.

export NODE_EXTRA_CA_CERTS=/path/to/company-ca.pem
proxy connection failed / timeout

Common cause: The proxy variables are misconfigured, the proxy protocol isn't supported, NO_PROXY is overriding the target domain, or a corporate firewall is blocking access.

Fix: Claude Code uses the standard HTTP/HTTPS proxy environment variables; the docs state SOCKS proxies aren't supported. Retest with HTTPS_PROXY first.

export HTTPS_PROXY=http://proxy.example.com:8080
echo $HTTPS_PROXY
echo $NO_PROXY
403 Forbidden

Common cause: The organization hasn't enabled Claude Code, the corporate allowlist doesn't include the current egress, account/region/policy restrictions apply, or the proxy is being rejected.

Fix: For personal accounts, confirm supported regions and account status first; for enterprise accounts, have an admin check Claude Code permissions, SSO, IP allowlist, and firewall rules.

429 / rate limit

Common cause: Requests are too frequent, concurrency is too high, or the account plan or organization has hit a rate limit.

Fix: Reduce outer concurrency, stop retry loops, and wait for the limit to reset. Don't wrap Claude Code with multiple workers to force speed.

API key not recognized / SSO mismatch

Common cause: The API key came from a different shell, a Console key conflicts with an OAuth session, or the organization requires SSO login.

Fix: Check whether ANTHROPIC_API_KEY is set in the current shell. Enterprise accounts should follow the admin's required Console/SSO login flow.

echo $ANTHROPIC_API_KEY

Proxy and corporate network baseline

The official docs state that Claude Code supports the standard HTTPS_PROXY / HTTP_PROXY / NO_PROXY environment variables, but does not support SOCKS proxies. For corporate self-signed certificates, specify the CA bundle via NODE_EXTRA_CA_CERTS.

export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY="localhost,127.0.0.1"
export NODE_EXTRA_CA_CERTS=/path/to/company-ca.pem

Minimal reproduction workflow

  1. Confirm `node -v` meets the official requirement, or use the Claude Code native installer.
  2. Close any wrapper scripts and workers, and run `claude` in a single terminal window only.
  3. Use `echo $HTTPS_PROXY` and `echo $NO_PROXY` to confirm the proxy variables are set correctly.
  4. Check whether api.anthropic.com, claude.ai, statsig.anthropic.com, and sentry.io are allowed through the firewall.
  5. If login is stuck, run `/logout` and restart Claude Code, clearing local auth files if needed before logging in again.

Official references

mimetic
mimetic
mimetic