Claude Code · Guide
How to install and update Claude Code
Every command on this page is copied from the official Anthropic documentation, listed at the end, and checked on 18 October 2026.
Quick answer: Native installs of Claude Code update themselves in the background. To update right now run claude update, and check your version with claude --version. To install, run curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. The latest version is 2.1.302, released 16 October 2026.
Install Claude Code
The native installer is recommended and keeps itself up to date. No administrator rights are needed.
macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell
irm https://claude.ai/install.ps1 | iexWindows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdPowerShell shows PS C:\ in the prompt, CMD shows only C:\.
Other ways to install
Homebrew (stable channel; claude-code@latest for the latest channel)
brew install --cask claude-codeWinGet
winget install Anthropic.ClaudeCodenpm (needs Node.js 22 or later; do not use sudo)
npm install -g @anthropic-ai/claude-codeAnthropic also publishes signed apt, dnf and apk repositories; the setup page lists the commands.
Sign in
Run claude and follow the browser prompts. Claude Code needs a Pro, Max, Team, Enterprise or Console account; the free claude.ai plan does not include it. To bill an API account instead of a subscription:
claude auth login --consoleCheck the login
claude auth status --textCheck your version
claude --versionThe output looks like 2.1.302 (Claude Code). Inside a session, /status shows the version too, and claude doctor checks the installation and auto-update status.
Update Claude Code
Native installs check for updates on startup and while running, download them in the background and use them the next time you start Claude Code. To update now:
claude updateIt prints the old and new version, or that Claude Code is already up to date. Package-manager installs do not update themselves; see the next section.
Update with a package manager
Homebrew
brew upgrade claude-codeWinGet
winget upgrade Anthropic.ClaudeCodeapt
sudo apt update && sudo apt upgrade claude-codednf
sudo dnf upgrade claude-codeapk
apk update && apk upgrade claude-codenpm (use install @latest, not npm update -g)
npm install -g @anthropic-ai/claude-code@latestLatest or stable channel
The latest channel (the default) gets every release as it ships. The stable channel is typically about a week behind and skips releases with major regressions. Change it under /config → Auto-update channel, or in ~/.claude/settings.json:
{
"autoUpdatesChannel": "stable"
}Homebrew picks the channel by cask name and apt, dnf and apk by repository, not by this setting.
Install a specific version
macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.302Windows PowerShell
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.302Or from an existing install
claude install 2.1.302Turn off automatic updates
Add this to settings.json; claude update still works. DISABLE_UPDATES blocks manual updates as well.
{
"env": {
"DISABLE_AUTOUPDATER": "1"
}
}Requirements
macOS 13 or later; Windows 10 1809+ or Windows Server 2019+ (64-bit only); Ubuntu 20.04+, Debian 10+ or Alpine 3.19+. At least 4 GB of RAM, an x64 or ARM64 processor, an internet connection and a country Anthropic supports.
Troubleshooting
command not found: claude: open a new terminal, then add the install folder to your PATH (zsh shown):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFind duplicate installs and diagnose
which -a claude
claude doctorOn Windows, 'irm' is not recognized means you are in CMD (use the CMD command), and an error about '&&' or 'fsSL' means you are in PowerShell (use irm https://claude.ai/install.ps1 | iex). Use where.exe claude to find duplicates.
Questions
- How do I update Claude Code?
- Native installs update automatically in the background. To update now, run claude update. Homebrew, WinGet, apt, dnf, apk and npm installs need their own upgrade command, such as brew upgrade claude-code or npm install -g @anthropic-ai/claude-code@latest.
- How do I check the Claude Code version?
- Run claude --version (or claude -v). Inside a session, /status shows it too.
- Does Claude Code update automatically?
- Yes for the native installer: it checks on startup and while running and installs updates in the background. Package-manager installs do not, unless you set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE for Homebrew or WinGet.
- What is the difference between the latest and stable channel?
- latest (the default) gets every release immediately; stable is typically about a week behind and skips releases with major regressions. Switch in /config or with the autoUpdatesChannel setting.
- How do I install Claude Code on Windows?
- In PowerShell run irm https://claude.ai/install.ps1 | iex; in CMD run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. WinGet (winget install Anthropic.ClaudeCode) and WSL also work.
Sources
Claude Code changelog · Is Claude down? · Claude usage resets · Install Codex CLI · 中文
