Before Claude Code can do anything, it has to be installed, on your PATH and at a version you know. This lesson installs it with Anthropic's native installer, chooses how it updates, and checks the result with two commands that make no requests to Claude and cost nothing.
By the end you can:
- install Claude Code and confirm which version you have;
- choose the release channel that controls updates, and see it in effect;
- diagnose the commonest installation problem,
command not found.
Before you start
- The readiness checks in How this course works are done, and Git and Python 3.12 or later are installed.
- You can open a terminal: Terminal on macOS, your distribution's terminal on Linux, or a WSL2 terminal on Windows. On native Windows, PowerShell works for this lesson; later lessons say when you need WSL2.
- You do not need to be signed in yet. Signing in is the next lesson.
If Claude Code is already installed, still do steps 3 and 4: they check the version and the update channel.
Ways to install, and how each updates
| Method | Command (summary) | Updates itself? |
|---|---|---|
| Native installer (recommended) | curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL | Yes, in the background; takes effect the next time you start Claude Code |
| Homebrew (macOS) | brew install --cask claude-code | No, unless you opt in; upgrade with brew upgrade claude-code |
| WinGet (Windows) | winget install Anthropic.ClaudeCode | No, unless you opt in; upgrade with winget upgrade Anthropic.ClaudeCode |
| Linux package managers (apt, dnf, apk) | See Anthropic's setup page | No |
The course uses the native installer. Whichever method you choose, you need to know whether it updates itself: a Homebrew install that you never upgrade stays at the version you installed while the course moves on.
Release channels
Native installations follow one of two release channels:
latestreceives each new version as soon as it is released;stablereceives a version that is typically about a week old and skips releases with major regressions.
The course uses stable, because you want fewer surprises while you learn.
The setting that controls it is autoUpdatesChannel in your user settings
file, ~/.claude/settings.json (the ~ means your home folder). Settings
files get a full lesson later; for now, this is one small JSON file.
Install and check Claude Code
1. Install on the stable channel
On macOS, Linux or WSL:
curl -fsSL https://claude.ai/install.sh | bash -s stable
On Windows PowerShell:
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
The installer downloads Claude Code into your home folder; on macOS and
Linux, the claude command lives at ~/.local/bin/claude. It needs no
administrator rights. The command prints little while it downloads; wait for
it to finish. Then open a new terminal window, so that your shell picks up
any PATH change the installer made.
To install a specific version instead, for example the version the course
was tested with, put the version number where stable is:
bash -s 2.1.308.
2. Confirm the command is found
claude --version
Illustrative output:
2.1.308 (Claude Code)
The number is your installed version. Write it down; you will compare it
with the course's tested version, 2.1.308. A newer version is normal. If
your shell says command not found or not recognized, see
When your result differs.
3. Set the release channel explicitly
Open ~/.claude/settings.json in your text editor. If the file does not
exist, create it with exactly this content:
{
"autoUpdatesChannel": "stable"
}
If it already exists, add the "autoUpdatesChannel": "stable" line inside
the outer braces, with a comma separating it from the line before or after.
Do not remove anything already there. JSON does not allow a trailing comma
after the last entry.
Why set it when you installed from the stable channel? The installer records
your choice, but checking it explicitly is cheap, and a later reinstall or a
different configuration folder can leave you on latest without your
noticing. In the author's test environment, which kept its configuration in
a separate folder, claude doctor reported latest until the setting was
added.
4. Check the installation's health
claude doctor
claude doctor checks the installation and your settings files without
starting a session, so it makes no request to Claude. Illustrative output,
shortened; your lines differ by platform and version:
Claude Code doctor
Running: native (2.1.308) <- installation method and version
Platform: linux-arm64 <- your operating system and processor
Search: OK (bundled) <- the file search tool Claude uses works
Auto-updates: enabled <- whether updates install in the background
Auto-update channel: stable <- the channel from your settings
Read three lines:
- Running names the method (
nativehere) and version. - Auto-updates should be
enabledfor a native installation. If it saysdisabled, the reason follows in brackets, such as an environment variable that turns updates off. - Auto-update channel should now say
stable. If it still sayslatest, your settings file was not read: check its location and that it is valid JSON.
If claude doctor lists warnings, each comes with a suggested fix. A JSON
error in a settings file appears here too.
What success shows
You have the evidence for this lesson when:
claude --versionprints a version, ideally 2.1.308 or later;claude doctorshows the native method, auto-updates enabled and thestablechannel.
These show that the command is found, which version you will learn with, and that it will update on the schedule you chose. They do not show that you can sign in or use Claude yet; that is the next lesson.
When your result differs
| What you see | What it means | Safe next step |
|---|---|---|
command not found: claude or 'claude' is not recognized | The install folder is not on your PATH, or the terminal was opened before the install | Open a new terminal first. If it still fails, run ls -la ~/.local/bin/claude; if the file exists, add ~/.local/bin to PATH (below) |
The installer prints Native installation exists but ~/.local/bin is not in your PATH | Same cause, reported by the installer | Add ~/.local/bin to PATH (below) |
claude --version is older than 2.1.308 | An earlier installation, or a package-manager install that does not update | claude doctor shows the method; run claude update for a native install, or upgrade through Homebrew or WinGet |
claude doctor reports Auto-update channel: latest | The setting is missing, misspelled or in the wrong file | Check ~/.claude/settings.json and the spelling autoUpdatesChannel |
claude doctor reports a JSON error in a settings file | A typing mistake in the file, such as a trailing comma | Fix the file at the line it names |
The install command fails with an HTML or 403 error | A network, proxy or regional problem | Follow Anthropic's installation troubleshooting page; Claude Code works only in supported countries |
To add ~/.local/bin to PATH, append one line to your shell's startup file,
then open a new terminal. For Zsh (the macOS default):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
For Bash, use ~/.bashrc instead of ~/.zshrc. Run the command once only:
each run adds another copy of the line.
Your turn
For each illustrative situation, name the cause and the next check before opening the solution.
- A colleague installed Claude Code with Homebrew two months ago and says
lessons describe features they do not see.
claude --versionprints a much older version than yours. - After installing,
claude --versionworks in a new terminal, but in an old terminal tab it printscommand not found. claude doctorshowsAuto-update channel: latesteven though~/.claude/settings.jsoncontains"autoUpdateChannel": "stable".
Solution
- Homebrew installs do not update themselves by default. The fix is
brew upgrade claude-code, thenclaude --versionto confirm. The version difference, not a mistake in the lesson, explains the missing features. - The old tab started before the installer changed PATH. Close it or open a new one; nothing needs reinstalling.
- The key is misspelled: it is
autoUpdatesChannel, with an s afterUpdate. An unknown key is ignored, so the channel stays at its default.
Reset and cleanup
Keep Claude Code installed: every later lesson needs it. If you ever need to remove a native installation, follow the uninstall section of Anthropic's setup page rather than deleting files by hand, so that the launcher and its versions folder are removed together.
Check your understanding
- Which install methods update themselves by default, and why does that matter for this course?
- What is the difference between the
stableandlatestchannels? - Why are
claude --versionandclaude doctorsafe to run at any time?
Answers
- Only the native installer updates itself by default; Homebrew, WinGet and Linux package managers need a manual upgrade unless you opt in. Without updates you may fall behind the version the lessons describe.
latestdelivers each release immediately;stabledelivers a version about a week old and skips releases with major regressions.- They report on the installation and settings without starting a session or sending anything to Claude, so they change nothing and cost nothing.