How to Install Claude Code
Install Claude Code with the current official setup paths, verify the CLI, authenticate safely, and avoid common first-day mistakes.
Install Claude Code from an official setup path, verify the claude command, then authenticate from the terminal where you will work. Do not rely on old npm-only tutorials without checking the current setup page.
Last checked on May 24, 2026. Claude Code has native installers, package manager options, and npm support. The official setup page is the source of truth for exact commands and supported platforms.
Short Answer
For most users, use the native installer recommended by the Claude Code docs. Homebrew, WinGet, apt, dnf, apk, and npm are also documented paths, but update behavior differs by method.
System Requirements
| Area | Current practical requirement |
|---|---|
| OS | macOS 13+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+. |
| Hardware | 4 GB+ RAM, x64 or ARM64 processor. |
| Shell | Bash, Zsh, PowerShell, or CMD. |
| Network | Internet access and supported country availability. |
| Account | Pro, Max, Team, Enterprise, Console, or supported cloud-provider access. Free Claude does not include Claude Code. |
Install Paths
| Platform or preference | Command or path | Notes |
|---|---|---|
| macOS, Linux, WSL native installer | `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 | Use this in CMD, not PowerShell. |
| Homebrew | brew install --cask claude-code | Stable cask; manual upgrade with brew upgrade claude-code. |
| Homebrew latest | brew install --cask claude-code@latest | Receives new versions faster; manual upgrade required. |
| WinGet | winget install Anthropic.ClaudeCode | Manual upgrade with winget upgrade Anthropic.ClaudeCode. |
| npm | npm install -g @anthropic-ai/claude-code | Requires Node.js 18+. Do not use sudo npm install -g. |
Verify Installation
Run:
claude --version
claude doctorIf the command is not found, check your PATH, terminal restart, package manager install location, or conflicting old installations.
Authenticate
After installation, run:
claudeFollow the browser login flow. For terminal CLI sessions, credential precedence matters. Cloud provider settings, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, helper scripts, OAuth tokens, and subscription OAuth can all change how the session is billed. If you expect to use a subscription but have ANTHROPIC_API_KEY set, confirm /status before a long session.
First Project Checklist
- Open a small project directory, not your largest monorepo.
- Run
claude. - Ask for a read-only overview first.
- Add a concise
CLAUDE.mdwith build, test, lint, and safety rules. - Use Plan Mode before the first multi-file change.
- Review the diff before committing.