Skip to main content
If installation fails or you can’t sign in, find your error below. For runtime issues after Claude Code is working, see Troubleshooting. For configuration problems such as settings not applying or hooks not firing, see Debug your configuration.

Find your error

Match the error message or symptom you’re seeing to a fix: If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause.
If you’d rather skip the terminal entirely, the Claude Code Desktop app lets you install and use Claude Code through a graphical interface. Download it for macOS or Windows and start coding without any command-line setup. On Linux, install the app with apt by following the Linux install instructions.

Run diagnostic checks

Check network connectivity

The installer downloads from downloads.claude.ai. Verify you can reach it:
You reached the server if the first line shows a 200 status. You see HTTP/2 200 on macOS and Linux, and HTTP/1.1 200 OK from the curl.exe included with Windows. Other results point to the cause:
  • 403: usually a proxy or network filter blocking the host, or Claude Code is not available in your region
  • 5xx: usually a temporary service issue; wait a few minutes and retry
If you see no output, Could not resolve host, or a connection timeout, your network is blocking the connection. Common causes:
  • Corporate firewalls or proxies blocking downloads.claude.ai
  • Regional network restrictions: try a VPN or alternative network
  • TLS/SSL issues: update your system’s CA certificates, or check if HTTPS_PROXY is configured
If you’re behind a corporate proxy, set HTTPS_PROXY and HTTP_PROXY to your proxy’s address before installing. Ask your IT team for the proxy URL if you don’t know it, or check your browser’s proxy settings. This example sets both proxy variables, then runs the installer through your proxy:

Verify your PATH

If installation succeeded but you get a command not found or not recognized error when running claude, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places claude at ~/.local/bin/claude on macOS/Linux or %USERPROFILE%\.local\bin\claude.exe on Windows.
The VS Code extension does not place claude at this location. It bundles a private copy of the CLI inside the extension directory for its own chat panel and does not add it to PATH. If you have only installed the extension, ~/.local/bin/claude will not exist. Run the standalone install to use claude from a terminal, then continue below.
Check if the install directory is in your PATH by listing your PATH entries and filtering for local/bin:
If this prints /Users/you/.local/bin or /home/you/.local/bin, the directory is in your PATH and you can skip to Check for conflicting installations. If there’s no output, add it to your shell configuration.For Zsh, the default on macOS:
For Bash on Linux, where it’s the default on most distributions:
For Bash on macOS, add the line to ~/.bash_profile instead. Terminal on macOS starts Bash as a login shell, which ignores ~/.bashrc and reads only the first of ~/.bash_profile, ~/.bash_login, or ~/.profile that exists. If you already have a ~/.bash_login or ~/.profile and no ~/.bash_profile, put the line in that file rather than creating ~/.bash_profile:
Alternatively, close and reopen your terminal.For other shells such as fish or Nushell, add ~/.local/bin to your PATH using your shell’s own configuration syntax, then restart your terminal.Verify the fix worked:

Check for conflicting installations

Multiple Claude Code installations can cause version mismatches or unexpected behavior. Check what’s installed:
List all claude binaries found in your PATH:
If this prints nothing, no claude is on your PATH yet. Go back to Verify your PATH.Check the three locations a claude binary can come from. ~/.local/bin/claude is the native installer, ~/.claude/local/ is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a -g install:
A native install shows a symlink into ~/.local/share/claude/versions/. A script or a symlink you created yourself at this path is a custom launcher, which auto-update leaves in place.If either ls command prints No such file or directory, that’s not an error. It means nothing is installed at that location, so move on to the next check.
If you find multiple installations, keep only one. The native install at ~/.local/bin/claude on macOS/Linux or %USERPROFILE%\.local\bin\claude.exe on Windows is recommended. Remove the extras: Uninstall an npm global install:
Remove the legacy local npm install:
Remove a Homebrew install on macOS. If you installed the claude-code@latest cask, substitute that name:
Remove a WinGet install on Windows:

Check directory permissions

An install that fails on permissions names the path it couldn’t create or write. On Windows the install writes under %USERPROFILE%, which is writable by your user by default, so this section rarely applies there. On macOS and Linux the install writes to these locations:
  • ~/.claude/downloads/: where the install command puts the downloaded binary
  • ~/.local/bin/: the claude launcher
  • ~/.local/share/claude/: each version it downloads
  • ~/.local/state/claude/: its lock files
  • ~/.cache/claude/: staged downloads
  • ~/.claude.json: your global config file, where the installer records the install method
If you set XDG_DATA_HOME, XDG_STATE_HOME, or XDG_CACHE_HOME, the install uses those in place of ~/.local/share, ~/.local/state, and ~/.cache. If you set CLAUDE_CONFIG_DIR, the global config file lives under that directory instead of your home directory. Check whether the directories are writable:
If either directory isn’t writable, create the install directory and set your user as the owner:

Verify the binary works

If claude --version prints a version but claude crashes or hangs on startup, run these checks to narrow down the cause. If claude --version says command not found, go to Verify your PATH first; the commands below assume claude is on your PATH. Confirm the binary exists and is executable:
On Linux, check for missing shared libraries. If ldd shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see Alpine Linux setup.
Confirm the binary can execute:

Common installation issues

These are the most frequently encountered installation problems and their solutions.

Install script returns HTML instead of a shell script

When running the install command, you may see one of these errors:
On PowerShell, the same problem appears as parse errors pointing into the returned page, with iex trying to run HTML and CSS as PowerShell: