Install Claude Code
Install Claude Code with the recommended native installer, authenticate with the right account type, and verify the CLI works.
Use the native installer unless your organization deliberately manages Claude Code through Homebrew, WinGet, Linux packages, or npm.
Last checked on July 7, 2026. The commands below follow Anthropic's current setup docs. If an installer fails, use the official troubleshooting link at the end instead of guessing from old npm instructions.
Fast Path
| Your situation | Use this path | Verify it worked | Watch out |
|---|---|---|---|
| macOS, Linux, or WSL user | Native installer | claude --version and claude doctor | Restart the terminal if claude is not on PATH. |
| Windows PowerShell user | Native PowerShell installer | claude --version | PowerShell and CMD use different install commands. |
| Windows CMD user | Native CMD installer | claude --version | If PowerShell syntax errors appear, switch shells. |
| macOS team already using Homebrew | brew install --cask claude-code | brew list --cask claude-code | Homebrew installs do not auto-update by default. |
| API, CI, Bedrock, Vertex, or Foundry work | Console or provider credentials | /status plus billing dashboard | API keys can bill separately from subscriptions. |
| Free Claude account | Upgrade or use Console/provider access | Account plan page | The free Claude.ai plan does not include Claude Code access. |
Requirements
Claude Code currently supports macOS 13+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, and Alpine Linux 3.19+. It needs 4 GB+ RAM, an x64 or ARM64 processor, internet access, and a supported country or region.
ripgrep is usually included. If search inside Claude Code fails, troubleshoot search before assuming the install itself is broken.
Install
Native Install
macOS, Linux, and 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.cmdNative installs auto-update in the background.
Homebrew
brew install --cask claude-codeHomebrew installs require manual updates unless your environment opts into package-manager auto-updates.
Authenticate
After installation, open a terminal in your project and run:
claudeThen follow the browser login prompts.
Claude Code requires Pro, Max, Team, Enterprise, Console access, or a supported third-party provider. Do not set ANTHROPIC_API_KEY just because you have a Pro or Max subscription. An API key can make terminal sessions use API billing instead of subscription usage.
Verify
claude --version
claude doctorInside Claude Code, check the active account and credential path:
/statusUse this before long sessions, especially if you have API keys or cloud-provider credentials in your shell.
Common Issues
| Symptom | Likely cause | Fix |
|---|---|---|
claude: command not found | Installer path was not loaded. | Restart terminal, then check claude --version. |
Install command returns 403 or HTML syntax errors | Network, proxy, or shell mismatch. | Match the exact error in official install troubleshooting. |
| Pro or Max user sees API charges | ANTHROPIC_API_KEY is set. | Run /status, remove or scope the API key, and check Console billing. |
| Search does not work in a project | ripgrep problem. | Follow search troubleshooting before reinstalling. |
| Windows shell command fails | PowerShell command was run in CMD, or CMD command was run in PowerShell. | Switch to the shell that matches the command. |
First Project Setup
After the CLI opens successfully, add a short CLAUDE.md to the project root:
# CLAUDE.md
## Common Commands
- npm run build: Build the project
- npm run test: Run tests
- npm run lint: Check code quality
## Project Rules
- Use TypeScript
- Follow the existing component patterns
- Do not edit generated files unless askedKeep it short. A stale or oversized CLAUDE.md wastes context every session.