Install and set up Claude Code
A reliable Claude Code setup starts with the right install method, a supported platform, and a quick verification pass before you open a real repository. After install, continue with authentication and getting started in a real repo.
- Last verified
- Applies to
- Claude Code 2.1.x. CLI spellings were checked on local version 2.1.198; current official docs may describe newer 2.1.x behavior.
- Verification method
- Official documentation, CLI reference, and changelog reviewed on 2026-07-19. Version and help output were checked locally; platform installers, authentication, and update behavior remain documentation-based.
- Official sources
- Advanced setupCLI referenceChangelog
Reproducible practice
Choose one install channel and prove which binary runs
Create a repeatable installation baseline before authentication or repository configuration can obscure PATH and version problems.
Prerequisites
- A supported operating system and shell, internet access, and at least 4 GB RAM.
- A deliberate choice of native, Homebrew, WinGet, or a supported Linux package manager.
- Permission to install software; do not run an installer copied from an untrusted mirror.
Steps
Capture the pre-install state
Record whether another binary or alias already wins PATH. An empty first command is expected on a new machine.
Step 1 command -v claude || true type -a claude 2>/dev/null || trueInstall through one documented channel
Use the official setup page for the selected platform. Do not install a second channel merely because the first shell has not reloaded.
Open a new shell and identify the executable
The path and version together establish which installation is active.
Step 3 command -v claude claude --versionRun read-only diagnostics before project work
Doctor checks install health and settings parsing. Authentication status is a separate gate.
Step 4 claude doctor claude auth status --text
Expected result
Exactly one intended installation is first on PATH, the CLI prints a version, doctor reports actionable diagnostics, and auth state is explicit.
Validation
- Run type -a claude and explain every returned path.
- Compare claude --version with the release channel your team selected.
- Run the same checks in the shell and IDE terminal that will be used daily.
Failure handling
Command not found
Reload the shell, inspect PATH, and check the documented install location before reinstalling.
Two binaries
Remove or demote the unintended channel; updating one binary does not update the other.
Authentication fails
Treat it as an account or provider issue after the binary and network checks pass.
Cleanup or rollback
- Use the uninstall instructions for the exact channel that installed the active binary.
- Restore shell profile changes only after confirming they were added by this installation.
Boundaries and when not to use it
- The curl or PowerShell installer executes downloaded code; enterprise-managed machines may require an approved package channel.
- Native Windows and WSL are separate environments. Install where the repository and toolchain actually run.
System requirements
Claude Code supports macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+, and Alpine Linux 3.19+. You need 4 GB+ RAM, an internet connection, and a supported shell such as Bash, Zsh, PowerShell, or CMD.
macOS and Linux
Native installs auto-update in the background. Use `claude update` to force an immediate upgrade.
Read guideWindows
Git for Windows is recommended so Claude Code can use the Bash tool. WSL setups do not need Git for Windows.
Read guideSearch dependency
ripgrep is usually bundled. If repository search fails, check the troubleshooting docs for search issues.
Read guideInstall methods
Choose one install channel and stick with it unless your team standard says otherwise. Native install is recommended; Homebrew and WinGet require manual upgrades.
| Command | Description |
|---|---|
claude install stable | Install or reinstall the native binary on a specific release channel. |
claude update | Update Claude Code to the latest version for your install method. |
claude doctor | Print read-only install and settings diagnostics from the terminal. |
curl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iexbrew install --cask claude-code
winget install Anthropic.ClaudeCodeFirst verification
After installation, confirm the CLI is on PATH, authentication works, and the binary version matches your team's expected channel before wiring IDE or CI integrations.
claude --version
claude auth login
claude auth status --textUpdate and uninstall
Update behavior depends on the install channel. Native builds auto-update; Homebrew and WinGet require explicit upgrade commands. For uninstall steps, follow the official setup guide for your platform.
Native
Background auto-update is enabled by default. Run `claude update` when you need the newest build immediately.
Read guideHomebrew
Run `brew upgrade claude-code` or `brew upgrade claude-code@latest` depending on the cask you installed.
Read guideWinGet
Run `winget upgrade Anthropic.ClaudeCode` periodically for security fixes and new features.
Read guideAfter installation
Installation is only the first step. Most teams verify auth, open a repository, configure IDE integration, and seed project memory before asking for broad code changes.
Sign in and verify auth
Complete browser or Console login, then run auth status before debugging project settings.
Read guideRun the first session
Open a real repository and ask Claude Code to map build, test, and deploy commands.
Read guideConnect your IDE
Install the VS Code or JetBrains extension when inline diffs and editor context matter.
Read guideGenerate CLAUDE.md
Run /init early so durable project facts load every session.
Read guideSetup checklist
Pick one install channel
Avoid mixing native, Homebrew, and WinGet installs on the same machine unless you know which binary is on PATH.
Read guideVerify PATH
Run `claude --version` in the shell you will use for daily work and CI scripts.
Read guideSign in once
Complete `claude auth login` before debugging project configuration or IDE plugins.
Read guideRun doctor on problems
Use `claude doctor` for duplicate installs, PATH issues, and settings-file parse errors.
Read guide