Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Install Claude Code CLI on Linux, macOS and Windows

16 min read
Improve this page

Logo Claude

Claude Code CLI is installed with the official installer https://claude.ai/install.sh on Linux and macOS, or irm https://claude.ai/install.ps1 | iex in PowerShell on Windows, then checked with claude --version and claude doctor. You will install it on your system, complete the first launch, then check that the command works before moving on to a full workflow. The guide stops at a reliable, reproducible base, before any prompting or automation scenarios.

What you will learn

These four points cover the path between a blank system and a usable session. The last two matter as much as the first two: a successful installation is useless if the sign-in to your account fails.

  • Install Claude Code CLI on Linux, macOS or Windows
  • Understand the normal screens of the first launch
  • Complete the sign-in without getting stuck
  • Check the state of the CLI with diagnostic commands

Why take care of the installation before the first workflow

A badly installed CLI produces symptoms that look like usage problems: command not found, a session that will not open, a sign-in that loops. Treating them as prompting bugs wastes time, whereas two diagnostic commands identify them in a few seconds.

This guide is therefore for people starting with Claude Code CLI who want a clean base before moving to fuller workflows. It answers one simple question: how to install, sign in and check that everything works.

It covers neither how sessions work, nor advanced prompting, nor governance mechanisms: those topics have their own guides in the course.

Prerequisites

Three things are enough. The procedure below uses neither npm nor Node.js: the official installer of each platform puts the claude binary directly on your machine. For the terminal to find it, its folder must be in the PATH, the list of folders where the terminal looks for the commands you type. Step 2 shows how to check it.

  • A local terminal (Bash, Zsh, PowerShell or equivalent)
  • An account or access compatible with Claude Code: a Pro, Max, Ultra, Team or Enterprise plan, a Console account, or a supported API provider (list read on https://code.claude.com/docs/en/setup on November 13, 2026)
  • Internet access

Step 1: install Claude Code CLI

Pick the tab for your system. On Linux and macOS, the official script is downloaded, read, then run: three commands rather than a curl | bash that would blindly run whatever the network returns. In less, scroll through the script with the arrow keys and quit with q.

On Windows, Anthropic's documentation recommends the native PowerShell installer, which updates itself. The tab gives that command, then the variant that lets you read the script before running it. WinGet, the Windows package manager, is an alternative that does not install updates automatically.

Terminal window
# Download the official script, inspect it, then run it
curl -fsSL https://claude.ai/install.sh -o claude-install.sh
less claude-install.sh
bash claude-install.sh

Step 2: check the installation

Two commands are enough: claude --version confirms that the shell finds the binary, claude doctor checks the environment around it. They only work if the ~/.local/bin folder, where the installer puts the claude command, is in the PATH of your session. Most of the time it is not yet the case right after the installation, and this is the usual cause of the famous claude: command not found. The outputs in this step were recorded on Debian 13; on macOS and under Windows, the installer's closing message tells you what is left to do.

Why claude is not found right after the installation

The installer puts the executable in ~/.local/share/claude/versions/ and creates a symbolic link ~/.local/bin/claude that points to it. It does not modify any shell startup file: neither ~/.bashrc nor ~/.profile. It only prints, at the end, the line you have to add yourself. Here is the end of its output, recorded on 2026-11-13 with the version 2.1.323 installer on Debian 13:

✔ Claude Code successfully installed!
Version: 2.1.323
Location: ~/.local/bin/claude
⚠ Setup notes:
● Native installation exists but ~/.local/bin is not in your PATH. Run:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

The session that ran the installer keeps its old PATH: command -v claude returns nothing in it. On Debian, a new login session (for example a new SSH connection) finds claude without any change, because the default ~/.profile adds ~/.local/bin to the PATH at login when that folder exists. This only applies from the next login: a shell that is not a login shell, such as bash -i or an SSH command run without a terminal, does not find it.

On Linux and macOS, the fix is to add the line suggested by the installer to your shell's startup file. It puts ~/.local/bin at the start of the PATH, and the source that follows applies the change to the current session. The file depends on the shell: ~/.bashrc for Bash, ~/.zshrc for Zsh, the default shell on macOS. Under Windows, follow the fix that the installer prints in its closing notes.

For Bash:

Terminal window
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

For Zsh:

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

Check that the command responds

Once the PATH is up to date, three commands confirm the installation.

  1. Check that the shell finds the command

    Terminal window
    command -v claude

    It prints the path of the link, /home/<your-user>/.local/bin/claude. No output means the PATH is not up to date: go back to the line given above.

  2. Check the version

    Terminal window
    claude --version

    The output recorded on 2026-11-13 is 2.1.323 (Claude Code). Your number will be higher if a newer version has been released since.

  3. Run the basic diagnostic

    Terminal window
    claude doctor

claude doctor works even when you are not signed in. Here are its first lines and its conclusion with version 2.1.323:

Claude Code doctor
Running: native (2.1.323)
Platform: linux-x64
Path: /home/ansible/.local/share/claude/versions/2.1.323
Config install method: native
Auto-updates: enabled
Auto-update channel: latest
No installation issues found.

The Running: native line says the native installation is the one running, and No installation issues found. is the verdict to look for. Between the two, claude doctor adds lines about the organization's policy and about Remote Control ("Not signed in to claude.ai"). They concern the account, not the installation: you settle them in the next step, by signing in. If the diagnostic reports a warning or an error, it suggests the fix under the line concerned.

Step 3: get through the first launch

On the first claude, you will usually meet a visual setup sequence, then sign-in, before reaching a session ready to use.

Screen 1: visual setup

You land on a start screen that offers a display theme.

  • Use the arrow keys to choose
  • Press Enter to confirm
  • You can change this choice later

First launch of the CLI with the setup screen

Screen 2: account sign-in

The CLI then shows a sign-in URL (OAuth, the protocol that has you sign in on the provider's website rather than in the terminal) and may ask for a validation code.

Recommended procedure:

  1. Copy the URL shown in the terminal
  2. Open it in your browser
  3. Sign in to your Claude account
  4. If a code is requested, go back to the terminal
  5. Paste the code then confirm with Enter

OAuth sign-in in the Claude Code CLI

Screen 3: session ready

When a "Welcome back" type of screen appears, the CLI is operational.

  • The > line lets you type your requests
  • The current folder shows the working context
  • You can run a first simple command to check the flow

Claude Code CLI ready to use

Step 4: a quick tour of the CLI

Once the CLI is operational, take 2 minutes to make three useful settings.

  1. Open the quick help

    In the CLI session, type ? to display the available shortcuts.

  2. Change the theme

    In the CLI session, type:

    /theme

    Choose a theme that is readable for you, then confirm.

  3. Find the configuration

    Open the configuration:

    /config

    Browse the settings offered: their list depends on the version. This menu only shows a short list of personal settings, not every key.

    The language of the answers is set with the language key of the ~/.claude/settings.json file, for example "language": "french". You can also ask Claude to answer in French in the conversation.

At this stage, do not try to configure everything. The goal is simply to spot where the settings you will use next are located.

To continue, move on to Claude Code CLI: getting started, commands and configuration (in French). The course's single practice ground, described in Claude Code CLI: create the lab-claude running project (in French), is created in the lesson that follows the getting-started guide.

Common errors

These three symptoms come up at installation. The first two have nothing to do with Claude Code itself: one comes from the session's PATH, the other from the browser. Read the "Likely cause" column before applying the fix, it avoids treating one symptom for another.

SymptomLikely causeFix
claude: command not found~/.local/bin is not in the session's PATH: the installer modifies no startup fileOn Linux and macOS, add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc (Bash) or ~/.zshrc (Zsh), reload with source on that file, then check with command -v claude
Sign-in loopsIncomplete browser sessionReuse the sign-in URL shown and finish the login
claude doctor reports warningsA problem with the installation or a settings file, for example a failed automatic updateRead the fix that claude doctor suggests under each warning, apply it, then rerun the command

Key takeaways

These points sum up the path from installation to the first session. The last one avoids a trap: moving on to a complex workflow while the CLI is not stable produces symptoms that get blamed on the model rather than on the installation.

  • The official installers put the claude binary on the machine, with no npm or Node.js. On Linux, they create the ~/.local/bin/claude link without touching the shell's startup files.
  • On Linux and macOS, download the script, read it, then run it, rather than chaining curl | bash. On Windows, irm https://claude.ai/install.ps1 | iex is the recommended command, and the three-step variant allows the same reading.
  • On native Windows, Git for Windows is recommended but not required; under WSL, it is not needed.
  • If claude: command not found appears on Linux or macOS, add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc (Bash) or ~/.zshrc (Zsh), then source that file. On Debian, a new login session is enough too, thanks to the default ~/.profile.
  • A successful installation is validated with command -v claude, claude --version (2.1.323 (Claude Code), recorded on November 13, 2026), then claude doctor.
  • The first launch (theme, sign-in, final screen) follows a normal sequence.
  • As long as the CLI is not stable, do not chain into complex workflows.

Knowledge check

Check that you have the essentials of this guide. The questions cover only what was just explained here.

Knowledge check

Check what you have learned with this interactive quiz

6 questions
6 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer

FAQ: frequently asked questions

These short answers cover the points that come up most: installation under Windows and WSL, the claude: command not found message, checking the installation and the special case of npm.