Claude Code has one source: Anthropic's own installer. On macOS, Linux and WSL it is claude.ai/install.sh, on Windows PowerShell it is claude.ai/install.ps1. The same binary also ships through Homebrew, WinGet and npm. Mirrors, forum builds and "faster installers" are not on the official list, and an unofficial file can contain anything, including code that lifts your API key. Verifying takes a minute: claude --version prints the version, and claude doctor takes a closer look at the installation and settings.
Where to download Claude Code officially
macOS, Linux and WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows
Open PowerShell and run:
irm https://claude.ai/install.ps1 | iex
Classic CMD needs a different command, because the two shells use different syntax:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
If you get The token '&&' is not a valid statement separator, you are in PowerShell, not CMD. If irm is not recognized, you are in CMD. The prompt tells you which: PS C:\ is PowerShell, a bare C:\ without PS is CMD.
On native Windows it helps to install Git for Windows. With it, Claude Code uses a full Bash tool instead of PowerShell. Without Git the agent still starts, but some commands behave differently.
Package managers
If you already have a package manager set up, it is the easier route:
| Manager | Command | Auto-update |
|---|---|---|
| Homebrew (macOS, Linux) | brew install --cask claude-code | No, manual: brew upgrade claude-code |
| WinGet (Windows) | winget install Anthropic.ClaudeCode | No, manual: winget upgrade Anthropic.ClaudeCode |
| npm (Node.js 22+) | npm install -g @anthropic-ai/claude-code | No, manual: reinstall with the @latest tag |
Of all the methods, only the native installer (install.sh and install.ps1) updates itself in the background. The others stay on the version you installed until you run the update yourself.
For Debian, Ubuntu, Fedora, RHEL and Alpine, Anthropic also publishes signed apt, dnf and apk repositories. They suit servers and CI, where a package manager already drives the rollout.
The requirements are modest: macOS 13 or newer, Windows 10 version 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+ or Alpine 3.19+, 4 GB of RAM, an x64 or ARM64 processor.
Why you should avoid builds from shady sites
One thing gets missed a lot: Claude Code is free. Every official method above costs nothing. Money goes to usage (tokens or a subscription), not to the right to download the CLI. So a site that promises "Claude Code with the subscription bypassed" or a "cracked version with no limits" solves nothing. There is nothing to bypass, because the download is open anyway.
From a site like that you get a program with no digital signature, tied to no official release, and no way to inspect what is inside the archive. Anthropic's official Linux repositories are signed with its GPG key, and release binaries ship with a signed manifest of SHA256 checksums. A third-party site cannot offer either. That is not a small thing: the agent reads your code and runs commands in your terminal, so install it from a source you can verify.
How to check that you have the original
claude --version
The quickest check:
claude --version
A working install answers with a line such as 2.1.211 (Claude Code). If the terminal says command not found right after installing, the cause is almost always PATH: close the window and open a new one. A shell that was already running does not pick up the new path on its own.
claude doctor
A deeper check that does not start an agent session:
claude doctor
The command prints a health report for the installation, looks for errors in the settings files and attaches a fix hint to each warning. Run it after installing and after every update if something misbehaves.
Cryptographic verification for servers
Every release publishes a manifest.json with SHA256 sums for each platform, and the manifest is signed with Anthropic's GPG key. The key fingerprint is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. Most users can skip this. But if you install Claude Code on a server where the chain of trust matters, Anthropic's installation docs describe the full manifest signature check and the comparison of the binary's checksum.
Connecting Claude Code to codexkey
After installation, the claude command opens a session and Anthropic asks you to sign in right away. The free claude.ai plan is not enough: you need a paid Claude subscription, a Console account or access through one of the supported cloud providers. From Russia, registering and paying for such an account is harder still. The article Claude Code in Russia 2026 covers the blocks and how to work around them without breaking anyone's rules.
codexkey offers a third route: the same Anthropic Messages API protocol, but with a different address and key, and no Anthropic account at all. The core is two variables, the address and the key, and the three ANTHROPIC_DEFAULT_* lines set the models:
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
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
The ANTHROPIC_DEFAULT_* lines are required: without them Claude Code asks for its own default models and gets "There's an issue with the selected model".
A key in the sk_cdx_... format is created in your codexkey dashboard, under "API keys", after you register and top up the balance. Step-by-step setup for each operating system, including settings.json for a permanent configuration, is covered in How to set up Claude Code in 2026 and Installing Claude Code on Windows, so there is no point repeating it here.
FAQ
Can I download Claude Code for free?
Yes, and there is no catch: downloading and installing the CLI costs nothing with any official method. You only pay for model usage, through a Claude subscription or an API key.
Does the official installer work from Russia without a VPN?
The install.sh or install.ps1 script fetches the binary from claude.ai, so if that address opens for you, the install goes through. Whether signing in to an Anthropic account works afterwards is a separate question: users in Russia run into trouble there, and the article on Claude Code in Russia explains it. If claude.ai does not open, install through npm: the @anthropic-ai/claude-code package sits in the public npm registry, and working through codexkey does not require an Anthropic login.
What if claude --version says command not found?
Usually a new terminal fixes it: PATH is updated during installation, but a shell session that was already open does not know about it. If that did not help, make sure the installation finished without errors and run the install script again.
How does the npm install differ from the native script?
The binary inside is the same; only the delivery differs. Since version 2.1.198 the npm package needs Node.js 22 or newer. The native installer updates itself in the background, while the npm version has to be updated by hand with npm install -g @anthropic-ai/claude-code@latest. Use exactly that, not npm update -g, which can skip a new release.
How do I update an installed Claude Code?
For a native install, run claude update; it reports whether the version changed and to what. For Homebrew, WinGet and the Linux repositories, updating is done by the package manager's own command. Claude Code does not do it for them.