Claude Code is a command-line tool, so "download" works differently from a normal app. You run one command, a script fetches a native binary from Anthropic's servers, puts claude in ~/.local/bin (on Windows, %USERPROFILE%\.local\bin), and from then on a native install updates itself in the background. The commands below match the install page of Anthropic's docs that we opened on November 10, 2026. If a third-party site offers a "Claude Code installer" or a "cracked" build, close the tab: the official route needs neither.
What "download Claude Code" can mean
People use the phrase for four different things, and the answer changes with each.
| You want | Where it comes from |
|---|---|
| The command-line agent | The install command for your system, shown below |
| An app with a window | The Claude desktop app, which has a Code tab. Download it at claude.com/download |
| The editor integration | The VS Code extension or the JetBrains plugin, both listed on the same download page |
| Claude chat only | Not Claude Code: use the web, desktop or mobile app |
The download page lists Desktop, Terminal, VS Code, JetBrains and Slack as places to run Claude Code. This article covers the terminal install. For the desktop app, see Download Claude Desktop and connect MCP.
Install commands by system
macOS, Linux and WSL
curl -fsSL https://claude.ai/install.sh | bash
The command prints nothing while it downloads, so do not assume it froze. When the prompt comes back, open a new terminal window and run claude --version. In WSL, run the command inside the distribution's own terminal, not from PowerShell. Anthropic's docs say sandboxing works in WSL 2 and not in WSL 1.
Windows
In PowerShell:
irm https://claude.ai/install.ps1 | iex
In classic CMD the command is different, because the two shells use different syntax:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Your prompt tells you where you are: PS C:\ is PowerShell, plain C:\ without the PS is CMD. You do not need administrator rights. If you see The token '&&' is not a valid statement separator, you are in PowerShell and pasted the CMD line. If irm is not recognized, you are in CMD.
The docs name PowerShell, CMD and WinGet as the Windows routes, and none of them is a double-click installer. Git for Windows is optional: with it Claude Code uses Git Bash for its Bash tool, without it the agent runs shell commands through PowerShell.
Homebrew, WinGet and npm
If you already live in a package manager, use it:
| Manager | Command | Updates itself |
|---|---|---|
| Homebrew (macOS, Linux) | brew install --cask claude-code | No, run brew upgrade claude-code |
| WinGet (Windows) | winget install Anthropic.ClaudeCode | No, run winget upgrade Anthropic.ClaudeCode |
| npm (Node.js 22+) | npm install -g @anthropic-ai/claude-code | Yes, if the npm global directory is writable. By hand: npm install -g @anthropic-ai/claude-code@latest |
Homebrew has two casks. claude-code follows the stable channel, usually about a week behind, and claude-code@latest gets releases the day they ship. Never install with sudo npm: Claude Code updates itself without sudo, so an install that needs it cannot update automatically.
Anthropic also publishes signed apt, dnf and apk repositories for Debian, Ubuntu, Fedora, RHEL and Alpine. They suit servers and CI. For apt on the stable channel:
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc -o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update
sudo apt install claude-code
Upgrade later with sudo apt update && sudo apt upgrade claude-code. The dnf and apk commands are in Anthropic's setup docs.
Requirements
macOS 13 or newer, Windows 10 version 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+ or Alpine 3.19+. You need 4 GB of RAM and an x64 or ARM64 processor, and the install itself wants about 512 MB of free memory. The list also names a location: your country has to be on Anthropic's supported list. That line causes most of the trouble covered below.
Check the version and update
claude --version
A working install prints something like 2.1.211 (Claude Code). For a fuller check run claude doctor. It prints read-only diagnostics without starting a session: install health, errors in settings files, warnings with suggested fixes, and the result of the last auto-update attempt.
To update right now instead of waiting for the background check:
claude update
Claude Code follows the latest channel by default. The stable channel runs about a week behind and skips releases with major regressions; switch it in /config under Auto-update channel or with "autoUpdatesChannel": "stable" in settings.json. A brand-new model sometimes needs a newer build than stable serves, and then you move back to latest. To switch off background updates, set DISABLE_AUTOUPDATER to "1" in the env block of settings.json; claude update still works.
When signup, login or payment is blocked where you live
Installing the CLI and using it are two separate steps. After claude starts, Anthropic asks you to sign in, and Claude Code requires a Pro, Max, Ultra, Team, Enterprise or Console account. The free claude.ai plan does not include it. A third-party provider such as Amazon Bedrock also works.
Three different problems hide behind "it doesn't work here":
- Your country is not on Anthropic's supported list. The list leaves out, among others, China, Hong Kong, Russia, Belarus, Iran, Cuba, Syria and Venezuela, and covers Ukraine except Crimea and the Donetsk, Kherson, Luhansk and Zaporizhzhia regions. Anthropic's supported-countries page also treats use by people who are physically in an unsupported region as unsupported. In the terminal you meet this as an HTML page containing "App unavailable in region" or a bare
403instead of the install script. - Your country is supported, but your network blocks the download. The installer pulls files from
downloads.claude.ai. Test it withcurl -sI https://downloads.claude.ai/claude-code-releases/latest(usecurl.exein PowerShell).HTTP/2 200means you reached it; no output or a timeout means a firewall, proxy or regional filter is in the way. Behind a corporate proxy, setHTTPS_PROXYandHTTP_PROXYbefore running the installer. - Signup or payment fails even though the country is listed. Some non-US cards are declined at checkout, and phone-number or billing checks can block account creation. We cannot see inside Anthropic's fraud rules, so treat this as a symptom, not a rule.
For the second case the npm route helps: npm install -g @anthropic-ai/claude-code brings the binary from the npm registry, not from downloads.claude.ai.
For the third case, and for people who simply want one key for many models, there is a gateway route. Claudexia is a third-party service that accepts the Anthropic Messages API on its own address. You create a sk_cdx_... key, pay Claudexia, and Claude Code talks to it instead of to Anthropic. There is no Anthropic account in the loop.
Be clear about what that is and is not. Claudexia sells API access, not Claude Pro or Max subscriptions and not claude.ai. A gateway does not change what Anthropic's terms say about your location: if your country is unsupported, read those terms yourself, because we cannot promise that any route is allowed under another company's policy.
Point Claude Code at the gateway
Create an account at Claudexia, top up the balance (local cards, Visa or Mastercard, SBP where it exists, or USDT, BTC and ETH), and create a key in the dashboard under API Keys. Then:
export ANTHROPIC_BASE_URL="https://api.claudexia.tech"
export ANTHROPIC_AUTH_TOKEN="sk_cdx_YOUR_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-sonnet-5"
claude
In PowerShell the same two main values are $env:ANTHROPIC_BASE_URL = "https://api.claudexia.tech" and $env:ANTHROPIC_AUTH_TOKEN = "sk_cdx_YOUR_KEY"; they last until the window closes. To make them permanent, put them in the env block of ~/.claude/settings.json, never in a project's committed .claude/settings.json.
The ANTHROPIC_DEFAULT_* lines matter. Without them Claude Code asks for its own default models and fails with "There's an issue with the selected model". Setting ANTHROPIC_BASE_URL alone is also not enough: a saved claude.ai login stays the active credential, so its limits and billing keep applying. Run /status inside a session and look for the Anthropic base URL line to confirm the gateway is in use.
Step-by-step configs for each system are in Claude Code in 2026: install and connect without an Anthropic account, Claude Code setup guide and Install Claude Code on Windows. The Claude Code guide in the docs keeps the canonical variable list. If your Anthropic account is the thing that broke, read Claude account banned or suspended, and for the gateway idea in general see How to use Claude API without an Anthropic account. Paying in crypto is covered in Paying for API access with crypto.
Install errors and what to do
| What you see | Cause | Fix |
|---|---|---|
command not found: claude or 'claude' is not recognized | The install worked, but its folder is not on PATH | Open a new terminal. If that fails, add the folder using the commands below the table |
The token '&&' is not a valid statement separator | CMD command pasted into PowerShell | Use the PowerShell command from the Windows section |
'irm' is not recognized | PowerShell command pasted into CMD | Open PowerShell, or use the CMD command with install.cmd |
syntax error near unexpected token '<', < was unexpected at this time or curl: (22) ... 403 | A web page or a 403 came back instead of the script | "App unavailable in region" in the text means your country is unsupported. Otherwise wait a few minutes, check network and proxy, try Homebrew or WinGet |
Killed or Installation was killed before it could finish (exit code 137) | A small Linux server ran out of memory | Add a 2 GB swap file or free memory, then rerun the script |
TLS connect error or SSL/TLS secure channel | The TLS handshake failed | Update the system's CA certificates; behind a corporate proxy set HTTPS_PROXY |
Failed to fetch version from downloads.claude.ai | Your network blocks downloads.claude.ai | Run the curl -sI test above and wait for a 200 |
Claude Code does not support 32-bit Windows | You opened the Windows PowerShell (x86) entry | Open Windows PowerShell without x86 and run the installer again |
EACCES: permission denied during an npm install | The global npm folder is not writable | Do not use sudo; switch to the native script |
Add claude to PATH
For Zsh on macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
For Bash on Linux, replace ~/.zshrc with ~/.bashrc. On Windows, in PowerShell:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Then restart the terminal. A terminal inside an editor takes its PATH from the editor, so quit and reopen the editor too.
Download only from official sources
The program costs nothing to install, so a site selling "Claude Code without a subscription" or a "cracked build" has nothing to sell you except risk. You get a program with no signature and no way to check what is inside the archive. The official route can be checked: Linux repositories are signed with Anthropic's GPG key, and every release publishes a manifest.json with SHA256 checksums, signed with the same key. The fingerprint is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. macOS binaries are signed by "Anthropic PBC" and notarized by Apple, Windows binaries by "Anthropic, PBC".
An agent that reads your repository and runs commands in your shell deserves an install source you can verify.
FAQ
How do I download Claude Code on Windows?
Open PowerShell and run irm https://claude.ai/install.ps1 | iex. CMD and WinGet variants are above. Administrator rights and Git for Windows are optional. Open a fresh terminal afterwards and run claude --version.
Is Claude Code free to download?
Yes. The CLI costs nothing to install by any official route. You pay for the models: a paid Claude plan, a Console account, or an API key from a gateway.
Can I use Claude Code without an Anthropic account?
Yes, through a gateway that speaks the Anthropic Messages API. Set ANTHROPIC_BASE_URL and a gateway key as shown above. Claudexia is one such gateway; Anthropic does not review or endorse it.
Does the installer work from Russia, Iran, China or other unsupported countries?
The script sits on claude.ai and downloads from downloads.claude.ai. If those addresses answer, the install completes. If you get an HTML page with "App unavailable in region", Anthropic's own docs say Claude Code is not available in your country. We have not tested installs from every country. The npm package fetches its binary from the npm registry instead, and a gateway key replaces the Anthropic login. Whether using Claude Code from an unsupported location is allowed is a question for Anthropic's terms, not for us.
Claude Code says "command not found" after installing
Open a new terminal first: the old one keeps the previous PATH. Then check that ~/.local/bin/claude exists. If it does, add that folder to PATH with the commands above. If it does not, the install never finished, so rerun the script and read its output.
npm or the native script?
They install the same binary. The npm package needs Node.js 22 or newer since version 2.1.198; on older Node, npm prints an EBADENGINE warning but the install still completes. Update the npm version with npm install -g @anthropic-ai/claude-code@latest, not npm update -g, which respects the range from the first install and can skip a new release.
How do I uninstall Claude Code?
For a native install on macOS, Linux and WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Homebrew: brew uninstall --cask claude-code. WinGet: winget uninstall Anthropic.ClaudeCode. npm: npm uninstall -g @anthropic-ai/claude-code. Settings and session history live in ~/.claude; delete that folder only if you are fine losing allowed tools and MCP server settings with it.
What about OpenAI's agent?
That is Codex, which has its own install paths. See Download Codex: app, CLI and VS Code extension.