Skip to content

Installation ​

This page covers everything you need to install Claude Code — system requirements, platform-specific steps, how to keep it updated, and how to uninstall it cleanly.

Account required

Claude Code requires a Pro, Max, Team, Enterprise, or Console account.
The free Claude.ai plan does not include access. The cheapest entry point is the Anthropic Console (pay-as-you-go, no subscription needed).


System requirements ​

RequirementDetails
Operating systemmacOS 13+, Windows 10 (build 1809)+, Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+
RAM4 GB minimum
NetworkInternet connection required
ShellBash, Zsh, PowerShell, or CMD
Windows dependencyGit for Windows required
LocationAnthropic supported countries

Install Claude Code ​

Choose the installation method for your platform. The native installer is recommended for all platforms — it requires no external dependencies and auto-updates in the background.

macOS / Linux / WSL ​

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

Homebrew does not auto-update

Run brew upgrade claude-code periodically to stay current.
Also run brew cleanup claude-code occasionally to reclaim disk space from old versions.

Windows ​

powershell
irm https://claude.ai/install.ps1 | iex
cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
powershell
winget install Anthropic.ClaudeCode

PowerShell vs CMD

If you see The token '&&' is not a valid statement separator, you are in PowerShell — not CMD.
Your prompt shows PS C:\ when you're in PowerShell. Use the PowerShell command instead.

Windows requires Git for Windows

Claude Code uses Git Bash internally. Install it first from git-scm.com/downloads/win.
You do not need to run PowerShell as Administrator.

WinGet does not auto-update

Run winget upgrade Anthropic.ClaudeCode periodically to get the latest version.

Desktop app (no terminal required) ​

If you prefer a graphical interface, the Claude Desktop app lets you use Claude Code without a terminal. It supports visual diff review, multiple sessions side by side, and scheduled tasks.

After installing, launch the app, sign in, and click the Code tab.


Platform-specific notes ​

Windows — configure Git Bash path ​

Claude Code auto-detects Git Bash from the default install location. If it was installed elsewhere, set the path manually in %USERPROFILE%\.claude\settings.json:

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

Windows — WSL ​

Both WSL 1 and WSL 2 are supported. Inside your WSL terminal, install using the Linux/macOS command:

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

WSL 2 additionally supports sandboxing for enhanced security. WSL 1 does not.

Alpine Linux and musl-based distributions ​

The native installer on Alpine requires libgcc, libstdc++, and ripgrep. Install them first:

sh
apk add libgcc libstdc++ ripgrep

Then disable the built-in ripgrep in ~/.claude/settings.json:

json
{
  "env": {
    "USE_BUILTIN_RIPGREP": "0"
  }
}

Verify your installation ​

After installing, confirm Claude Code is working:

bash
claude --version

For a full health check of your environment — shell, Git Bash path, network, and auth:

bash
claude doctor

Then start Claude Code in any project directory:

bash
cd your-project
claude

You will be prompted to log in on first use.


Keeping Claude Code updated ​

Auto-updates (native install only) ​

Native installations check for updates on startup and install them in the background. The update takes effect the next time you start Claude Code.

To apply an update immediately without waiting:

bash
claude update

Release channels ​

You can choose which release channel to follow:

ChannelDescription
latestNew features as soon as they are released (default)
stableTypically ~1 week behind; skips releases with major regressions

Set your preferred channel in ~/.claude/settings.json (macOS/Linux) or %USERPROFILE%\.claude\settings.json (Windows):

json
{
  "autoUpdatesChannel": "stable"
}

Or set it interactively inside a Claude Code session: /config → Auto-update channel.

Disable auto-updates ​

If you want full manual control over updates:

json
{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}

Install a specific version ​

You can pin a specific version number or channel at install time:

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

The channel you choose at install time becomes the default for future auto-updates.


Migrating from npm (legacy) ​

npm installation is deprecated

The native installer is faster, requires no Node.js dependency, and auto-updates automatically. Migrate when possible.

If you previously installed Claude Code via npm, switch to the native installer:

bash
# 1. Install the native binary
curl -fsSL https://claude.ai/install.sh | bash

# 2. Remove the old npm installation
npm uninstall -g @anthropic-ai/claude-code

If you still need npm for compatibility reasons (requires Node.js 18+):

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

Do not use sudo npm install -g — this causes permission issues and security risks.


Uninstalling Claude Code ​

Native install ​

bash
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
powershell
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Homebrew ​

bash
brew uninstall --cask claude-code

WinGet ​

powershell
winget uninstall Anthropic.ClaudeCode

npm ​

bash
npm uninstall -g @anthropic-ai/claude-code

Remove configuration and session data ​

This deletes all your settings permanently

This removes your settings, MCP server configs, allowed tools, and full session history. Only do this if you want a completely clean slate.

bash
# Remove global settings and state
rm -rf ~/.claude
rm -f ~/.claude.json

# Remove project-level settings (run from project directory)
rm -rf .claude
rm -f .mcp.json
powershell
# Remove global settings and state
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

# Remove project-level settings (run from project directory)
Remove-Item -Path ".claude" -Recurse -Force
Remove-Item -Path ".mcp.json" -Force

Troubleshooting ​

claude is not recognized
Close and reopen your terminal after installation so the updated PATH is loaded.

Git Bash not found (Windows)
Set CLAUDE_CODE_GIT_BASH_PATH in your settings.json (see Windows section above).

&& is not a valid statement separator (Windows)
You are in PowerShell. Use the PowerShell install command, not the CMD one.

Permission errors during install
Do not use sudo or "Run as Administrator" — Claude Code does not require elevated permissions.

Search not working (Alpine Linux)
Make sure ripgrep is installed and USE_BUILTIN_RIPGREP is set to "0" in settings.

For anything else, run claude doctor first — it diagnoses most common issues automatically. Then see the official troubleshooting guide.


Next steps ​

Released under the MIT License.