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.
# Download the official script, inspect it, then run itcurl -fsSL https://claude.ai/install.sh -o claude-install.shless claude-install.shbash claude-install.sh# Download the official script, inspect it, then run itcurl -fsSL https://claude.ai/install.sh -o claude-install.shless claude-install.shbash claude-install.shOfficial alternative with Homebrew, the macOS package manager:
brew install --cask claude-codeTo install the latest published version:
brew install --cask claude-code@latestThis is the command recommended by Anthropic's documentation (https://code.claude.com/docs/en/setup): the native installer, updated automatically in the background. It runs the script straight from the network, without you reading it first:
irm https://claude.ai/install.ps1 | iexirm (short for Invoke-RestMethod) downloads the script and iex (Invoke-Expression) runs it immediately.
To read the script before running it, as in the Linux and macOS tabs, proceed in three steps: download the file, open it, then run it.
Invoke-WebRequest -Uri https://claude.ai/install.ps1 -OutFile install.ps1notepad install.ps1.\install.ps1Instead of notepad install.ps1, Get-Content install.ps1 prints the script in the terminal. PowerShell's execution policy may block .\install.ps1; Get-ExecutionPolicy shows the policy in effect.
Alternative with WinGet. This installation does not update itself: run winget upgrade Anthropic.ClaudeCode from time to time.
winget install Anthropic.ClaudeCodeGit for Windows is recommended on native Windows. With it, Claude Code's Bash tool, the one it uses to run commands, goes through Git Bash (a Bash terminal for Windows); without it, it goes through PowerShell. Git for Windows is not needed under WSL (Windows Subsystem for Linux), which provides a Linux environment inside Windows and where you follow the Linux tab.
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdLike the recommended PowerShell command, this line runs the script as soon as it is downloaded, without reading it first.
Official alternative with WinGet (to run from PowerShell), with no automatic updates:
winget install Anthropic.ClaudeCodeGit for Windows is recommended on native Windows without being required: without it, Claude Code uses PowerShell. It is not needed under WSL.
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 ~/.bashrcThe 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:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcFor Zsh:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrcCheck that the command responds
Once the PATH is up to date, three commands confirm the installation.
-
Check that the shell finds the command
Terminal window command -v claudeIt prints the path of the link,
/home/<your-user>/.local/bin/claude. No output means thePATHis not up to date: go back to the line given above. -
Check the version
Terminal window claude --versionThe 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. -
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-x64Path: /home/ansible/.local/share/claude/versions/2.1.323Config install method: nativeAuto-updates: enabledAuto-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

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:
- Copy the URL shown in the terminal
- Open it in your browser
- Sign in to your Claude account
- If a code is requested, go back to the terminal
- Paste the code then confirm with Enter

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

Step 4: a quick tour of the CLI
Once the CLI is operational, take 2 minutes to make three useful settings.
-
Open the quick help
In the CLI session, type
?to display the available shortcuts. -
Change the theme
In the CLI session, type:
/themeChoose a theme that is readable for you, then confirm.
-
Find the configuration
Open the configuration:
/configBrowse 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
languagekey of the~/.claude/settings.jsonfile, 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.
| Symptom | Likely cause | Fix |
|---|---|---|
claude: command not found | ~/.local/bin is not in the session's PATH: the installer modifies no startup file | On 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 loops | Incomplete browser session | Reuse the sign-in URL shown and finish the login |
claude doctor reports warnings | A problem with the installation or a settings file, for example a failed automatic update | Read 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
claudebinary on the machine, with nonpmor Node.js. On Linux, they create the~/.local/bin/claudelink 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 | iexis 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 foundappears on Linux or macOS, addexport PATH="$HOME/.local/bin:$PATH"to~/.bashrc(Bash) or~/.zshrc(Zsh), thensourcethat 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), thenclaude 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
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
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
A new full quiz with random questions
Work again only on the questions you missed
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.
- Linux / macOS: download the script, read it, then run it (see below)
- Windows PowerShell:
irm https://claude.ai/install.ps1 | iex - macOS (Homebrew):
brew install --cask claude-code - Windows (WinGet):
winget install Anthropic.ClaudeCode
curl | bash that would blindly run whatever the network returns:curl -fsSL https://claude.ai/install.sh -o claude-install.sh
less claude-install.sh
bash claude-install.sh
Then check with claude --version. If the terminal answers command not found, see the question about that message below or the section Install the CLI.- Native: in PowerShell,
irm https://claude.ai/install.ps1 | iex. This is the installer that Anthropic's documentation recommends, and it updates itself.winget install Anthropic.ClaudeCodeis an alternative, with no automatic updates. To read the script before running it, download it withInvoke-WebRequest -Uri https://claude.ai/install.ps1 -OutFile install.ps1, open it (notepad install.ps1), then run.\install.ps1; PowerShell's execution policy may block that run. Git for Windows is recommended but not required: without it, Claude Code uses PowerShell. - WSL: open your Linux distribution and install as on Linux, without Git for Windows. This route suits you if your tools run on Linux.
curl -fsSL https://claude.ai/install.sh -o claude-install.sh
less claude-install.sh
bash claude-install.sh
The Git for Windows recommendation does not apply here: WSL is already a full Linux.~/.local/bin/claude (a symbolic link) and does not modify any startup file of the shell: it only prints the line to add. As long as ~/.local/bin is not in the session's PATH, claude stays unfindable, including in the session that ran the installer.The fix:- On Linux and macOS, add the line suggested by the installer to your shell's startup file and reload it. For Bash:
For Zsh, the default shell on macOS:echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcecho 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc - Check that the shell finds the command with
command -v claude. - Run
claude --versionagain, which prints2.1.323 (Claude Code)with the version measured on 2026-11-13.
claude without any change, thanks to the default ~/.profile that adds ~/.local/bin to the PATH. A shell that is not a login shell (bash -i) does not find it. If ~/.local/bin/claude does not exist, rerun the installation and read the closing messages.claude --version # installed version
claude doctor # full diagnostic of the environment
claude doctor prints, without opening a session, the state of the installation, the errors in the settings files and the warnings, with a suggested fix.@anthropic-ai/claude-code package, which requires Node.js 22 or later (read on https://code.claude.com/docs/en/setup on November 13, 2026):npm install -g @anthropic-ai/claude-code
But Anthropic recommends the native installer (install.sh, install.ps1): it updates itself in the background, which neither Homebrew nor WinGet do.