How to install Claude Code?
- Install with the native installer for your OS —
irm https://claude.ai/install.ps1 | iexin Windows PowerShell, orcurl -fsSL https://claude.ai/install.sh | bashon macOS, Linux and WSL. - Verify with
claude --version. It prints a version number followed by(Claude Code)— anything else means the binary isn't on yourPATHyet. - Log in by running
claudein a project folder. It opens a browser to authenticate; a paid Claude plan or Console credits are required.
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.
Each step, in detail.
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:
- WinGet —
winget install Anthropic.ClaudeCode, thenwinget upgrade Anthropic.ClaudeCodewhen you want a newer build. - Homebrew —
brew install --cask claude-codefor the stable channel, orclaude-code@latestfor the newest builds. Neither auto-updates; usebrew 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.
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.
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.
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? +
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? +
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? +
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? +
claude --version, and stop there without spending anything.Q · 05 Why does my install command give a syntax error on Windows? +
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.