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

  1. 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 || true
  2. Install 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.

  3. Open a new shell and identify the executable

    The path and version together establish which installation is active.

    Step 3
    command -v claude
    claude --version
  4. Run 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.

Windows

Git for Windows is recommended so Claude Code can use the Bash tool. WSL setups do not need Git for Windows.

Read guide

Install 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.

CommandDescription
claude install stableInstall or reinstall the native binary on a specific release channel.
claude updateUpdate Claude Code to the latest version for your install method.
claude doctorPrint read-only install and settings diagnostics from the terminal.
Native install (macOS, Linux, WSL)
curl -fsSL https://claude.ai/install.sh | bash
Native install (Windows PowerShell)
irm https://claude.ai/install.ps1 | iex
Homebrew and WinGet
brew install --cask claude-code
winget install Anthropic.ClaudeCode

First 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.

Verify install and auth
claude --version
claude auth login
claude auth status --text

Update 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 guide

Homebrew

Run `brew upgrade claude-code` or `brew upgrade claude-code@latest` depending on the cask you installed.

Read guide

WinGet

Run `winget upgrade Anthropic.ClaudeCode` periodically for security fixes and new features.

Read guide

After 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.

Setup checklist

Related topics