Direct answer
This guide covers official Claude Code CLI installation channels, platform differences, first-launch checks, and common installation risks.
What this guide helps you solve
Help first-time Claude Code users complete a verifiable, maintainable local installation.
Use the official native installer
Anthropic currently recommends the native installer. It installs Claude Code in the user directory, does not require administrator privileges, and handles background updates on supported platforms. Homebrew, WinGet, and Linux package managers suit teams with a standardized software management process, but generally require manual upgrades.
Confirm your terminal before running a command: macOS, Linux, and WSL use Bash commands, while Windows PowerShell uses irm. PowerShell and CMD use different syntax, so do not mix their installation commands.
curl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iexbrew install --cask claude-codewinget install Anthropic.ClaudeCodeVerify the installation with version and diagnostic commands
A completed installation command does not guarantee that PATH, configuration files, and the update channel are all working. Reload the shell configuration in the current terminal, then run the version check and read-only diagnostics.
claude doctor checks installation health, settings file parsing, and update status. It is more useful for diagnosing PATH or configuration errors than repeatedly reinstalling the CLI.
claude --version
claude doctorFirst launch from project directory
Claude Code uses its launch directory as the current working scope. Enter the actual project directory and run claude; first-time use starts the authentication flow. After authentication, send a read-only question to confirm that Claude can read the project.
Do not launch it from a parent directory that contains many unrelated repositories. A clear working scope keeps file exploration focused and makes later permission decisions easier.
cd /path/to/your/project
claudeUnderstand the differences among Windows, WSL, and shells
Claude Code can run natively on Windows or WSL. Native Windows is suitable for Windows toolchains; WSL 2 is more suitable for Linux toolchains and supports Claude Code's Bash sandbox.
On native Windows, Claude Code uses PowerShell tools when Git for Windows is not installed; after installation, it can use Git Bash. Install and run the CLI in the environment where the project files live to avoid cross-filesystem path and performance issues.
- Native Windows: Fits Visual Studio, PowerShell, and Windows paths.
- WSL 2: Suitable for Linux containers, package managers, and sandboxed command execution.
- Do not paste the CMD-only
&&installation string in PowerShell.
Choose a predictable update channel
Native installations update in the background by default. Teams that prioritize stability can select the stable channel in settings; teams that want new features immediately can use latest. Homebrew and WinGet installations are upgraded through their respective package managers.
Do not rely on unverified new options in tutorials or automation scripts. After upgrading, run claude --version and claude doctor, then verify common workflows.
brew upgrade claude-codewinget upgrade Anthropic.ClaudeCodeDiagnose installation failures before adding another installation source
If the command is not found, check PATH and the executable the shell actually resolves. A 403 response, HTML interpreted as a script, or a TLS error points to the download path. Repeatedly switching among npm, Homebrew, WinGet, and native installers can leave multiple binaries with the same name.
Record the current installation method, then repair it through one channel only. Move on to authentication and project configuration after installation succeeds; do not mistake download or network failures for account or model problems.
command -v claudeGet-Command claudeOfficial sources and verification scope
This guide is based on public official documentation. Commands and configuration may change between client versions, so verify the linked sources before use.
Read the verification methodology