Claude Code Installation Guide

This guide provides detailed instructions for installing, configuring, and updating Claude Code on various platforms.

System Requirements

Claude Code supports the following operating systems and configurations:

ComponentRequirements
Operating SystemsmacOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+
Memory4 GB or more
NetworkInternet connection required
ShellBash, Zsh, PowerShell, or CMD
RegionAnthropic supported countries and regions

Additional Dependencies

  • ripgrep: Usually included with Claude Code; if search fails, see the troubleshooting section.

Installation Methods

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

Note: Windows requires Git for Windows to be installed first.

Native installations automatically update in the background.

Method Two: Homebrew (macOS/Linux)

brew install --cask claude-code

Homebrew installations do not auto-update. Run brew upgrade claude-code periodically for the latest features and security fixes.

Method Three: WinGet (Windows)

winget install Anthropic.ClaudeCode

WinGet installations do not auto-update. Run winget upgrade Anthropic.ClaudeCode periodically for manual updates.

Verify Installation

After installation, confirm Claude Code is working:

claude --version

For a more detailed installation and configuration check, run:

claude doctor

Account Authentication

Claude Code requires Pro, Max, Teams, Enterprise, or Console accounts. The free Claude.ai plan does not include Claude Code access.

After installation, run the claude command and follow the browser prompts to log in.

Updating Claude Code

Automatic Updates

Native installations check for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code.

You can control update timing by configuring the release channel:

  • latest (default): Receive new features immediately
  • stable: Use versions typically about a week old, skipping releases with major issues

Configure in your settings file:

{
  "autoUpdatesChannel": "stable"
}

Disable Automatic Updates

Set the environment variable in your settings file:

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

Manual Updates

Apply an update immediately without waiting for the background check:

claude update

Homebrew and WinGet installations require manual updates:

  • Homebrew: brew upgrade claude-code
  • WinGet: winget upgrade Anthropic.ClaudeCode

Advanced Installation Options

Install Specific Version

Install latest version:

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

Install stable version:

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

Install specific version (e.g., 1.0.58):

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

Migrate from npm to Native Install

If you previously installed Claude Code with npm, migrate to native install:

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

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

Deprecated npm Installation Method

npm installation is deprecated. If you really need npm installation, you must have Node.js 18+ installed first:

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

Note: Do NOT use sudo npm install -g as this can lead to permission issues and security risks.

Uninstall Claude Code

Native Installation Uninstall

macOS, Linux, WSL:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Windows PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Homebrew Uninstall

brew uninstall --cask claude-code

WinGet Uninstall

winget uninstall Anthropic.ClaudeCode

npm Uninstall

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

Remove Configuration Files

Warning: Removing configuration files will delete all settings, allowed tools, MCP server configurations, and session history.

macOS, Linux, WSL:

# Remove user settings and state
rm -rf ~/.claude
rm ~/.claude.json

# Remove project-specific settings (run from your project directory)
rm -rf .claude
rm -f .mcp.json

Windows PowerShell:

# Remove user settings and state
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

# Remove project-specific settings
Remove-Item -Path ".claude" -Recurse -Force
Remove-Item -Path ".mcp.json" -Force

Windows Special Configuration

Claude Code on Windows requires Git for Windows or WSL. You can launch claude from PowerShell, CMD, or Git Bash.

If Claude Code cannot find your Git Bash installation, configure the path in your settings file:

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

Alpine Linux Configuration

On Alpine and other musl/uClibc distributions, the native installer requires libgcc, libstdc++, and ripgrep. Install these dependencies using your package manager, then set USE_BUILTIN_RIPGREP=0.

Install required packages on Alpine:

apk add libgcc libstdc++ ripgrep

Then configure in your settings file:

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

Binary Integrity Verification

You can verify the integrity of Claude Code binaries using SHA256 checksums. Checksums are published in release manifests at: https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{VERSION}/manifest.json

Signed binaries are distributed for:

  • macOS: Signed by "Anthropic PBC" and notarized by Apple
  • Windows: Signed by "Anthropic, PBC"