Install and Update Claude Code CLI: Mac, Linux, Windows

From the guide: Claude Code Comprehensive Guide

Installing Claude Code is one command per platform – curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell – and updating is either automatic (the default) or one claude update. The part most pages skip is everything after that first command: which install method to pick when you have four, how the autoupdater behaves and how to turn it off, how to pin a specific version, and how to uninstall each method cleanly. This page is that reference, one table per job, current as of v2.1.224 (August 2026).1

TL;DR

  • Use the native installer. It has no Node.js dependency, ships the tested binary per platform, and has been the default since v2.1.113. The npm package is legacy – deprecated since v2.1.15, and it now requires Node.js 22+.1
  • Updates are automatic by default: Claude Code checks at startup and periodically during sessions, downloads in the background, and applies on the next launch. claude update forces one now.2
  • Turning updates off is two different switches: DISABLE_AUTOUPDATER=1 stops background updates; DISABLE_UPDATES=1 (v2.1.118+) blocks every update path including a manual claude update.2
  • Pin a version by passing it to the installer: curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58. Check what you run with claude --version; browse what changed with /release-notes.12
  • When anything misbehaves, run claude doctor – it reports install type, version, and detected issues, and since v2.1.205 the in-session /doctor diagnoses and fixes setup problems.2

How Do I Install Claude Code CLI?

One command, by platform:

# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

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

# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Prefer a package manager? Both are first-class:

brew install --cask claude-code          # macOS / Linux (stable channel)
winget install Anthropic.ClaudeCode      # Windows

Then run claude in a project directory and authenticate with a Claude Pro/Max/Team subscription or an Anthropic API account.1 The native installer needs no Node.js, no sudo, nothing pre-installed. If you must use the legacy npm path (npm install -g @anthropic-ai/claude-code), it requires Node.js 22 or later and should never be run with sudo – root-owned global modules create permission problems that outlive the install.1 Already on npm? claude install migrates you to the native binary in place.

For first-session setup – authentication choices, the first prompt, permission modes – the quickstart walkthrough covers the path from zero to first result.

Which Platforms Does Claude Code Support?

Platform Status Notes
macOS 13+ (Apple Silicon) Supported Native arm64 binary since v2.1.113; no Rosetta
macOS 13+ (Intel) Supported Native installer or Homebrew
Ubuntu 20.04+ / Debian 10+ Supported glibc compatibility fixed in v2.1.50
Fedora / RHEL 8+ Best-effort Works via the same glibc fix; not an official target
Alpine / musl Supported with extras apk add libgcc libstdc++ ripgrep plus USE_BUILTIN_RIPGREP=0
Windows 10 1809+ / Server 2019+ (x64 and ARM64) Supported No admin rights needed; Git for Windows optional (it enables the Bash tool); the PowerShell tool is on by default for claude.ai and Console accounts, and CLAUDE_CODE_USE_POWERSHELL_TOOL=1 turns it on for Bedrock, Vertex, and Foundry sessions3
Windows WSL 2 Supported Linux toolchains and sandboxed command execution; install inside the WSL terminal3
Windows WSL 1 / Git Bash Supported No sandboxing on WSL 1; Git Bash may need CLAUDE_CODE_GIT_BASH_PATH3

The recurring Windows question: native Windows works and needs no administrator rights; Anthropic’s own guidance is to pick by where your projects live and what you need, with WSL 2 when you want Linux toolchains or sandboxed command execution, and the same Linux installer runs inside it.3

How Do I Update Claude Code?

You usually don’t have to. Claude Code auto-updates by default – it checks for a new version at startup and periodically during sessions, downloads in the background, and applies the update the next time it launches.2 To force an update immediately, or if you’ve disabled the autoupdater:

claude update

Package-manager installs update through their own channel – brew upgrade --cask claude-code, winget upgrade Anthropic.ClaudeCode – and since v2.1.129, setting CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 lets those installs run the package-manager upgrade in the background and prompt for a restart.2

Controlling updates is two distinct switches, and the difference matters in locked-down environments:

Switch Effect
DISABLE_AUTOUPDATER=1 Stops automatic background updates; claude update still works
DISABLE_UPDATES=1 (v2.1.118+) Blocks all update paths, including manual claude update

Set either as an environment variable or under "env" in settings.json.2

How Do I Install a Specific Version?

Pass the version to the installer – useful for reproducing a bug, holding a team on a known-good release, or rolling back:

# Specific version
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58

# Latest, explicitly
curl -fsSL https://claude.ai/install.sh | bash -s latest

# Windows PowerShell, specific version
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58

Confirm with claude --version, and read what any release changed with the in-session /release-notes picker.2 If you pin, pair it with DISABLE_AUTOUPDATER=1 – otherwise the autoupdater will politely un-pin you at the next launch. (Use DISABLE_UPDATES=1 instead when you also want manual claude update locked out.)

How Do I Uninstall Claude Code?

Match the uninstall to the install method:

Method Uninstall
Native (macOS / Linux / WSL) rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude
Native (Windows) Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force; Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
Homebrew brew uninstall --cask claude-code
winget winget uninstall Anthropic.ClaudeCode
npm (legacy) npm uninstall -g @anthropic-ai/claude-code

Your configuration lives separately in ~/.claude/, so removing the binary does not delete settings, skills, or history – delete that directory too only if you want a truly clean slate.1

The Whole Lifecycle in One Table

Method Install Update Version check
Native (macOS/Linux/WSL) curl -fsSL https://claude.ai/install.sh \| bash claude update or autoupdate claude --version
Native (Windows PS) irm https://claude.ai/install.ps1 \| iex claude update claude --version
Homebrew brew install --cask claude-code brew upgrade --cask claude-code claude --version
winget winget install Anthropic.ClaudeCode winget upgrade Anthropic.ClaudeCode claude --version
npm (legacy) npm install -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code@latest claude --version

And when something is off – wrong version reported, command not found after an update, an install that half-applied – claude doctor from the shell reports installation type, version, and detected issues, while /doctor inside a session (v2.1.205+) runs a full checkup that can fix what it finds.2 The full Claude Code guide covers everything past installation: configuration, permissions, hooks, MCP, and subagents.

Windows Troubleshooting: claude Not Recognized, Wrong Shell, Blocked Scripts

Most Windows failures are one of nine, each with a recognizable error string. Every fix below comes from Anthropic’s installation troubleshooting page and setup page as of 2026-09-07.34

1. 'claude' is not recognized as an internal or external command (CMD) or The term 'claude' is not recognized as the name of a cmdlet (PowerShell). The installer placed claude.exe at %USERPROFILE%\.local\bin\claude.exe; that directory is not on your PATH, or you are still in the terminal you installed from, which keeps its old PATH. Check, add, then open a new terminal:4

$env:PATH -split ';' | Select-String '\.local\\bin'      # no output = not on PATH
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

In CMD the check is echo %PATH% | findstr /i "local\bin", and the fix is adding %USERPROFILE%\.local\bin to the User PATH under Environment Variables.4

2. 'irm' is not recognized, The token '&&' is not a valid statement separator, or A parameter cannot be found that matches parameter name 'fsSL'. You ran the install line for a different shell. irm missing means you are in CMD (the prompt reads C:\): use the CMD installer above, or open PowerShell (PS C:\). && rejected means you are in PowerShell running the CMD line: use irm https://claude.ai/install.ps1 | iex. The fsSL complaint means you pasted the macOS/Linux curl -fsSL ... | bash line into PowerShell, where curl is an alias for Invoke-WebRequest. If the command prints the script’s text and installs nothing, you ran the download half without the part that executes it.4

3. running scripts is disabled on this system / PSSecurityException. PowerShell’s execution policy is blocking the .ps1 launcher shims that npm creates (npm.ps1, claude.ps1). It does not affect the native installer, which runs the downloaded text through iex rather than a saved file, and a saved ClaudeInstall.ps1 run with -ExecutionPolicy Bypass -File is not one of Anthropic’s documented install paths (the setup page lists only the irm line, the CMD installer, WinGet, and npm). Fixes, in order: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser; or call claude.cmd (the policy does not cover .cmd); or replace the npm install with the native installer.4

4. iex parse errors that quote HTML tags or CSS, or curl: (22) The requested URL returned error: 403. The install URL returned a web page instead of the script. If the page says “App unavailable in region”, Claude Code is not offered in your country; otherwise a proxy or filter is in the way. Test reachability with curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest (call curl.exe explicitly; PowerShell’s curl alias rejects -sI), where a 200 first line means the host is reachable and the failure was transient. winget install Anthropic.ClaudeCode is the documented alternative.4

5. Could not establish trust relationship for the SSL/TLS secure channel, or CRYPT_E_NO_REVOCATION_CHECK (0x80092012). For the first, force TLS 1.2 before the installer: [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12. The revocation errors mean your network blocks certificate revocation lookups; add --ssl-revoke-best-effort to the CMD curl line, or use the PowerShell installer, which downloads through .NET and tolerates an unreachable revocation server.4

6. The process cannot access the file ... because it is being used by another process. A previous installer is still running or antivirus is scanning a partial download in %USERPROFILE%\.claude\downloads. Close other PowerShell windows, wait for the scan, then:4

Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads"
irm https://claude.ai/install.ps1 | iex

7. The wrong version runs, or two installs disagree. where.exe claude lists every claude on your PATH; Test-Path "$env:USERPROFILE\.local\bin\claude.exe" says whether the native installer placed its binary. Keep the native one and remove the rest (winget uninstall Anthropic.ClaudeCode, npm uninstall -g @anthropic-ai/claude-code, Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local" for a legacy local npm install). claude doctor prints the installation type and version it is actually running.4

8. Claude Code on Windows requires either Git for Windows (for bash) or PowerShell. Neither shell was found. Git for Windows is optional: without it Claude Code runs commands through its PowerShell tool; with it, the Bash tool uses Git Bash. If Git Bash is installed but not found, point at it in settings.json:3

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

9. Claude Code does not support 32-bit Windows. You opened the x86 PowerShell entry on a 64-bit machine. Open “Windows PowerShell”, not the “(x86)” one.4

If none of these match, claude doctor (read-only, no session started) reports install health, settings-file errors, and the result of the last update attempt, and Anthropic’s troubleshooting page keeps the full error-to-fix table.34

FAQ

How do I update Claude Code CLI to the latest version?

Run claude update, or simply restart – Claude Code checks for updates at startup and during sessions by default, downloading in the background and applying on next launch. Homebrew and winget installs update via brew upgrade --cask claude-code and winget upgrade Anthropic.ClaudeCode instead.

Does Claude Code update automatically?

Yes, by default: it checks at startup and periodically while running, then applies the downloaded update on the next launch. DISABLE_AUTOUPDATER=1 turns background updates off while keeping manual claude update; DISABLE_UPDATES=1 blocks every update path.

How do I install Claude Code on Windows?

Run irm https://claude.ai/install.ps1 | iex in PowerShell (or winget install Anthropic.ClaudeCode). Native Windows 10 (1809+) is supported on x64 and ARM64 with no admin rights; choose WSL 2 when you need Linux toolchains or sandboxed command execution, and expect the Linux installer to run inside it for full Linux parity – run the Linux install command inside it.

Do I need Node.js to install Claude Code?

No – the recommended native installer has no Node.js dependency. Only the legacy npm package (npm install -g @anthropic-ai/claude-code, deprecated since v2.1.15) needs Node, and it requires Node.js 22 or later. If you are on the npm install, claude install migrates you to the native binary.

How do I check which version of Claude Code I have?

claude --version from the shell, or /release-notes inside a session for an interactive changelog picker. claude doctor additionally reports the installation type and any detected setup issues.



  1. Anthropic, “Set up Claude Code” – install commands per platform, native installer as the recommended path, npm’s Node.js 22+ requirement, and authentication options. Verified 2026-08-07. Platform matrix detail in the Claude Code guide

  2. Anthropic, Claude Code changelog and release notes, as tracked in the Claude Code guide (verified through v2.1.224, August 7, 2026; none of v2.1.221-224 changed install or update behavior) – autoupdate behavior, DISABLE_AUTOUPDATER vs DISABLE_UPDATES (v2.1.118), CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE (v2.1.129), version-pinned installs, claude doctor, and /doctor as a diagnose-and-fix checkup (v2.1.205). 

  3. Anthropic, “Advanced setup” – system requirements (Windows 10 1809+ or Windows Server 2019+, x64 or ARM64); the three native install lines (curl ... | bash, irm https://claude.ai/install.ps1 | iex, the CMD install.cmd form); “Set up on Windows”: native vs WSL chosen by project location and features, sandboxing supported on WSL 2 only, “You do not need to run as Administrator”, Git for Windows optional and enabling the Bash tool, the PowerShell tool on by default for claude.ai and Console accounts and enabled by CLAUDE_CODE_USE_POWERSHELL_TOOL=1 on Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, CLAUDE_CODE_GIT_BASH_PATH in settings.json; claude doctor; Windows uninstall paths under %USERPROFILE%\.local. Fetched 2026-09-07. 

  4. Anthropic, “Troubleshoot installation and login” – the “Find your error” table and its fixes: PATH check $env:PATH -split ';' | Select-String '\.local\\bin' and the [Environment]::SetEnvironmentVariable line; “Wrong install command on Windows” (irm / && / fsSL / bash not recognized, script text printed); running scripts is disabled on this system (npm .ps1 shims; Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, claude.cmd, or the native installer); install script returns HTML or 403, curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest, WinGet alternative; TLS 1.2 and CRYPT_E_NO_REVOCATION_CHECK with --ssl-revoke-best-effort; The process cannot access the file and %USERPROFILE%\.claude\downloads; “Check for conflicting installations” (where.exe claude, Test-Path, winget uninstall, npm uninstall -g, legacy ~/.claude/local); the Git-for-Windows-or-PowerShell and 32-bit errors. Fetched 2026-09-07. 

Related Posts

Install and Update Codex CLI: Mac, Linux, Windows

Every way to install, update, pin, and uninstall the OpenAI Codex CLI -- the install script, npm, Homebrew, winget -- on…

19 min read

Anthropic Python SDK 1.0 Migration: By Hand or Claude Code

Migrate anthropic 0.x to 1.0: httpx2, async raw responses, Bedrock region. By hand from MIGRATION.md or with Claude Code…

10 min read

The Ralph Loop: How I Run Autonomous AI Agents Overnight

I built an autonomous agent system with stop hooks, spawn budgets, and filesystem memory. Here are the failures and what…

11 min read