Installing Claude Code

May 10, 2026 · View on GitHub

中文版:install-claude-code_zh.md

This page is the verbatim Claude Code install guide that used to live at the top of README.md. If you already have claude on your PATH, skip this and go back to the repo root.

Comparison of Usage Methods

MethodBest ForProsCons
WebComplete beginnersNo installation requiredLimited features
CLI (command line)DevelopersFull-featured, highly integratedRequires command-line familiarity
Editor integration (VS Code / Cursor, etc.)Daily developmentSeamless workflowDepends on plugins and environment setup

Recommendation:

  • Complete beginner → Try the web at https://claude.ai/ first
  • Want to use it for development → Go straight to CLI
  • Already familiar → Consider editor integration

This guide focuses on the CLI.


Installing Claude Code CLI

1. Prerequisites

  • A Claude account — register at claude.ai (skip if using a third-party compatible provider)
  • A command-line tool:
    • Mac / Linux: open Terminal
    • Windows: open PowerShell or install WSL

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

Verify the installation:

claude --version

A version number means it installed successfully.

3. Install via npm

Prerequisite: Node.js must be installed (verify: node --version; if missing, download from nodejs.org)

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

If the download is slow, use a mirror:

npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com

4. Updating

Update manually:

claude update

Claude Code checks for updates at launch and installs them in the background; the new version takes effect on the next launch. Configure update behavior in settings.json:

{
  "autoUpdatesChannel": "stable"
}

Disable automatic updates:

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

Note: Homebrew and WinGet installations do not support automatic updates. Update manually:

brew upgrade claude-code           # macOS
winget upgrade Anthropic.ClaudeCode  # Windows

5. Common Installation Issues

ProblemCauseSolution
npm command not foundNode.js not installedDownload from nodejs.org
permission deniedInsufficient permissionsMac/Linux: prefix with sudo; Windows: run PowerShell as Administrator
Slow or stalled installationNetwork issuesUse a mirror: --registry=https://registry.npmmirror.com

Terminal Recommendations