Chapter 4

How to Install Claude Code (August 2026)

2026-08-09 · 15 min read · 10 XP
Chapter 4 · Beyond the Browser: Claude Code & Codex CLI

Ever searched "how to install Claude Code"? You'll get a mess of results mixing up two very different things: getting the Claude app onto your phone, and getting Claude Code onto your computer. Here's the short answer. The Claude app is the chat client you grab from the App Store or claude.ai. Claude Code is a coding agent you install by typing one command into a terminal. Today is about the second one. On Mac or Linux, open your terminal and run curl -fsSL https://claude.ai/install.sh | bash. On Windows, open PowerShell and run irm https://claude.ai/install.ps1 | iex. Once it's done, check the install with claude --version. Then type claude, and on the screen that comes up, log in with a Pro plan or higher, or an Anthropic Console account. Install instructions are especially short-lived, so before you type anything, double-check the official docs in case the commands have changed by the time you're reading this.

Claude Code is Anthropic's CLI (command-line) agent: it reads, edits, and runs code directly inside your terminal or editor. Installing it means downloading the program's executable file into a specific folder on your computer. That's a different process from downloading an app on your phone and getting an icon on your home screen.

Before you install

The previous lesson walked you through opening Terminal on a Mac or PowerShell on Windows. Today picks up from there, typing commands into that same window. If you haven't opened a terminal yet, go back and do the previous lesson first.

One thing to get straight before you install: Claude Code isn't usable for free. As covered in the lesson on Claude's product lineup, you need either a paid subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console account with API credit loaded. A free Claude (claude.ai) account will let you finish the install, but you'll hit a wall at login. If a free account is all you have right now, you can still complete today's install. You'll just get stuck at the very last step. Getting a paid plan sorted first is the right order to do this in.

Quick look at the system requirements too.

ItemRequirement
MacmacOS 13.0 or later
WindowsWindows 10 (build 1809+) or Windows Server 2019+
LinuxUbuntu 20.04+, Debian 10+, Alpine 3.19+, and similar
Hardware4GB+ RAM, x64 or ARM64 processor
InternetRequired (both install and login need to be online)

On Windows, you don't need WSL (Windows Subsystem for Linux). Claude Code installs and runs directly on native Windows, in the same PowerShell window you opened last lesson. WSL is an optional extra you can reach for later, only if you specifically need a Linux toolchain or want to run commands inside an isolated sandbox.

How to install (August 2026, v2.1.226)

When you hear "install," you probably picture downloading an app from a store and an icon landing on your desktop. Claude Code doesn't work that way. No icon appears. Instead, the terminal drops a single executable file into a specific mailbox folder on your computer: ~/.local/bin, to be exact. Your terminal (or more precisely, your shell) needs to know where that mailbox is before typing just claude will run it. Most of the "common problems" later in this lesson trace back to the shell not being able to find that folder.

Below is the method the official docs recommend, the native installer. You can also install via Homebrew (brew install --cask claude-code), WinGet (winget install Anthropic.ClaudeCode), or npm. Today only covers the basic path. I'd personally recommend the native installer over npm, since it sidesteps the PowerShell execution-policy error covered further down.

Mac / Linux

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

This command downloads the install script (curl) and runs it immediately (bash). Once it finishes, you'll have a file at ~/.local/bin/claude.

Windows

As you saw last lesson, Windows has two command-line windows: PowerShell and CMD. Today's command is for PowerShell. Double-check that the first line of your window starts with PS.

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

If you're actually in CMD (no PS at the start of the line), this command won't work, since irm is a PowerShell-only command. In CMD, use this instead.

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

It's one line now, but it wasn't always. I started down the path of installing Homebrew, then Node.js, then npm, and every one of those words was something I'd never seen before. Every time I typed what I was told to, it asked me to install something else.

Back then, what I did was keep two windows open. I'd copy the whole wall of English text off the terminal, paste it into a web chatbot, type back whatever it told me to do, then copy and paste again. Even going back and forth like that, it failed more often than not. A single install could eat an entire afternoon.

The reason this lesson fits in one line today is that the install method changed in between. If you're following an older guide and already installing Homebrew, you can stop right there.

Verifying the install

Once the install finishes, check the version. Same command on both Mac and Windows.

claude --version
2.1.226 (Claude Code)

The version number you see will differ depending on when you install. Claude Code ships new releases often, sometimes just days apart. As of when this was written (August 9, 2026), the latest version per the GitHub releases page was v2.1.226 (shipped August 8, 2026). If you're reading this a week later, chances are you'll see a different number. What matters isn't the number itself, but whether "(Claude Code)" shows up alongside it. If it does, the install went fine.

For a more thorough check, you can also run this.

claude doctor

claude doctor is a read-only diagnostic. It checks your install and config files for problems without starting a session.

Logging in

If the version came back fine, just type claude by itself.

claude

The first run asks you to log in. Your browser opens automatically, and once you finish logging in there, you're dropped back into the terminal. There are two kinds of accounts you can log in with: a paid Claude subscription (Pro, Max, Team, or Enterprise), or an Anthropic Console (API credit) account. As covered in "Before you install," a free claude.ai account will get stuck right here.

If your browser doesn't open automatically (say, over an SSH remote session), don't worry. Press c in the terminal to copy the login link, then paste it into whatever browser you normally use. In environments like WSL2, where the browser opens fine but doesn't bounce you back to the terminal after login, it works the other way around: copy the code shown in the browser and paste it into the terminal to finish logging in. Once you log in, your credentials are saved on your machine. You won't need to log in again after this.

Finishing login doesn't mean the chat prompt shows up right away. The first time you run claude in a folder it hasn't seen before, you may get one more prompt asking "do you trust this folder," separate from login. This safeguard appears every time you open a new codebase for the first time. If it's a folder you just opened yourself, go ahead and trust it. Only after clearing this does the actual chat prompt appear.

Installing the VS Code extension (optional)

If you'd rather work inside an editor than a terminal, there's a VS Code extension. It's the same one covered in the lesson on Claude's product lineup. You'll need VS Code 1.94.0 or later.

  1. In VS Code, press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows) to open the Extensions tab.
  2. Search for "Claude Code."
  3. Click Install.
  4. On first launch, a login screen appears. Click Sign in and finish authenticating in your browser.

Here's a point that trips people up: the VS Code extension bundles its own copy of the CLI just to power its chat panel. Installing only the extension won't make claude work in VS Code's integrated terminal. The extension's chat panel and the claude command you'd run in a terminal use separate install paths. If you want claude to work in VS Code's integrated terminal too, you'll need to do the standard install covered above, on top of the extension. Conversely, if you've already installed the CLI, you can already use claude in the integrated terminal without the extension. You don't strictly need it.

Common problems

The install says it finished, but running claude gives "command not found" (or "is not recognized"). This is the most common issue. There are multiple GitHub issues filed for exactly this: issue #21365 (reported on v2.1.20) and issue #42337 (reported on v2.1.89) both describe the same pattern. The install script announces "Installation complete!" and, in the same breath, prints a yellow warning: "Setup notes: Native installation exists but ....local\bin is not in your PATH." The install itself worked, but your shell doesn't yet know where that mailbox folder (PATH) is. On zsh, the default shell on Mac, fix it like this. If you're on Linux using bash as your default shell, add the same line to ~/.bashrc instead of ~/.zshrc.

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

On Windows PowerShell, run the fix below, then fully close and reopen your terminal window. PATH changes only take effect in newly opened windows.

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Windows PowerShell says "running scripts is disabled on this system." This one only shows up if you installed via npm. It happens because PowerShell's execution policy blocks the .ps1 scripts npm generates. If you installed with the native installer covered above (irm ... | iex), you won't run into this at all. If you already installed via npm and are seeing this error, you have two options: loosen the policy with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or just reinstall with the native installer.

irm doesn't work in CMD, or && throws an error in PowerShell. This is the same PowerShell-vs-CMD distinction covered last lesson, showing up again here. If irm isn't recognized, you're in CMD. Switch to the CMD command above. If instead you get an error saying && is invalid, you're in PowerShell but typed the CMD command. Switch to irm ... | iex.

A permissions error blocks the install entirely. On Mac or Linux, this happens when you don't have write access to ~/.local/bin or ~/.claude. Reclaim ownership for your own account, then reinstall.

sudo mkdir -p ~/.local/bin
sudo chown -R $(whoami) ~/.local

A corporate network or security software blocks the install entirely. If your company's proxy or firewall blocks access to claude.ai or downloads.claude.ai, the install command fails with a 403 error or a TLS certificate error. In that kind of environment, ask your IT team for the proxy address first. Set the HTTPS_PROXY and HTTP_PROXY environment variables to the address they give you, then rerun the install command. On Windows, antivirus software scanning the file mid-download can also cause the install to fail temporarily. Wait a moment and try again.

When I got stuck, I did exactly what I described above. I'd copy the whole error text off the screen, paste it into a chatbot, and ask what it meant. Error messages usually just say something is missing or can't be found, and once you get that translated into one plain sentence, the next step becomes obvious. Don't strain to parse the message yourself, just copy it over and ask.

What you should have

Today's task was one thing: type claude into your terminal (or PowerShell) and see Claude Code launch, logged in, with no error message. You don't need to have asked it anything yet. Getting to a working, running state is the whole deliverable today.

Coming up next

With install and login done, Claude Code is now sitting there on your computer, ready to go. Next lesson, you'll ask it your first question on that screen. You don't need to know how to code. We'll start with something as simple as "what's in this folder?" and see exactly how Claude Code answers and acts.

In 30 seconds
  • "Installing Claude" means getting the Claude app (claude.ai); "installing Claude Code" means running a command in your terminal to install the CLI. They're different procedures.
  • Mac/Linux: curl -fsSL https://claude.ai/install.sh | bash. Windows PowerShell: irm https://claude.ai/install.ps1 | iex. Windows CMD needs a different command.
  • Claude Code can't log in on a free plan. You need a paid subscription (Pro or higher) or an Anthropic Console (API credit) account.
  • Verify the install with claude --version; for a more thorough check, use claude doctor.
  • Log in by running claude and authenticating in your browser. Once you log in, credentials are saved and you won't need to log in again.
  • Even after logging in, running claude for the first time in a new folder may trigger a separate "do you trust this folder" prompt. It's a safeguard independent of login. Trust it if it's a folder you just opened yourself.
  • The most common issue is claude returning "command not found" after install, a PATH problem. Check that ~/.local/bin (or %USERPROFILE%\.local\bin on Windows) is registered in your PATH, then try again in a new terminal window.
  • The VS Code extension needs to be installed separately from the CLI. Installing only the extension won't make the claude command work in the integrated terminal.

Frequently asked questions

Can I install Claude Code for free?

The install itself is free. But you'll hit a wall at the login step afterward. Claude Code requires either a paid subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console (API credit) account to log in. A free claude.ai account can't log in.

How do I install Claude Code on Windows?

Open PowerShell and run irm https://claude.ai/install.ps1 | iex. Check first that the top line of your window starts with PS. If you're in CMD instead, run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. It installs and runs directly on native Windows, no WSL needed.

I installed it, but claude comes back as command not found. Why?

The install itself worked, but the folder holding the executable (~/.local/bin on Mac/Linux, %USERPROFILE%\.local\bin on Windows) isn't registered in your shell's PATH. It's a common enough symptom that it's been reported on GitHub more than once (issue #21365, #42337). Add that folder to PATH and open a new terminal window to fix it.

Can I use Claude Code in VS Code just by installing the extension?

If you only want the chat panel, yes, the extension alone is enough. But if you want to type the claude command directly in VS Code's integrated terminal, that's separate. The extension bundles its own copy of the CLI for the chat panel, which isn't connected to the terminal's claude command. To use it in the terminal too, you need to do the standard CLI install separately.

What's the latest version of Claude Code?

As of when this was written (August 9, 2026), the GitHub releases page showed v2.1.226 (shipped August 8, 2026) as the latest. Claude Code ships new releases every few days, so running claude --version to check what's actually installed on your machine is the most reliable way to know.

Sources (8)Expand to see all sources
quest_log.txt
Earned
Chapter 4 complete
+10 XP (total 0)
Installing Claude and installing Claude Code are different procedures that just happen to share a name
0/6 · 0%
Lv.1 Novice
0 / 100 XP
100 XP to next level
Next questHow to Use Claude Code: From First Launch to Your First Question (August 2026)