# Install Claude Code: Native, Homebrew, WinGet, or npm

> Canonical: https://skillalmanac.com/learn/install-claude-code | Updated: 2026-11-25 | Index status: index-eligible

Install Claude Code on macOS, Linux, WSL, or Windows with the official commands, then confirm the install with claude --version and claude doctor.

## Facts

- 2026-11-25: The native installer is curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL, and irm https://claude.ai/install.ps1 | iex in Windows PowerShell (https://code.claude.com/docs/en/setup)
- 2026-11-25: Homebrew installs with brew install --cask claude-code, WinGet with winget install Anthropic.ClaudeCode (https://code.claude.com/docs/en/setup)
- 2026-11-25: Native installs auto-update in the background; Homebrew, WinGet and Linux package manager installs need manual upgrades by default (https://code.claude.com/docs/en/setup)
- 2026-11-25: The npm package needs Node.js 22 or later and is installed with npm install -g @anthropic-ai/claude-code@latest; sudo is not recommended (https://code.claude.com/docs/en/setup)
- 2026-11-25: Claude Code requires a Pro, Max, Ultra, Team, Enterprise or Console account; the free claude.ai plan does not include it (https://code.claude.com/docs/en/setup)
- 2026-11-25: On native Windows, Git for Windows is recommended so the Bash tool works; otherwise the PowerShell tool is used (https://code.claude.com/docs/en/setup)

Run the installer that fits your operating system, open a fresh terminal, and type `claude --version` to check that the binary responds. Start a session with `claude` from inside your project folder, and log in when prompted.

## Before installing

The setup documentation rechecked on 2026-11-25 lists macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, and Alpine Linux 3.19+. It requires an x64 or ARM64 machine, at least 4 GB RAM, internet access and availability in a supported country. On Alpine, install bash and curl before using the shell installer. Use a supported terminal shell and an eligible account.

Windows can run the native CLI or use WSL. WSL2 supports the documented sandbox; WSL1 and native Windows do not. Git is optional; Git for Windows enables Git Bash, while native Windows can use PowerShell without it. Match commands to the actual shell rather than assuming Windows means Bash.

## Install steps

1. Pick the install method for your system. The native installer is the recommended path on macOS, Linux, WSL and Windows.
   - Shell on macOS, Linux or WSL: `curl -fsSL https://claude.ai/install.sh | bash`
   - PowerShell on Windows: `irm https://claude.ai/install.ps1 | iex`
   - Windows CMD: `curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd`
   - Homebrew: `brew install --cask claude-code` (the `claude-code@latest` cask tracks the newest releases)
   - WinGet: `winget install Anthropic.ClaudeCode`
   - npm: `npm install -g @anthropic-ai/claude-code@latest`, which needs Node.js 22 or later
2. Open a new terminal window. The native installer prints no progress while it downloads, so wait for the prompt to return before you test.
3. Run `claude --version`. A working install prints a version number followed by `(Claude Code)`.
4. Change into your project folder and run `claude`. On first launch the session requests a sign-in. Pick a Console account or a Pro, Max, Ultra, Team or Enterprise plan, because free claude.ai access leaves out Claude Code.
5. Run `claude doctor`. It prints read-only diagnostics for the install and your settings files without starting a session.

## Check that it worked

Inside the session, type `/help` to list commands, and send a read-only question such as `what does this project do?`. If Claude answers from your files, the install and login both work. When the shell cannot locate `claude`, the launcher folder is missing from PATH; [official PATH troubleshooting](https://code.claude.com/docs/en/troubleshoot-install#command-not-found-claude-after-installation) shows the OS-specific repair.

## Pitfalls

- **Wrong shell syntax.** The error `The token '&&' is not a valid statement separator` means you ran the CMD command in PowerShell. The error `'irm' is not recognized` means you ran the PowerShell command in CMD. Match the command to the shell your prompt shows.
- **`claude` not found after install.** Open a new terminal first. If it still fails, check that the native launcher directory is on PATH. On macOS and Linux the launcher is `~/.local/bin/claude`.
- **Manual upgrades you forgot.** Homebrew, WinGet and Linux package installs do not auto-update by default. Run `brew upgrade claude-code`, `winget upgrade Anthropic.ClaudeCode`, or your package manager's upgrade command on a schedule. Otherwise you can stay on an old version.
- **Permission errors with npm.** The docs advise against `sudo npm install -g`, because Claude Code cannot update itself in an install that needs sudo.
- **Missing Git Bash on Windows.** Without Git for Windows, shell commands run through PowerShell. If you install Git for Windows in a non-default location, set `CLAUDE_CODE_GIT_BASH_PATH` in your settings file, as shown in the setup page.
- **Account type mismatch.** A free claude.ai account can install the CLI but cannot log in to Claude Code. Check your plan before you troubleshoot the install.

## When to use a skill instead

Setup runs once per machine, so a reusable skill has no role in these commands. Once the CLI runs, a skill becomes useful for repeated work. The [agent-instruction-files](/skills/skill-almanac/agent-instruction-files) skill covers instruction files for agents, which is the next thing to configure in a project after the first session works. Use ad-hoc prompting for a single question about your codebase, and a skill when you want the same steps applied every time. The skills and plugins listed for this query are not covered by the official install pages, so check their own documentation for setup.

## FAQ

**Why does the shell say `claude` is not found after install?**
The install directory is missing from PATH in that shell. Open a new terminal first; if the error persists, add the launcher directory to PATH, which on macOS and Linux is `~/.local/bin`, following the [official PATH troubleshooting](https://code.claude.com/docs/en/troubleshoot-install#command-not-found-claude-after-installation).

**Does Homebrew update Claude Code automatically?**
Not by default. Homebrew installs need `brew upgrade claude-code`, or `brew upgrade claude-code@latest` for the latest-channel cask. Setting `CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE` to `1` makes Claude Code run the Homebrew or WinGet upgrade itself, as the setup page describes.

**Which account types can log in to Claude Code?**
Pro, Max, Ultra, Team, Enterprise, and Console accounts can. The free claude.ai plan cannot log in to Claude Code, although the CLI can still be installed. Third-party providers such as Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry are also listed as options on the setup page.

## Related skills

- [agent-instruction-files](https://skillalmanac.com/skills/skill-almanac/agent-instruction-files.md): Platform Score 46/100 (provisional)

## Related guides

- [Install Codex CLI and Sign In](https://skillalmanac.com/learn/install-codex-cli.md)
- [What Is everything-claude-code (ECC)? Contents and Install](https://skillalmanac.com/learn/what-is-everything-claude-code.md)
- [Terminal AI Coding Assistants: Claude Code, Codex, and Gemini CLI](https://skillalmanac.com/learn/terminal-ai-coding-assistants.md)
- [Claude Code first session: a plan, edit, review loop](https://skillalmanac.com/learn/claude-code-first-session-workflow.md)
- [Agentic Coding Tools: What They Are and How to Choose One](https://skillalmanac.com/learn/choosing-an-agentic-coding-tool.md)
- [What Is Claude Code and What It Can Touch on Your Machine](https://skillalmanac.com/learn/what-is-claude-code.md)

## Sources

- https://code.claude.com/docs/en/setup
- https://code.claude.com/docs/en/quickstart
- https://code.claude.com/docs/en/troubleshoot-install#command-not-found-claude-after-installation

Platform Scores report our assessment under a published method. They are not a safety guarantee.
