How to install Claude Code on macOS, Windows, and Linux

Anthropic deprecated the npm install in January 2026 in favour of a native binary that needs no Node.js. Most install guides still lead with npm. Here is the current picture for each platform, checked against the official setup docs in August 2026.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

The native installer is the recommended path on every platform: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, and irm https://claude.ai/install.ps1 | iex in Windows PowerShell. It bundles its own runtime, sets up PATH, and self-updates in the background. Homebrew, WinGet, apt, dnf, apk, and npm all work but none of them auto-update through Claude Code. You need a Pro, Max, Team, Enterprise, or Console account; the free Claude plan does not include Claude Code.

What you need to know
  • Native installer is the recommended method on all platforms. No Node.js required, and it auto-updates.
  • macOS, Linux, WSL: curl -fsSL https://claude.ai/install.sh | bash
  • Windows PowerShell: irm https://claude.ai/install.ps1 | iex. Windows CMD has its own one-liner.
  • npm still works but the package now requires Node.js 22 or later and installs the same native binary anyway.
  • Claude Code needs a paid plan (Pro and up) or a Console account with API credit. The free Claude plan does not include it.
  • Homebrew, WinGet, apt, dnf, and apk installs do not auto-update. That is the real tradeoff, not convenience.

Before you start

recommended: native installer, no Node.jsmacOScurl -fsSL https://claude.ai/install.sh | bashLinuxcurl -fsSL https://claude.ai/install.sh | bashWindowsirm https://claude.ai/install.ps1 | iexdeprecated January 2026. still works, not the pathnpmnpm install -g @anthropic-ai/claude-code
One command per platform. The native installer bundles its own runtime; npm still functions but stopped being the recommended path in January 2026.

Claude Code system requirements, from the official setup docs, checked 7 August 2026.

RequirementWhat it needs
Operating systemmacOS 13.0+, Windows 10 1809+ or Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+
Hardware4 GB+ RAM, x64 or ARM64
ShellBash, Zsh, PowerShell, or CMD
AccountPro, Max, Team, Enterprise, or a Console account with API credit
NetworkInternet access; check your proxy allowlist if you are behind one
Also usefulGit, so the agent can commit and open PRs. ripgrep ships with Claude Code except on musl distros

macOS and Linux

01

Run the native installer

curl -fsSL https://claude.ai/install.sh | bash

# Pin the slower, safer channel instead
curl -fsSL https://claude.ai/install.sh | bash -s stable

# Or an exact version
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89

It detects your architecture, downloads the right binary, puts it on your PATH, and configures background self-updates. The launcher lands at ~/.local/bin/claude as a symlink into ~/.local/share/claude/versions/.

02

Confirm it landed

claude --version
# 2.1.211 (Claude Code)

claude doctor      # read-only install and settings diagnostics

If claude is not found, your shell has not picked up the new PATH entry. Open a new terminal, or source your profile.

03

Authenticate

Run claude in any directory and it opens a browser on first use. If ANTHROPIC_API_KEY is set in your environment, it prompts once to approve that key instead of opening a browser.

claude
> /login            # opens a browser for your Claude account

# Or use an API key instead of a subscription
export ANTHROPIC_API_KEY="sk-ant-..."

# Non-interactive machines: mint a long-lived token
claude setup-token
04

Start in a repository

cd ~/code/myapp
claude

# Worth it once per project: let it write a CLAUDE.md
> /init

Homebrew

Convenient if you already manage everything else that way, at the cost of updates. There are two casks and they mean different things.

brew install --cask claude-code            # stable channel, about a week behind
brew install --cask claude-code@latest    # every release as it ships

brew upgrade claude-code                  # Homebrew installs do NOT auto-update
brew cleanup                              # old versions stay on disk otherwise

Alpine and other musl distributions

Alpine ships without bash or curl, so the documented one-liner fails with a not found error until you add them, and the bundled ripgrep does not work on musl.

apk add bash curl libgcc libstdc++ ripgrep
# then set USE_BUILTIN_RIPGREP to "0" in the env block of settings.json

Windows

Claude Code runs natively on Windows. WSL is still a good choice if your project already lives there, but it is no longer required. Pick by where your code is and whether you want sandboxing.

OptionRequiresSandboxingWhen to use
Native WindowsNothing; Git for Windows is optionalNot supportedWindows-native projects and tools
WSL 2WSL 2 enabledSupportedLinux toolchains or sandboxed command execution
WSL 1WSL 1 enabledNot supportedOnly if WSL 2 is unavailable

Native install

PowerShell
irm https://claude.ai/install.ps1 | iex

# then, in a new terminal
claude --version
CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
WinGet
winget install Anthropic.ClaudeCode
winget upgrade Anthropic.ClaudeCode   # WinGet installs do NOT auto-update

Git for Windows is optional but changes the shell tool

Without Git for Windows, Claude Code runs shell commands through the PowerShell tool. With it installed, Claude Code uses Git Bash for the Bash tool. If it cannot find Git Bash, point at it explicitly.

settings.json
{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

WSL

Inside WSL, follow the Linux instructions exactly and install from the WSL terminal, not from PowerShell. The one thing that matters is where your code lives.

# Good: project on the Linux filesystem, fast
cd ~/code/myapp && claude

# Slow: project on the Windows filesystem via /mnt
cd /mnt/c/Users/you/code/myapp && claude

Filesystem calls across the /mnt boundary are dramatically slower, and an agent does thousands of them. A session that feels unusably sluggish in WSL is almost always this, not the model.

Choosing an install method

The real difference between these is not convenience, it is who owns updates. Only the native install updates itself.

MethodAuto-updatesBest forWatch out for
Native installerYes, in the backgroundAlmost everyoneNeeds a new shell for PATH to apply
HomebrewNoMacs where brew manages everythingTwo casks; brew cleanup to reclaim disk
WinGetNoManaged Windows fleetsUpgrade fails while Claude Code is running
apt / dnf / apkNoLinux servers and imagesNeeds the signing key registered first
npmPartly, if the global dir is writableCI images that already have NodeDeprecated; needs Node 22+; never sudo

Linux package managers

Anthropic publishes signed apt, dnf, and apk repositories, each with a stable and a latest channel. Verify the key fingerprint before you trust it.

Debian and Ubuntu, stable channel
sudo apt install curl gnupg
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
  -o /etc/apt/keyrings/claude-code.asc

# Confirm it belongs to Anthropic before continuing
gpg --show-keys /etc/apt/keyrings/claude-code.asc
# fingerprint should be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE

echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
  | sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update && sudo apt install claude-code

npm, if you have a specific reason

npm install -g @anthropic-ai/claude-code
claude --version

# Upgrade: use @latest, not npm update -g, which respects the old semver range
npm install -g @anthropic-ai/claude-code@latest

# Do NOT sudo this. If you get EACCES, fix your npm prefix instead:
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"

The npm package installs the same native binary as the standalone installer, pulled in through a per-platform optional dependency such as @anthropic-ai/claude-code-darwin-arm64. The installed claude binary does not invoke Node at runtime. Your package manager must allow optional dependencies, or the binary goes missing after a seemingly successful install.

Updates and release channels

A native install checks for updates on startup and periodically while running, then applies them the next time you start. Which versions it accepts is configurable, which matters for teams.

SettingEffect
autoUpdatesChannel: "latest"Default. New features as soon as they ship
autoUpdatesChannel: "stable"About a week behind, skipping releases with major regressions
minimumVersionA floor. Updates refuse to install below it, so moving to stable cannot downgrade you
DISABLE_AUTOUPDATER=1Stops the background check only. claude update still works
DISABLE_UPDATESBlocks every update path, including manual
settings.json for a team that wants predictability
{
  "autoUpdatesChannel": "stable",
  "minimumVersion": "2.1.100"
}
Updating by hand
claude update
# Successfully updated from 2.1.203 to version 2.1.211
# or: Claude Code is up to date (2.1.211)

claude doctor   # shows the result of the most recent update attempt

When it does not work

SymptomCauseFix
claude: command not foundPATH not reloadedOpen a new terminal, or source your shell profile
syntax error near unexpected token '<' from the installerA proxy or captive portal returned HTML instead of the scriptFix network access, then re-run; do not pipe an unverified body to bash
EACCES on npm installGlobal npm dir owned by rootSet a user-owned npm prefix; do not sudo
Binary missing after npm installOptional dependencies disabledAllow optional deps, or use the native installer
EBADENGINE warningNode older than 22Harmless; the binary does not use your Node at runtime
Login loop, never authenticatesStale credentialsRun /logout, then /login again
Unexpected 429 on a subscriptionA stray ANTHROPIC_API_KEY in your environmentRun /status, confirm the active credential, unset the key
Very slow on WindowsProject on /mnt/c under WSLMove the repo to the Linux filesystem
Two accounts fightingOne credential store per OS userIsolate with CLAUDE_CONFIG_DIR
Anything elseUnknownclaude doctor reports install, auth, and config state

Verifying what you downloaded

Every release publishes a manifest.json of SHA256 checksums signed with an Anthropic GPG key, so verifying the manifest transitively verifies every binary it lists. Signatures exist for releases from 2.1.89 onward.

curl -fsSL https://downloads.claude.ai/keys/claude-code.asc | gpg --import
gpg --fingerprint security@anthropic.com
# 31DD DE24 DDFA B679 F42D  7BD2 BAA9 29FF 1A7E CACE

REPO=https://downloads.claude.ai/claude-code-releases
VERSION=2.1.89
curl -fsSLO "$REPO/$VERSION/manifest.json"
curl -fsSLO "$REPO/$VERSION/manifest.json.sig"
gpg --verify manifest.json.sig manifest.json

On macOS the binary is also signed by "Anthropic PBC" and notarized (codesign --verify --verbose ./claude); on Windows it is signed by "Anthropic, PBC" (Get-AuthenticodeSignature .\claude.exe). Linux binaries are not individually code-signed, which is why the manifest signature matters more there.

Running a second account

The CLI stores one credential per machine user, so a second /login replaces the first. Point each account at its own config root instead.

CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude

Worth doing right after install

  1. Run /init in your main repo. It writes a CLAUDE.md describing the project, which measurably improves every later session. Then edit what it produced; the value is in what only you know.
  2. Pick a model and effort deliberately. /model and /effort. Defaulting to the largest model at max effort is the fastest way to hit rate limits.
  3. Learn /clear, /compact, and /rewind. Context management is most of cost control.
  4. Set up a status line. It can render context percentage and both rate-limit windows continuously, which is the cheapest early warning there is.
  5. Set up gh. With the GitHub CLI authenticated, the agent can open PRs itself.
  6. Check your plan against your usage. Pro is fine to start; the signal to upgrade is hitting limits during planned work, twice in a fortnight.

Uninstalling cleanly

Removing the binary is not the same as removing Claude Code. If claude still runs afterwards you have a second installation or a leftover shell alias.

Native install on macOS, Linux, WSL
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

# Other methods
brew uninstall --cask claude-code       # or claude-code@latest
winget uninstall Anthropic.ClaudeCode
sudo apt remove claude-code
npm uninstall -g @anthropic-ai/claude-code

Questions people ask

The native installer: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. It needs no Node.js and it is the only method that auto-updates.

No. The native installer bundles its own runtime. Even the npm package installs the same native binary and does not invoke Node at runtime, though as of v2.1.198 npm itself requires Node 22 or later to install it.

Yes. Install from PowerShell, CMD, or WinGet, with no Administrator rights needed. Git for Windows is optional and enables the Bash tool; without it Claude Code uses the PowerShell tool. Sandboxing is only supported under WSL 2.

No. The setup docs state that Claude Code requires a Pro, Max, Team, Enterprise, or Console account, and that the free Claude plan does not include access.

Native installs update themselves in the background; run claude update to apply one immediately. Homebrew, WinGet, apt, dnf, and apk do not auto-update: use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your usual system upgrade.

Pass it to the installer: curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89. Pass "stable" instead of a version to track the slower channel. claude --version then prints exactly what you asked for.

Almost always because the repository sits on the Windows filesystem under /mnt/c. Cross-boundary file operations are very slow and an agent makes thousands. Move the repo onto the Linux filesystem.

Import the release key from downloads.claude.ai/keys/claude-code.asc, confirm the fingerprint is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE, then gpg --verify the release manifest.json.sig against manifest.json and compare your binary's SHA256 to the manifest entry.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code advanced setup system requirements, every install path, channels, uninstall
  2. Claude Code CLI reference claude doctor, update, install, setup-token
  3. Claude Code: troubleshoot installation and login permission and PATH failures
Try it

Installed once.
Visible everywhere.

Continuum sits beside your Claude Code install and shows live quota gauges, per-repo spend, and every running session on Mac, Windows, Linux, web, and your phone. Free app, your own subscription.

free app · your subscriptions · local-first