Last verified

How to install Claude Code?

3 Steps · Windows · macOS · Linux
  1. Install with the native installer for your OS — irm https://claude.ai/install.ps1 | iex in Windows PowerShell, or curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL.
  2. Verify with claude --version. It prints a version number followed by (Claude Code) — anything else means the binary isn't on your PATH yet.
  3. Log in by running claude in a project folder. It opens a browser to authenticate; a paid Claude plan or Console credits are required.
Cost to install $0account extra
Disk ~ 232MB
Difficulty
Auto-updates nativeonly
§ 01 / PROOF

We actually ran it.

Methodology →
TEST RUN · AUG 01, 2026 · WINDOWS

What we checked ourselves — and what we're quoting from the docs.

Verified on our own machine: the installed binary sits at C:\Users\…\.local\bin\claude.exe, weighs 231.7 MB, and reports 2.1.170 (Claude Code). The WinGet manifest resolves to package Anthropic.ClaudeCode from publisher Anthropic PBC. All three installer URLs — install.sh, install.ps1, install.cmd — answered HTTP 200 on the day of writing.

Not verified by us: a clean install on macOS or Linux. Those commands are Anthropic's, quoted from the setup docs, and we have not run them end to end — so treat step 1 on those platforms as documented rather than tested.

One finding worth acting on. The docs say native installs update themselves in the background, but ours reported 2.1.170 while WinGet was offering 2.1.220 the same day, and the binary's file date was 9 June. We're not going to guess why on one machine — the lesson is simply to run claude --version and compare, rather than assume you're current.

Installed size: 231.7 MBOur version: 2.1.170WinGet offers: 2.1.220Publisher: Anthropic PBCInstaller URLs: 3 × HTTP 200Clean install tested: Windows only
$ claude --version
2.1.170 (Claude Code)
$ winget show Anthropic.ClaudeCode
Found Claude Code [Anthropic.ClaudeCode]
Version: 2.1.220
Publisher: Anthropic PBC
# installed binary
$ where claude
C:\Users\yaros\.local\bin\claude.exe
→ 231.7 MB
$
§ 02 / WHY

Each step, in detail.

2.1
Pick a route — only one of them keeps itself current

The native installer is Anthropic's recommendation and the only route that updates in the background. Everything else you install by hand, you also update by hand:

  • WinGetwinget install Anthropic.ClaudeCode, then winget upgrade Anthropic.ClaudeCode when you want a newer build.
  • Homebrewbrew install --cask claude-code for the stable channel, or claude-code@latest for the newest builds. Neither auto-updates; use brew upgrade.
  • apt, dnf, apk on Debian, Fedora, RHEL and Alpine.

The stable Homebrew cask deliberately lags about a week and skips releases with known regressions — a reasonable trade if you'd rather not ride the front edge.

2.2
Windows: which shell you're in, and which shell it gets

Two different Windows confusions, worth separating.

Yours: the PowerShell and CMD one-liners are not interchangeable. If you see The token '&&' is not a valid statement separator, you pasted the CMD version into PowerShell. If you see 'irm' is not recognized, you did the reverse. Your prompt tells you which you're in — PS C:\ means PowerShell.

Its: after install, Claude Code needs a shell of its own to run commands. With Git for Windows present it uses bash; without it, PowerShell. Install Git for Windows first and the agent behaves the way almost every tutorial assumes.

2.3
The install is free; the first prompt is not

Nothing about installation costs money, and that trips people up: the CLI downloads and runs happily, then asks you to log in. Authentication accepts a Claude subscription (Pro, Max, Team, Enterprise), a Console account with pre-paid credits, or an enterprise cloud provider — and there is no free tier.

If you'd rather not have a browser step, setting ANTHROPIC_API_KEY before launch skips the login prompt and asks you to approve the key instead.

→ IF THE INSTALLER FAILS

Other ways in.

A 403, a curl error, or syntax error near unexpected token '<' usually means the script didn't download cleanly — a proxy or a corporate filter is the common cause. Two routes around it, both documented by Anthropic.

Frequently asked.

Quick follow-ups people search after this question.

Q · 01 How do I know the install worked? +
Run claude --version. A successful install prints a version number followed by (Claude Code). If the shell says the command isn't found, the binary installed but isn't on your PATH — open a new terminal first, since the installer edits the PATH for future sessions.
Q · 02 Does Claude Code update itself? +
Native installs do, in the background. Homebrew and WinGet installs do not — you run brew upgrade or winget upgrade Anthropic.ClaudeCode. Worth checking rather than assuming: our native install reported 2.1.170 on a day when WinGet was offering 2.1.220.
Q · 03 How much disk space does it need? +
About 232 MB for the binary on our Windows box. It's a self-contained executable, so there's no separate runtime to install — Node is not a prerequisite for the native install.
Q · 04 Do I need to pay before I can install it? +
No. Installing is free and takes no account. The paid part starts at login: a Claude subscription or Console credits. You can install it, run claude --version, and stop there without spending anything.
Q · 05 Why does my install command give a syntax error on Windows? +
You're in the other shell. The token '&&' is not a valid statement separator means the CMD command was pasted into PowerShell; 'irm' is not recognized means the PowerShell command went into CMD. The prompt shows PS C:\ when you're in PowerShell.