To install Claude Code CLI on Windows with WinGet, the command is:
winget install Anthropic.ClaudeCode
That is the correct package ID — Anthropic.ClaudeCode, published under manifests/a/Anthropic/ClaudeCode in the winget community repository. Then open a new terminal and run claude --version.
Prefer a different method? Jump to the native installer, Homebrew, npm, Linux package managers, or WSL. If the install ran but the claude command is missing, go straight to the command ran but claude is not found.
winget install Anthropic.ClaudeCode
winget install Anthropic.ClaudeCode
Run it from PowerShell or Command Prompt. You do not need Administrator rights.
winget resolves the ID, shows the package it matched and its version, downloads the installer, and finishes with a success line. Confirm it landed:
winget list Anthropic.ClaudeCode
claude --version
claude --version prints a version number such as 2.1.211 (Claude Code). That is the check that actually matters — winget reporting success only means the package installed, not that your current shell can find it.
Does the lowercase form work?
Yes. winget install anthropic.claudecode installs the same package. Microsoft documents winget's default query behaviour as a case-insensitive substring match against the package name, ID, and moniker, so casing is irrelevant for a plain install.
There is one exception worth knowing, because it produces a confusing failure:
winget install --id Anthropic.ClaudeCode -e # works
winget install --id anthropic.claudecode -e # fails
The -e / --exact flag uses the exact string in the query including checking for case-sensitivity. If you have copied a lowercase ID into a script and added -e for determinism, fix the casing to Anthropic.ClaudeCode.
"No package found matching input criteria"
The package exists, so this almost always means your local source index is stale or your winget client is old.
winget source update
winget search claudecode
If winget search finds it but winget install did not, you were probably hitting a stale cache. If search finds nothing either, update App Installer from the Microsoft Store — the community package index moves faster than old clients handle.
"winget is not recognized as the name of a cmdlet"
winget is not a standalone download. It ships inside App Installer, a system component delivered and updated through the Microsoft Store.
- It requires Windows 10 version 1809 (build 17763) or later, Windows 11, or Windows Server 2025.
- It is not registered until you have logged into Windows as a user at least once, because Store registration happens asynchronously after first login.
If you have logged in and winget still is not there, request registration:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
If App Installer is genuinely absent, install it from the Microsoft Store. Check what you have with winget -v.
On Windows Server or Windows Sandbox, where the Store is unavailable, skip winget and use the PowerShell installer instead.
The winget install succeeded but claude is not recognized
This is the single most common follow-on problem, and it is almost never a broken install.
Open a new PowerShell or CMD window. The session you installed from keeps its old PATH for its entire lifetime; it cannot see a directory added mid-session. A fresh terminal fixes the majority of cases. If it does not, see the command ran but claude is not found.
Updating and removing a WinGet install
WinGet installations do not auto-update:
winget upgrade Anthropic.ClaudeCode
winget uninstall Anthropic.ClaudeCode
Two things to know. First, winget upgrade can fail while Claude Code is running, because Windows locks the executable — close all sessions first. Second, you can have Claude Code run the upgrade for you by setting the CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE environment variable to 1; it then runs the upgrade in the background when a new version ships and prompts you to restart.
Quick Install Commands
| Platform | Command | Auto-updates |
|---|---|---|
| macOS / Linux / WSL | curl -fsSL https://claude.ai/install.sh | bash | Yes |
| Windows (PowerShell) | irm https://claude.ai/install.ps1 | iex | Yes |
| Windows (CMD) | curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd | Yes |
| Windows (WinGet) | winget install Anthropic.ClaudeCode | No |
| macOS (Homebrew) | brew install --cask claude-code | No |
| Debian / Ubuntu | sudo apt install claude-code | No |
| Fedora / RHEL | sudo dnf install claude-code | No |
| Alpine | apk add claude-code | No |
| npm | npm install -g @anthropic-ai/claude-code | Yes |
Only the native installer and npm auto-update. Everything else is on you to upgrade.
Prerequisites
- An account: Pro, Max, Team, Enterprise, or Console. The free Claude.ai plan does not include Claude Code. Third-party providers (Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry) also work.
- A supported OS: macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+.
- Hardware: 4 GB+ RAM, x64 or ARM64.
- A shell: Bash, Zsh, PowerShell, or CMD.
- Network access to
downloads.claude.ai, and availability in a supported country.
Native Installer (Recommended)
This is the method Anthropic recommends on every platform, and the only one besides npm that updates itself in the background. It needs no Node.js.
macOS, Linux, and WSL
curl -fsSL https://claude.ai/install.sh | bash
Verify it worked:
claude --version
The binary is signed by "Anthropic PBC" and notarized by Apple on macOS. It installs to ~/.local/bin/claude, as a symlink into ~/.local/share/claude/versions/.
To pin a channel or version instead of taking the latest:
curl -fsSL https://claude.ai/install.sh | bash -s stable
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89
The channel you install with becomes your default for auto-updates.
Windows PowerShell and CMD
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Verify it worked:
claude --version
You do not need to run as Administrator. Two errors tell you that you pasted the wrong one of the two commands:
The token '&&' is not a valid statement separator— you ran the CMD command in PowerShell.'irm' is not recognized as an internal or external command— you ran the PowerShell command in CMD.
Your prompt tells you which shell you are in: PowerShell shows PS C:\Users\YourName>, CMD shows C:\Users\YourName> with no PS.
Git for Windows is optional but recommended: it gives Claude Code Git Bash for the Bash tool. Without it, Claude Code uses the PowerShell tool for shell commands instead.
Homebrew (macOS)
brew install --cask claude-code
Verify it worked:
claude --version
Homebrew offers two casks. claude-code tracks the stable channel, typically about a week behind and skipping releases with major regressions. claude-code@latest tracks the latest channel and gets new versions as they ship.
Homebrew installs do not auto-update — run brew upgrade claude-code (or brew upgrade claude-code@latest) yourself. If you see Cask 'claude-code' is unavailable: No Cask with this name exists, run brew update first; your local formula index is stale. Homebrew also keeps old versions on disk, so run brew cleanup occasionally.
npm
npm install -g @anthropic-ai/claude-code
Verify it worked:
claude --version
Two corrections to advice you will find elsewhere. First, as of v2.1.198 the npm package requires Node.js 22 or later, not 18. On an older Node, npm prints an EBADENGINE warning but the install still completes and claude still runs. Second, npm delivers the same native binary as the standalone installer, pulled in through a per-platform optional dependency such as @anthropic-ai/claude-code-darwin-arm64 — the installed claude does not invoke Node at runtime. Your package manager must allow optional dependencies or the binary will be missing.
Upgrade with npm install -g @anthropic-ai/claude-code@latest. Avoid npm update -g, which respects the semver range from the original install and may not move you to the newest release.
Never run sudo npm install -g — it causes permission problems and is a security risk. If you hit EACCES errors, see our guide to Claude Code permission errors.
To move an existing npm install onto the native build:
claude install
Linux Package Managers (apt, dnf, apk)
Anthropic publishes signed apt, dnf, and apk repositories, each with stable and latest channels. These are the right choice for servers and managed fleets, where updates should arrive through your normal patching workflow. Package manager installs do not auto-update through Claude Code.
Debian / Ubuntu:
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
-o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
| sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update
sudo apt install claude-code
Before trusting the key, confirm its fingerprint with gpg --show-keys /etc/apt/keyrings/claude-code.asc. It must be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. If the key download fails, apt update later reports NO_PUBKEY BAA929FF1A7ECACE.
Fedora / RHEL:
sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'
[claude-code]
name=Claude Code
baseurl=https://downloads.claude.ai/claude-code/rpm/stable
enabled=1
gpgcheck=1
gpgkey=https://downloads.claude.ai/keys/claude-code.asc
EOF
sudo dnf install claude-code
Alpine:
wget -O /etc/apk/keys/claude-code.rsa.pub \
https://downloads.claude.ai/keys/claude-code.rsa.pub
echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
apk add claude-code
Verify it worked: claude --version on any of them.
Alpine and other musl-based distributions need extra runtime packages — apk add bash curl libgcc libstdc++ ripgrep — and USE_BUILTIN_RIPGREP set to 0 in your settings.
WSL
WSL is no longer required on Windows, but WSL 2 is the only Windows option that supports sandboxing. Native Windows and WSL 1 do not.
Open your WSL distribution and run the Linux installer inside it — not from PowerShell:
curl -fsSL https://claude.ai/install.sh | bash
Verify it worked:
claude --version
You launch claude from the WSL terminal too. WSL setups do not need Git for Windows.
The Command Ran But claude Is Not Found
command not found: claude on macOS and Linux, or 'claude' is not recognized on Windows, means the shell cannot find the binary. The install itself is usually fine.
Step 1 — open a new terminal. The session you installed from keeps its old PATH and cannot see a directory added after it started. This alone fixes most cases.
Step 2 — check whether the install directory is on your PATH. The binary lives at ~/.local/bin/claude on macOS and Linux, and %USERPROFILE%\.local\bin\claude.exe on Windows.
# macOS / Linux
echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"
# Windows PowerShell
$env:PATH -split ';' | Select-String '\.local\\bin'
:: Windows CMD
echo %PATH% | findstr /i "local\bin"
Step 3 — add it if it is missing.
# Zsh (default on macOS)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Bash (default on most Linux distributions)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Windows PowerShell — adds to your User PATH permanently
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Restart the terminal, then verify with claude --version. For fish, Nushell, or another shell, use its own PATH syntax.
Step 4 — check for conflicting installations. Multiple copies cause version mismatches and "I updated but it is still old" confusion.
which -a claude # every claude on your PATH
ls -la ~/.local/bin/claude # native install (symlink into ~/.local/share/claude/versions/)
ls -la ~/.claude/local/ # legacy local npm install from older versions
npm -g ls @anthropic-ai/claude-code # npm global install
where.exe claude
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
No such file or directory from those ls commands is not an error — it just means nothing is installed there. If you find more than one, keep the native install and remove the rest with npm uninstall -g @anthropic-ai/claude-code, rm -rf ~/.claude/local, brew uninstall --cask claude-code, or winget uninstall Anthropic.ClaudeCode.
One trap: the VS Code extension does not put claude on your PATH. It bundles a private copy of the CLI for its own chat panel. If the extension is all you have installed, ~/.local/bin/claude will not exist and you need a standalone install to use claude in a terminal.
Step 5 — if it is a permissions problem rather than a PATH problem, such as zsh: permission denied: claude or EACCES during install, see Fix Claude Code permission errors. That covers the execute-bit, npm global directory ownership, and macOS Files & Folders access cases specifically.
Finally, claude doctor prints read-only installation and settings diagnostics without starting a session, including install health and any warnings with suggested fixes.
Authenticate
Start Claude Code from the project you want to work in:
claude
Follow the browser prompts to sign in. If ANTHROPIC_API_KEY is set in your environment, Claude Code prompts you once to approve that key instead of opening a browser.
Sign-ins do not last forever. When a working install suddenly reports OAuth token has expired, nothing is broken — the session has lapsed and running /login restores it.
Once you are signed in, one keyboard behaviour catches almost everyone out on a fresh install: pressing Enter to start a new line submits the prompt instead. If Shift+Enter is not working, run /terminal-setup once to teach your terminal the right key binding.
Updating Claude Code
Native and npm installations update automatically in the background; the new version takes effect the next time you start Claude Code. To apply one immediately:
claude update
Package manager installs are manual:
brew upgrade claude-code # Homebrew
winget upgrade Anthropic.ClaudeCode # WinGet
sudo apt update && sudo apt upgrade claude-code # apt
sudo dnf upgrade claude-code # dnf
apk update && apk upgrade claude-code # apk
npm install -g @anthropic-ai/claude-code@latest # npm
You can choose a release channel with the autoUpdatesChannel setting ("latest", the default, or "stable", roughly a week behind), or turn background updates off by setting DISABLE_AUTOUPDATER to "1" in the env block of your settings file. Run claude doctor to see the result of the most recent update attempt.
Related Claude Code Setup Guides
- Fix Claude Code permission errors —
zsh: permission denied: claude, EACCES, and PATH problems - Fix Claude Code CLI installation errors
- Find where Claude Code stores configuration files
- Set up MCP servers in Claude Code
- Manage Claude Code permissions and sandboxing
Claude Code Starter Kit
Drop-in CLAUDE.md templates for Next.js, Python, Go, Rust, and monorepos. Plus MCP server configs and a troubleshooting guide.
Claude Code Starter Kit — CLAUDE.md templates + MCP configs + troubleshooting
Next Steps
- Read the official Claude Code setup documentation
- Explore the GitHub repository
- Configure CLAUDE.md for your project
- Understand Claude Code pricing and subscription tiers before you commit
Compare other AI coding CLIs
- Install OpenAI Codex CLI for another terminal coding assistant
- Install Google Gemini CLI for its 1M-token context window
- Install GitHub Copilot CLI if your team already uses GitHub Copilot
- Learn how to orchestrate multiple AI tools using Claude as an Engineering Manager