How to install Claude Code on Mac, Windows and Linux

Run one command: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. No Node.js needed. Then run claude in your project and sign in with a Pro, Max, Team, Enterprise or Console account; the free plan does not include Claude Code. Read 3 October 2026.

Dmitriy Solodukha · checked against Caprock v0.68.0

command installs it, and it updates itself
1
command installs it, and it updates itself
the native installer
systems: macOS 13+, Windows 10 1809+, Linux
3
systems: macOS 13+, Windows 10 1809+, Linux
Ubuntu 20.04+, Debian 10+, Alpine 3.19+; x64 or ARM64
of RAM or more, and an internet connection
4 GB
of RAM or more, and an internet connection
Anthropic's system requirements
a month for Pro, the cheapest plan with Claude Code
$20
a month for Pro, the cheapest plan with Claude Code
$17 a month billed annually; or a Console API key

From Anthropic's Claude Code docs (setup, troubleshooting, authentication, IDE pages) and Claude's plans, read 3 October 2026.

Install Claude Code

One command for your system

Open a terminal, paste the line for your shell, then open a new terminal window so it finds claude.

macOS, Linux, WSLTerminal

WindowsPowerShell

WindowsCommand Prompt (CMD)

You do not need to run it as Administrator. Prefer a window to a terminal? Anthropic's Claude Desktop app runs Claude Code with no command line.

Native, Homebrew, WinGet, npm

Pick your install

Every method installs the same native program. They differ in who keeps it up to date.

Ways to install Claude Code, from Anthropic's setup docs, read 3 October 2026
MethodSystemsUpdates itselfNeeds Node.js
Native installer (recommended)macOS, Linux, WSL, Windowsyes, in the backgroundno
HomebrewmacOSno: brew upgrade, or opt inno
WinGetWindowsno: winget upgrade, or opt inno
apt, dnf, apkDebian, Ubuntu, Fedora, RHEL, Alpineno: your system upgradeno
npmmacOS, Linux, Windows (x64, ARM64)yes, if npm's folder is writableNode.js 22+
“Opt in” is CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1: Claude Code then runs the Homebrew or WinGet upgrade itself. Homebrew's claude-code cask follows the stable channel, about a week behind; claude-code@latest gets each release as it ships. npm downloads the same native binary, which does not use Node.js once installed.
  1. Homebrew (macOS)

  2. WinGet (Windows)

  3. npm (Node.js 22 or later; never with sudo)

Step by step

On Mac, Windows and Linux

macOS

  1. 1

    In Terminal, install

  2. Or with Homebrew

  3. 2

    Open a new window and check

  4. 3

    Start it in your project

Windows

  1. 1

    In PowerShell, install

  2. Or with WinGet

  3. 2

    Open a new window and check

    Optional: Git for Windows gives Claude Code Git Bash; without it, it runs commands in PowerShell.

  4. 3

    Start it in your project

Linux and WSL

  1. 1

    In your shell (in WSL, inside the distribution)

  2. Alpine first needs these

    Then set USE_BUILTIN_RIPGREP=0 in settings.json. Debian, Ubuntu, Fedora, RHEL and Alpine also have signed apt, dnf and apk repositories.

  3. 2

    Open a new shell and check

  4. 3

    Start it in your project

Ubuntu, Fedora, Arch, PATH fixes and a desktop app: Claude Code on Linux.

Windows: native or WSL?

Both work. Pick by where your projects live. In WSL you install and run claude inside the WSL terminal, not from PowerShell.

Claude Code on Windows, native or in WSL, from Anthropic's setup docs, read 3 October 2026
OptionRequiresSandboxingWhen to use
Native Windowsnothing; Git for Windows optionalnot supportedWindows-native projects and tools
WSL 2WSL 2 enabledsupportedLinux toolchains, sandboxed commands
WSL 1WSL 1 enablednot supportedwhen WSL 2 is unavailable

Check it works

Three checks after you install

A version number means the install worked. If claude is not found, the install folder is not on your PATH yet.

  1. 1

    Prints a version number

  2. 2

    Read-only health check: the install, settings files, the last update

  3. 3

    Inside a session: version, model, account and connection

    /doctor inside a session runs a fuller checkup and offers fixes, asking before it changes anything.

Sign in

Which account, and what it bills

The first time you run claude, it opens a browser to log in. If the browser does not open, press c to copy the login link.

How to sign in to Claude Code and who bills you, from Anthropic's authentication docs and claude.com/pricing, read 3 October 2026
AccountHow you sign inWhat you pay
Pro or Maxbrowser login with your claude.ai accountthe plan fee: $20, $100 or $200 a month, within five-hour and weekly limits
Team or Enterprisethe claude.ai account your admin invitedper seat: Team from $20 a month billed annually; Enterprise $20 a seat plus usage at API rates
Claude ConsoleConsole credentials, after an admin invite; an API key works tooevery token at API rates
Amazon Bedrock, Google Cloud, Microsoft Foundryenvironment variables, or “3rd-party platform” at the login prompt (Bedrock, Google Cloud)your cloud account, at its per-token rates
Free claude.ai plan—does not include Claude Code
If ANTHROPIC_API_KEY is set, Claude Code asks once to use that key instead of the browser, and the key's account is billed. Every plan side by side is in Claude Code pricing; how the windows work is in Claude usage limits.

Claude Code in VS Code, Cursor and JetBrains

In your editor

VS Code and Cursor get an extension with its own chat panel. JetBrains IDEs get a plugin that runs the claude you installed.

Claude Code in IDEs, from Anthropic's VS Code and JetBrains docs, read 3 October 2026
EditorHowNote
VS Code 1.94+Extensions view (Cmd/Ctrl+Shift+X), search “Claude Code”, Installbundles its own CLI for the chat panel
Cursorthe same extension, from Cursor’s Extensions viewsame as VS Code
Other VS Code forkssearch “Claude Code”, or install from Open VSXor run claude in the editor’s terminal
JetBrains: IntelliJ IDEA, PyCharm, WebStorm, GoLand…install the CLI, then the Claude Code plugin from JetBrains Marketplace; restartCmd+Esc / Ctrl+Esc opens it
Any terminalrun claude; /ide connects it to an open IDEthe CLI works in any terminal
The VS Code extension does not put claude on your PATH: to run it in the editor's terminal, install the CLI too. The JetBrains plugin bundles no CLI and says “Cannot launch Claude Code” until it finds one.

Troubleshooting

If the install fails

Find the message you see. Each row is from Anthropic's install and login troubleshooting page.

Claude Code install and login errors, cause and fix, from Anthropic's troubleshooting docs, read 3 October 2026
You seeWhyFix
command not found: claudethe install folder is not on PATHopen a new terminal; add ~/.local/bin to PATH
syntax error near unexpected token '<'the install URL returned a web pageuse Homebrew or WinGet, or retry later
curl: (22) … error: 403region, proxy or firewallcheck your network; Claude Code is not available in every country
'irm' is not recognizedyou are in CMD, not PowerShelluse the CMD command, or open PowerShell
The token '&&' is not a valid statement separatoryou are in PowerShell, not CMDuse the PowerShell command
Claude Code does not support 32-bit Windowsthe “Windows PowerShell (x86)” windowopen Windows PowerShell without x86
Cask 'claude-code' is unavailablean old Homebrew indexbrew update, then install again
Killeda Linux server low on memoryfree memory or add swap
EACCES: permission deniedthe install folder is not writablefix its permissions; leave npm for the native installer
API Error: 403 Request not allowedno active plan, or no Claude Code role in the Consolecheck claude.ai/settings, or ask an admin for the role
This organization has been disabledan old ANTHROPIC_API_KEY overrides your planunset it and remove it from your shell profile
Still stuck: run claude doctor, or Anthropic's full troubleshooting page has more errors and the PATH fix for each shell.

Next

See what your sessions cost

Claude Code writes every session to disk. Caprock, a free desktop app, runs Claude Code in terminal tabs per project, reads those files and shows every session live, with tokens and cost per repository. Free, local, one download.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app

Then open the app. It reads Claude Code, Codex, OpenCode and more; not Cursor or Copilot. More in how to check Claude Code usage.

The full guide

Install Claude Code, step by step

Claude Code is one native program, claude, that runs in a terminal. The installer puts it in your home folder, so it needs no administrator rights, and it keeps itself up to date. Everything else on this page is a variation on that: a package manager instead of the script, an editor instead of a terminal, a cloud account instead of a plan.

What the installer does

On macOS and Linux the native installer puts the program under ~/.local/share/claude/versions/ and a launcher at ~/.local/bin/claude; on Windows the launcher is %USERPROFILE%\.local\bin\claude.exe. That folder has to be on your PATH. If claude is not found after the install, open a new terminal first: the one you installed from still has the old PATH.

Claude Code checks for updates when it starts and while it runs, downloads them in the background and switches to them the next time you start it. It keeps the two newest versions and deletes older ones. claude update installs an update now; claude doctor shows the result of the last attempt.

Latest or stable

There are two release channels. latest, the default, gets each release as it ships. stable is typically about a week old and skips releases with major regressions. Choose one in /config, or set autoUpdatesChannel in settings.json. Homebrew picks the channel by cask name instead: claude-code follows stable, claude-code@latest follows latest. A newly launched model can need a version newer than stable serves.

To install on the stable channel from the start, in a terminal on macOS, Linux or WSL, then in Windows PowerShell:

$ curl -fsSL https://claude.ai/install.sh | bash -s stable
PS> & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable

Windows: which shell Claude Code uses

Claude Code runs on Windows without WSL. Without Git for Windows it runs shell commands through PowerShell. With Git for Windows installed it uses Git Bash for its Bash tool, and PowerShell stays available alongside. If Git is installed but Claude Code cannot find it, set CLAUDE_CODE_GIT_BASH_PATH in the env block of settings.json to the full path of bash.exe. Claude Code needs a 64-bit Windows.

Inside WSL it is the Linux program: install and start it in the WSL terminal. Keep projects on the Linux file system (/home/), not under /mnt/c/: search across the two file systems is slower and can return fewer matches.

Linux package repositories

Anthropic publishes signed apt, dnf and apk repositories for Debian, Ubuntu, Fedora, RHEL and Alpine, each with a stable and a latest channel. They update through your normal system upgrade, not through Claude Code. The commands, which add a signing key and a repository file, are on Anthropic's setup page. Distribution by distribution, with Arch, PATH fixes and a desktop app, see Claude Code on Linux.

Updating and removing it

How to update and uninstall Claude Code, by install method.
Installed withUpdateUninstall
Native installerautomatic, or claude updatedelete ~/.local/bin/claude and ~/.local/share/claude
Homebrewbrew upgrade claude-codebrew uninstall --cask claude-code
WinGetwinget upgrade Anthropic.ClaudeCodewinget uninstall Anthropic.ClaudeCode
npmnpm install -g @anthropic-ai/claude-code@latestnpm uninstall -g @anthropic-ai/claude-code
Avoid npm update -g: it keeps to the original version range. On Windows the native files are under %USERPROFILE%\.local.

Uninstalling leaves your settings, MCP servers and session history in ~/.claude and ~/.claude.json. Delete those too only if you want them gone: it cannot be undone. The VS Code extension, the JetBrains plugin and the Desktop app also write there, so remove them first or the folder comes back.

Where your sessions go

Claude Code writes every session to ~/.claude/projects/ as JSON lines, with the tokens of every call, and deletes them after 30 days by default. That record is what Caprock and other usage tools read: see how to check Claude Code usage for the ways to see it, and Claude Code pricing for what each plan includes.

Questions people ask

Is Claude Code free?
Installing it is free, but using it needs a paid account: Pro, Max, Team, Enterprise, or a Claude Console account billed per token. The free claude.ai plan does not include Claude Code.
Does Claude Code work on Windows?
Yes, on Windows 10 1809 or later, natively or inside WSL. Install it from PowerShell with irm https://claude.ai/install.ps1 | iex; Git for Windows is optional and gives it Git Bash.
Do I need Node.js to install Claude Code?
No. The native installer, Homebrew, WinGet and the Linux package repositories need no Node.js. Only the npm install does, Node.js 22 or later, and even then the installed program does not use Node.js.
How do I update Claude Code?
The native install updates itself in the background; claude update applies an update now. Homebrew and WinGet installs need brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode.
How do I uninstall Claude Code?
For the native install, delete ~/.local/bin/claude and ~/.local/share/claude. Otherwise use brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode or npm uninstall -g @anthropic-ai/claude-code. Your settings and history stay in ~/.claude until you delete it.
Do I need the CLI for the VS Code extension?
Not for its chat panel: the extension bundles its own copy. To run claude in the editor's terminal, or to use the JetBrains plugin, install the CLI too.

Sources

Try it

The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app