Tutorial

How to Install Claude Code (2026): macOS, Linux, Windows, and VS Code

Shannon AtkinsonSeptember 6, 202611 min read
How to Install Claude Code (2026): macOS, Linux, Windows, and VS Code

Everything below was checked against Anthropic's official Claude Code documentation and run on a real machine on 6 September 2026. claude --version on my laptop reported 2.1.263 (Claude Code). Claude Code ships new versions constantly, so if a menu item or a flag has moved by the time you read this, trust the official docs over this page.

Overview

Claude Code is Anthropic's coding agent that runs in your terminal. You point it at a project directory, describe what you want in plain English, and it reads files, runs commands, and edits code, asking for permission according to the mode you are in.

This guide installs it, signs you in, runs a first session, connects it to VS Code or a JetBrains IDE, and then covers updating, removing, and the errors that actually stop people.

Prerequisites

  • A machine with 4 GB or more of RAM and an x64 or ARM64 processor.
  • macOS 13.0 or later, Windows 10 1809 or later, Windows Server 2019 or later, Ubuntu 20.04 or later, Debian 10 or later, or Alpine Linux 3.19 or later.
  • A shell: Bash, Zsh, PowerShell, or CMD.
  • An internet connection, and an account in a country Anthropic supports.
  • A paid Claude plan (Pro, Max, Team, or Enterprise) or a Claude Console account. The free Claude.ai plan does not include Claude Code.

Search is handled by ripgrep, which normally ships inside Claude Code. You do not install it separately unless you are on Alpine or another musl-based distribution.

1. Install on macOS

The native installer is the method Anthropic recommends, and it is the only one that updates itself in the background.

curl -fsSL https://claude.ai/install.sh | bash

If you would rather manage it with Homebrew:

brew install --cask claude-code

There are two casks. claude-code follows the stable channel, which runs roughly a week behind and skips releases with major regressions. claude-code@latest follows the latest channel and gets every release as it ships. Neither auto-updates.

2. Install on Linux

The same script works on any supported distribution:

curl -fsSL https://claude.ai/install.sh | bash

Anthropic also publishes signed apt, dnf, and apk repositories, each with a stable and a latest channel. On Debian or 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
gpg --show-keys /etc/apt/keyrings/claude-code.asc

The fingerprint that prints should be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. Check it before you trust the key. Then register the repository and install:

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

Package manager installs do not auto-update through Claude Code. They come along with your normal apt update && apt upgrade claude-code cycle.

Alpine needs a little more. It ships without bash and curl, and it needs libgcc, libstdc++, and a system ripgrep at runtime:

apk add bash curl libgcc libstdc++ ripgrep

Then set USE_BUILTIN_RIPGREP to 0 in the env block of your settings.json.

3. Install on Windows

You have two supported paths, and the choice matters.

OptionRequiresSandboxingUse when
Native WindowsNothing; Git for Windows is optionalNot supportedYour projects and tools are Windows-native
WSL 2WSL 2 enabledSupportedYou use Linux toolchains, or you want sandboxed command execution
WSL 1WSL 1 enabledNot supportedWSL 2 is unavailable to you

3.1 Native Windows

You do not need to run as Administrator. In PowerShell:

irm https://claude.ai/install.ps1 | iex

In CMD:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Your prompt tells you which one you are in. PowerShell shows PS C:\Users\YourName>. CMD shows the same without the PS. If you get The token '&&' is not a valid statement separator, you ran the CMD command in PowerShell. If you get 'irm' is not recognized, you ran the PowerShell command in CMD.

Git for Windows is optional but recommended. It gives Claude Code a Git Bash to use for the Bash tool. Without it, Claude Code runs shell commands through the PowerShell tool instead. If Git Bash is installed somewhere unusual, point at it in settings.json:

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

3.2 WSL

Open your WSL distribution and run the Linux installer above from inside it. You install and launch claude from the WSL terminal, not from PowerShell or CMD. WSL setups do not need Git for Windows. If you are setting WSL 2 up for the first time, the WSL section of the n8n Docker Compose guide covers the install and the filesystem trap worth avoiding.

WinGet is a third option on native Windows:

winget install Anthropic.ClaudeCode

WinGet installs do not auto-update. Run winget upgrade Anthropic.ClaudeCode periodically.

4. Verify the Install

claude --version

A working install prints a version number followed by (Claude Code). Mine printed 2.1.263 (Claude Code).

For a fuller check that does not start a session:

claude doctor

That prints read-only diagnostics: install health, settings-file validation errors, the result of the last update attempt, and suggested fixes for anything it finds. Run it first whenever something is off.

5. Sign In

Claude Code needs an account. Start a session and it prompts you on first use:

claude

Follow the browser prompts. Once you are signed in, credentials are stored and you will not be asked again. To switch accounts later, type /login inside a running session.

You can sign in with any of these:

  • A Claude Pro, Max, Team, or Enterprise subscription. This is the recommended path.
  • A Claude Console account, which uses pre-paid API credits. On first login, Anthropic creates a "Claude Code" workspace in the Console so your spend is tracked in one place.
  • Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry, if your organisation uses one.
  • A self-hosted Claude apps gateway, if your admin has set one up.

One trap worth knowing about now: if ANTHROPIC_API_KEY is set in your shell, Claude Code asks to approve that key instead of opening a browser, and in non-interactive -p mode it always uses the key. An old key left in a .zshrc from a previous job will silently bill an account you no longer control. Unset it if you meant to use your subscription.

6. Your First Session

Move into a project and start:

cd /path/to/your/project
claude

You get a prompt with the version, the current model, and the working directory above it. Type /help for the command list. Then ask something read-only first:

what does this project do?

Claude reads what it needs. You do not have to add files manually.

Before you let it write anything, learn the one keystroke that matters: Shift+Tab cycles the permission mode. The modes are Manual (reads only, asks for everything else), accept edits, plan, and, where available, auto. The status bar shows which one you are in. On Pro, Max, and Team plans, interactive terminal sessions start in auto mode, where a separate classifier model reviews actions instead of you. On other plans they start in Manual.

If that makes you uneasy on a real repository, press Shift+Tab until the bar reads ⏸ plan mode on. In plan mode Claude explores and writes a plan but does not touch your source until you approve it. I cover what plan mode is and why people keep searching for it alongside pricing in Claude Code Pricing Explained.

7. VS Code and JetBrains

7.1 VS Code

You need VS Code 1.94.0 or higher. Open the Extensions view with Cmd+Shift+X on Mac or Ctrl+Shift+X on Windows and Linux, search for "Claude Code", and install it. Cursor and other VS Code forks can install the same extension from the Open VSX registry.

The extension gives you a panel inside the editor: plans you can edit before accepting, inline diffs, @-mentions of files with line ranges, conversation history, and multiple conversations in separate tabs.

There is one detail that trips people up. The extension bundles its own private copy of the CLI for its chat panel, and it does not add claude to your PATH. If you install only the extension, ~/.local/bin/claude will not exist and claude will not run in the integrated terminal. Install the standalone CLI as well if you want both.

Sign-in is separate: open the panel, click Sign in, and finish in the browser. If you have ANTHROPIC_API_KEY in your shell but the panel still asks you to sign in, VS Code did not inherit your shell environment. Launch it from a terminal with code . or just sign in with your Claude account.

7.2 JetBrains

The plugin works with most JetBrains IDEs, including IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, and GoLand.

Unlike the VS Code extension, the JetBrains plugin does not bundle a CLI. It runs the claude command in the IDE's integrated terminal, so you install both pieces: the CLI first, then the Claude Code plugin from the JetBrains Marketplace. Restart the IDE afterwards.

Run claude from the IDE terminal and the integration features are active: Cmd+Esc or Ctrl+Esc to launch, diffs in the IDE diff viewer, your current selection shared automatically, and Cmd+Option+K or Alt+Ctrl+K to insert file references like @src/auth.ts#L1-99.

From an external terminal, run /ide inside a session to connect. If Claude Code finds a running IDE without the plugin, /ide installs it and asks you to restart.

On WSL, set the plugin's Claude command setting to wsl -d Ubuntu -- bash -lic "claude", substituting your distribution name.

8. Updating

Native installs check for updates on startup and periodically while running, download in the background, and apply them the next time you start. To force one now:

claude update

It reports either Successfully updated from <old> to version <new> or Claude Code is up to date (<version>).

You can choose how fast updates reach you with the autoUpdatesChannel setting in settings.json. "latest" is the default and gets new features immediately. "stable" runs about a week behind and skips releases with major regressions. If you are shipping on a deadline, stable is the calmer choice:

{
  "autoUpdatesChannel": "stable"
}

To stop background updates entirely, set DISABLE_AUTOUPDATER to "1" in the env block. That only stops the background check. claude update still works.

Homebrew, WinGet, apt, dnf, and apk installs need manual upgrades. Setting CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE to 1 makes Claude Code run the Homebrew or WinGet upgrade for you in the background.

9. Uninstalling

Native install, macOS, Linux, or WSL:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Native install, Windows PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Other methods: brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, sudo apt remove claude-code, or npm uninstall -g @anthropic-ai/claude-code.

To remove your settings and history as well:

rm -rf ~/.claude
rm ~/.claude.json

That deletes your settings, permission rules, MCP server configurations, and session history. The VS Code extension, the JetBrains plugin, and the desktop app also write to ~/.claude/, so uninstall those first or the directory comes back.

If claude still runs after all that, you have a second installation somewhere. which -a claude finds it.

10. Common Problems

command not found: claude, or 'claude' is not recognized. The install directory is not on your PATH. On macOS and Linux the binary lives at ~/.local/bin/claude. Check with echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin". If nothing prints, add it:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Use ~/.bashrc on most Linux distributions. On Windows, the binary is at %USERPROFILE%\.local\bin\claude.exe, and you add that directory to your User PATH, then restart the terminal.

The install script errors with syntax error near unexpected token '<'. The download returned an HTML page instead of a shell script, usually because a proxy or captive portal intercepted it. On PowerShell the same problem shows up as parse errors pointing into the returned page.

Permission errors during install. The native installer needs write access to ~/.local/bin/ and ~/.claude/. Create them and give yourself ownership if they exist but are not writable. If you are hitting npm-specific permission errors, stop fighting npm and switch to the native installer. Never use sudo npm install -g.

Node version complaints. Only the npm path involves Node at all. As of v2.1.198 that package requires Node.js 22 or later. On an older version, npm prints an EBADENGINE warning rather than failing, and claude still runs, because the package downloads a native binary that does not use your Node at runtime. If you do not need npm, use the native installer and the question disappears.

exec: node: not found inside WSL. Your WSL shell is picking up the Windows Node installation. Run which node and which npm: paths starting with /mnt/c/ are the Windows binaries. Install Node through your Linux package manager or nvm. Do not set appendWindowsPath = false to fix it, because that breaks calling Windows executables from WSL.

TLS or SSL errors behind a corporate proxy. Proxies that do TLS inspection produce unable to get local issuer certificate or SELF_SIGNED_CERT_IN_CHAIN. For the download itself, pass your proxy's CA: curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash. For Claude Code afterwards, set NODE_EXTRA_CA_CERTS to the same bundle. On Windows, the PowerShell installer validates against the Windows certificate store, so your IT team needs to add the proxy CA there. General proxying uses the usual HTTP_PROXY and HTTPS_PROXY variables.

Login opens a browser on the wrong machine. This happens over SSH, in containers, and in WSL2. After you sign in, the browser shows a login code instead of redirecting back. Paste it at the Paste code here if prompted prompt. If pasting into the interactive prompt does nothing, run claude auth login instead, which reads the code from standard input.

Running claude opens the Claude desktop app on Windows. An older Claude Desktop registers a Claude.exe in WindowsApps that takes PATH priority. Update Claude Desktop.

403 Forbidden after login. On Pro or Max, check the subscription is active at claude.ai/settings. On a Console account, check the account has Claude Code access. If neither, run /status to see whether an ANTHROPIC_API_KEY is overriding your subscription.

Further reading


Next step

Once claude --version works and you have run a first session, the next useful thing is a repeatable way to work, not more flags. The free Claude Code for Builders course in the House of Loops classroom walks the setup, permission modes, and a first real project end to end: open the classroom.

If you would rather get it in your inbox, join the free weekly list and I will send one working build a week. More about who is behind this on the about page.

S

Shannon Atkinson

House of Loops is a free community for people who would rather own their automation stack than rent it: n8n, Claude Code, AI agents, local models and the self-hosting underneath them, across 33 courses in the classroom.

Join Our Community