Anthropic's install command for Claude Code fits on one line, and it always downloads from claude.ai. On a Mac, on Linux, or inside WSL it's curl -fsSL https://claude.ai/install.sh | bash, and in Windows PowerShell it's irm https://claude.ai/install.ps1 | iex. Knowing those lines by sight turned into a safety skill this year, because criminals have been copying Claude Code's install page, buying search ads that point to the copies, and swapping in a command that installs password-stealing malware.
This guide covers every official way to install Claude Code, how to check that the copy on your computer came from Anthropic, and how the fake pages work. The commands and system requirements come from Anthropic's setup documentation and were checked on November 11, 2026. If you've never opened a terminal before, our beginner's walkthrough takes it slower.
The official install commands
Claude Code runs on macOS 13 or newer, Windows 10 version 1809 or newer, Windows Server 2019, Ubuntu 20.04 or newer, Debian 10 or newer, and Alpine Linux 3.19 or newer. Anthropic lists 4 GB of RAM as the minimum, with either an x64 or an ARM64 processor. Installing it costs nothing, but you can't sign in on the free Claude plan, so you'll need Pro or a higher plan, or an Anthropic Console account that bills by usage.
| Where | Command | Updates |
|---|---|---|
| macOS, Linux, WSL | curl -fsSL https://claude.ai/install.sh | bash | Automatic |
| Windows PowerShell | irm https://claude.ai/install.ps1 | iex | Automatic |
| Windows CMD | curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd | Automatic |
| Homebrew | brew install --cask claude-code | Manual, with brew upgrade claude-code |
| WinGet | winget install Anthropic.ClaudeCode | Manual, with winget upgrade Anthropic.ClaudeCode |
| npm (Node.js 22 or later) | npm install -g @anthropic-ai/claude-code | Automatic |
The first three rows are Anthropic's native installer, the method it recommends. It doesn't need Node.js, and it keeps Claude Code updated in the background. Homebrew and WinGet installs don't update themselves, so you run the upgrade command every so often. Homebrew also offers two versions: the plain claude-code cask follows a stable channel that Anthropic says is "typically about a week behind," while claude-code@latest gets each release as soon as it ships. Debian, Fedora, RHEL, and Alpine users can also pull from signed apt, dnf, and apk repositories, which the Linux guide walks through.
Windows trips people up the most, since PowerShell and the older Command Prompt need different commands. PowerShell shows PS C:\ at the start of the line, and CMD shows only C:\. If you get an error saying "The token '&&' is not a valid statement separator," you pasted the CMD command into PowerShell, and if you get "'irm' is not recognized," it's the other way around. The Windows guide covers the PATH fix and Git for Windows.
When the installer finishes, open a new terminal window and run claude --version. A version number means it worked, and an error saying claude can't be found usually means the install folder isn't on your PATH yet. After that, claude doctor prints a read-only health report on the install and your settings files without starting a session. There's also a desktop app for macOS, Windows, and Linux for anyone who'd rather skip the terminal, and this comparison covers what changes when you use it.
How to check that your copy came from Anthropic
The one-line commands download a script from claude.ai and run it straight away. If you'd like to read the script first, save it to a file with curl -fsSL https://claude.ai/install.sh -o install.sh, open it in any text editor, and run bash install.sh once you're satisfied. Whichever way you install, Claude Code's program files carry signatures you can check afterward.
- Mac: the binary is signed by "Anthropic PBC" and notarized by Apple. Run
codesign --verify --verboseon the newest file in~/.local/share/claude/versions/, and a tampered or unsigned file fails the check. - Windows:
claude.exeis signed by "Anthropic, PBC." In PowerShell,Get-AuthenticodeSignature (Get-Command claude).Sourceshould report a status ofValid. - Linux: the binaries aren't signed one by one. Each release instead publishes a
manifest.jsonwith a SHA256 checksum for every platform, and that file is signed with Anthropic's release key, whose fingerprint is31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. The apt, dnf, and apk repositories check signatures for you.
For a manual check on Linux, Anthropic's docs walk through importing that key from downloads.claude.ai, downloading a release's manifest and its .sig file, running gpg --verify, and comparing the output of sha256sum with the checksum listed in the manifest. Signed manifests start with version 2.1.89, and earlier releases published checksums without a signature.
How the fake install pages work
Push Security reported cloned Claude Code install pages in March 2026, spread through paid search ads, and Malwarebytes wrote up the method on March 9 under the name researchers gave it, InstallFix. The fake page copies Anthropic's documentation down to the logo, the sidebar, and the copy button beside the command. In many cases every other link on it quietly sends you to the real site, so nothing looks off. Only the install command is different, and in the cases Malwarebytes described it installed an infostealer called Amatera, which goes after saved browser passwords, cookies, and the session tokens that keep you logged in to dashboards.
The campaign kept going after that. Trend Micro said on May 5 that the fake pages reached people through Google Ads, as sponsored results for searches like "Claude Code" and "Claude Code install," and that on Windows the pasted command used PowerShell to start mshta.exe, a program built into Windows, which then downloaded the rest of the malware. On Macs, Malwarebytes said, the command typically pulled a second script disguised with base64 encoding. Straiker tracked 88 domains impersonating Claude Code, JetBrains, NotebookLM, and other AI developer tools on at least 10 hosting services, among them Squarespace, GitHub Pages, Cloudflare, and Netlify, and found 32 of those domains still serving pages on May 14, 2026.
None of these reports found anything wrong with Anthropic's own installer. The attack lives entirely on the copied page, which is why a few quick checks are enough to beat it.
- The real commands only download from
claude.ai, plusdownloads.claude.aifor Linux packages and the signing key. A command that names any other address is fake. - No real install uses
mshta, a long block of base64 text, the Windows Run box (the Windows key plus R), or a "verify you're human" step. - Anthropic's documentation lives at code.claude.com. Typing that address yourself or using a bookmark skips the ad slots entirely.
- Every official command is short enough to read at a glance before you press Enter.
If you already ran a command from a page like this, treat the computer as compromised. Disconnect it from the internet and run a full scan with up-to-date security software. Then, from a different device, change your important passwords and sign out of every active session, since stolen cookies keep working until those sessions end. Any API keys or access tokens that were stored on the machine, for GitHub, cloud dashboards, or the Anthropic Console, should be revoked and replaced.
The copies don't stay in one place for long. During Straiker's research window alone, 10 new GitHub Pages domains joined the campaign as older sites were taken down.
Sources
- Anthropic: Claude Code advanced setup (install commands, system requirements, binary signing)
- Malwarebytes: Fake Claude Code install pages hit Windows and Mac users with infostealers, March 9, 2026
- eSecurity Planet: Fake Claude Code Install Pages Spread Infostealer Malware, March 10, 2026, on Push Security's research
- Trend Micro: InstallFix and Claude Code: How Fake Install Pages Lead to Real Compromise, May 5, 2026
- Straiker: Is Your Claude Code Real? How to Spot the ACRStealer Malware, May 27, 2026
- Cover photo: "System Lock" by Yuri Samoilov, via Wikimedia Commons, CC BY 3.0, cropped
- Address bar photo: "Https Browser" by Yuri Samoilov, via Wikimedia Commons, CC BY 3.0
