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

Z przewodnika: 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+ (x64 and ARM64) Supported PowerShell tool needs CLAUDE_CODE_USE_POWERSHELL_TOOL=1
Windows WSL 2 Supported, recommended Windows path Full parity with Linux
Windows WSL 1 / Git Bash Supported Prefer WSL 2; Git Bash may need CLAUDE_CODE_GIT_BASH_PATH

The recurring Windows question: native Windows works, but WSL 2 gives you the Linux-identical experience, and the native installer runs the same way inside it.1

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.

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+ is supported on x64 and ARM64, but WSL 2 is the recommended path 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). 

Powiązane artykuły

The CLI Thesis: Why Agent Architecture Beats IDE Plugins

Three top HN Claude Code threads converge on one conclusion: CLI-first architecture is cheaper, faster, and more composa…

18 min czytania

The Skills My Agent Could Not See

Five skills in my Claude Code setup reached the model as bare names. The description budget drops routing information si…

14 min czytania

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 czytania