ClaudeFolio

How to install Claude Code safely, and how to spot a fake install page

The official Claude Code install commands for macOS, Windows, and Linux, how to check that the copy on your computer came from Anthropic, and how the fake install pages that spread malware in 2026 work.

·6 min read
How to install Claude Code safely, and how to spot a fake install page

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.

WhereCommandUpdates
macOS, Linux, WSLcurl -fsSL https://claude.ai/install.sh | bashAutomatic
Windows PowerShellirm https://claude.ai/install.ps1 | iexAutomatic
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdAutomatic
Homebrewbrew install --cask claude-codeManual, with brew upgrade claude-code
WinGetwinget install Anthropic.ClaudeCodeManual, with winget upgrade Anthropic.ClaudeCode
npm (Node.js 22 or later)npm install -g @anthropic-ai/claude-codeAutomatic

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 --verbose on the newest file in ~/.local/share/claude/versions/, and a tampered or unsigned file fails the check.
  • Windows: claude.exe is signed by "Anthropic, PBC." In PowerShell, Get-AuthenticodeSignature (Get-Command claude).Source should report a status of Valid.
  • Linux: the binaries aren't signed one by one. Each release instead publishes a manifest.json with a SHA256 checksum for every platform, and that file is signed with Anthropic's release key, whose fingerprint is 31DD 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.

Close-up of a browser address bar showing a green padlock and https
Image Credit: Yuri Samoilov via Wikimedia Commons

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, plus downloads.claude.ai for 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

Steps

  1. Open a terminal

    Use Terminal on a Mac, a shell on Linux, or PowerShell on Windows.

  2. Get the command from code.claude.com

    Type the address yourself or use a bookmark instead of clicking a sponsored search result.

  3. Read the command

    It should download only from claude.ai, with no mshta, base64, or Windows Run box step.

  4. Run the installer

    Paste the command for your system and press Enter. It shows no progress while it downloads.

  5. Confirm the install

    Open a new terminal, run claude --version, then run claude doctor for a health report.

  6. Check the signature

    Use codesign on a Mac or Get-AuthenticodeSignature on Windows to confirm Anthropic signed the program.

Frequently asked questions

What is the official command to install Claude Code?
On macOS, Linux, and WSL it's curl -fsSL https://claude.ai/install.sh | bash. In Windows PowerShell it's irm https://claude.ai/install.ps1 | iex. Anthropic also supports Homebrew, WinGet, npm, and signed apt, dnf, and apk repositories for Linux.
How can I tell if a Claude Code install page is fake?
Read the command. Anthropic's commands only download from claude.ai, or downloads.claude.ai for Linux packages. A command that names any other address, uses mshta or base64, or asks you to paste it into the Windows Run box is fake.
Is it safe to run the Claude Code install script?
The script at claude.ai is Anthropic's own installer, and the program it installs is signed on Mac and Windows. To read it first, save it with curl -fsSL https://claude.ai/install.sh -o install.sh and open the file before running it.
Does Claude Code need Node.js?
Not with the native installer, which is the method Anthropic recommends, and not with Homebrew or WinGet either. Only the npm install uses Node.js, and Anthropic's docs say it needs version 22 or later.
What should I do if I ran a command from a fake Claude Code page?
Disconnect the computer and scan it with up-to-date security software. From another device, change your passwords, sign out of every session, and replace any API keys or tokens stored on that machine, since the malware targets cookies and saved logins.
Is Claude Code free to install?
Installing it is free, but signing in requires a paid Claude plan, Pro or higher, or an Anthropic Console account billed by usage. The free Claude plan doesn't include Claude Code.

Built something with Claude Code?

ClaudeFolio is the directory of projects built with Claude Code. If this guide helped you ship something, the community would like to see it.

More guides