# How to install Claude Code and run your first session

> To install Claude Code, open a terminal and run Anthropic's native installer for your system: `curl -fsSL https://claude.ai/install.sh | bash` on macOS, Linux and WSL, or `irm https://claude.ai/install.ps1 | iex` in Windows PowerShell. Then run `claude --version`, open a project folder, type `claude` and log in. The free claude.ai plan does not include Claude Code.

Mindket editors · Published 2026-11-04 · Updated 2026-11-05 · https://mindket.com/learn/claude-code/install-claude-code

## In short

- Install with one command from Anthropic, check it with `claude --version`, and start a session with `claude` inside any project folder.
- Log in with a paid Claude plan or a Console account. The free claude.ai plan is not one of them.
- Ask one question, then request one small edit, so you see how your session handles approval. Lesson 2 explains why that varies.
- A native install updates itself. Homebrew, WinGet and Linux package manager installs do not.

## Before you start

You need a terminal, a project folder and an account that includes Claude Code. Any code folder works for a first session. With no project yet, [Anthropic's terminal guide](https://code.claude.com/docs/en/terminal-guide) says that's fine too, because Claude can help you start one. The same guide shows how to open a terminal if you have never used one.

The account is the step that catches people out. [The setup page](https://code.claude.com/docs/en/setup) says Claude Code needs a Pro, Max, Ultra, Team or Enterprise plan, a Claude Console account, or access through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. Free claude.ai accounts are not on that list.

The figures below are the minimums. On Linux, the page lists Ubuntu 20.04, Debian 10 and Alpine Linux 3.19 or newer, and every install needs an internet connection.

**The minimums on Anthropic's setup page**

- **13.0** is the oldest macOS version Claude Code runs on (Source: [Claude Code docs: Advanced setup](https://code.claude.com/docs/en/setup), read 2026-11-04)
- **1809** is the oldest Windows 10 version it runs on, and Windows Server 2019 or later works too (Source: [Claude Code docs: Advanced setup](https://code.claude.com/docs/en/setup), read 2026-11-04)
- **4 GB** of RAM at least, on an x64 or ARM64 processor (Source: [Claude Code docs: Advanced setup](https://code.claude.com/docs/en/setup), read 2026-11-04)
- **22** is the Node.js version only the npm install route asks for, as 22 or later (Source: [Claude Code docs: Advanced setup](https://code.claude.com/docs/en/setup), read 2026-11-04)

## Install Claude Code and start a session

Anthropic marks the native installer as recommended, so it is the one used here. Copy only the block that matches your system, paste it into the terminal and press Enter.

The installer shows no progress while it downloads. Leave the window open until it reports that Claude Code installed successfully.

````bash
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
````

1. Open a terminal. On macOS press `Cmd + Space`, type Terminal and press Enter. On Linux press `Ctrl + Alt + T`. On Windows press `Win + X` and pick Windows PowerShell or Terminal.
2. Paste the install command for your system and press Enter. Wait for the message that the install finished.
3. Open a new terminal window and run `claude --version`. A working install prints a version number followed by "(Claude Code)", such as `2.1.211 (Claude Code)`.
4. Go to a project folder with `cd /path/to/your/project`, replacing the path with your own, then run `claude`.
5. Log in when Claude Code asks. A browser window opens, you sign in with your Claude account, and the credentials are stored, so you do not log in again next time.
6. Type a first question, such as `what does this project do?`. Claude reads the files it needs, so you paste nothing in.
7. Ask for one small change, such as `add a hello world function to the main file`. Claude Code finds the file and shows the change. If it asks before making it, choose Yes to approve.
8. Leave with `/exit`, or press `Ctrl + D` twice on an empty prompt.

## Which install method to pick

Pick the native installer unless a package manager is how you already install your tools. A native install updates itself in the background. Homebrew, WinGet, apt, dnf and apk installs do not do that by default, so you upgrade them yourself.

Homebrew picks the channel by cask name. `claude-code` follows the stable channel. Anthropic says that channel typically runs about a week behind and skips releases with major regressions. `claude-code@latest` gets each version as soon as it ships.

The npm route, `npm install -g @anthropic-ai/claude-code`, installs the same native binary. It asks for Node.js 22 or later, although an older version only prints an `EBADENGINE` warning and the install still completes. Never put `sudo` in front of it. Claude Code runs npm without `sudo` when it updates itself, so an install that needed `sudo` cannot update on its own. If `npm --version` starts with 12, read the FAQ below before you install, because Anthropic documents a separate fix for that version.

On a native install, `claude update` applies an update right away. `claude doctor` prints read-only diagnostics without starting a session, including install health and settings errors.

| Route | Command | How it updates |
| --- | --- | --- |
| Native installer | The commands in the block above | In the background, on its own |
| Homebrew | `brew install --cask claude-code` | By hand: `brew upgrade claude-code`, or `claude-code@latest` for that cask |
| WinGet | `winget install Anthropic.ClaudeCode` | By hand: `winget upgrade Anthropic.ClaudeCode` |
| npm | `npm install -g @anthropic-ai/claude-code` | On its own when the global folder is writable, or `npm install -g @anthropic-ai/claude-code@latest` |
| apt, dnf, apk | Anthropic's signed repositories, listed on the setup page | Through your system's normal upgrade |

## The commands you will use in your first hour

After login, the prompt appears with the version, the current model and the working directory above it. You can't click anything in the terminal, so move with the arrow keys. Press `Esc` to interrupt Claude while it works. Press `Shift+Tab` to switch the permission mode, which sets what Claude may do without asking you first. Lesson 2 is about that.

Typing `/` lists the commands and skills available to you, and Tab completes a command. The table has the rest of what [the quickstart](https://code.claude.com/docs/en/quickstart) calls day-to-day use.

| Where | Command | What it does |
| --- | --- | --- |
| Terminal | `claude` | Starts an interactive session |
| Terminal | `claude "fix the build error"` | Starts a session with a first prompt |
| Terminal | `claude -p "explain this function"` | Answers one query, then exits |
| Terminal | `claude -c` | Continues the most recent conversation in this folder |
| Terminal | `claude -r` | Resumes a previous conversation |
| Inside Claude Code | `/help` | Shows the available commands |
| Inside Claude Code | `/clear` | Clears the conversation history |
| Inside Claude Code | `/exit` | Exits Claude Code |

## How Claude Code's creator runs his own setup

Boris Cherny created Claude Code and works on Claude at Anthropic. He shared his setup [on X](https://x.com/bcherny/status/2007179832300581177) at the start of January 2026 and called it "surprisingly vanilla". Claude Code works well out of the box, he wrote, so he changes little. For a fresh install, that means the defaults from this lesson are a fine place to stay while you learn.

[His tenth tip](https://x.com/bcherny/status/2007179854077407667) in the same thread is about approvals. He doesn't use `--dangerously-skip-permissions`. He runs `/permissions` to pre-allow common bash commands he knows are safe, and keeps most of those rules in `.claude/settings.json`, checked into git and shared with his team. When your sessions keep asking you to approve the same safe command, that dialog is where you allow it once.

> Claude Code works great out of the box, so I personally don't customize it much.
>
> Boris Cherny, Creator of Claude Code, Anthropic, [X](https://x.com/bcherny/status/2007179832300581177) (read 2026-11-05)

[![Boris Cherny (@bcherny) on X, 2 January 2026. I'm Boris and I created Claude Code. My setup might be surprisingly vanilla. Claude Code works great out of the box, so I personally don't customize it much.](https://mindket.com/blog/shots/x-bcherny-vanilla-setup.webp?v=4b297122eb8d)](https://x.com/bcherny/status/2007179832300581177)

Boris Cherny on X, 2 January 2026

[![Boris Cherny (@bcherny) on X, 2 January 2026, tip 10 of his setup thread. I don't use --dangerously-skip-permissions. Instead, I use /permissions to pre-allow common bash commands that I know are safe in my environment.](https://mindket.com/blog/shots/x-bcherny-permissions-tip.webp?v=66d0ac3d1e8a)](https://x.com/bcherny/status/2007179854077407667)

Boris Cherny on X, 2 January 2026

> Screenshots of X's own embeds of the posts, taken on 5 November 2026, with the time in UTC. X cuts the first post short with Show more. Select a screenshot to open the post on X.

## Common mistakes

The most common failed install is a finished install that `claude` can't find. The installer puts the program in `~/.local/bin` on macOS and Linux, or in `%USERPROFILE%\.local\bin` on Windows, and that folder has to be in your PATH. When the installer spots the problem, it says so under "Setup notes" and prints the fix, but it does not change your PATH itself. [Anthropic's installation troubleshooting page](https://code.claude.com/docs/en/troubleshoot-install) has the full steps.

Run the pair of commands for your shell, then open a new terminal window. A window that was already open keeps its old PATH.

````bash
# macOS with Zsh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Linux with Bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

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

- Mixing up the Windows shells. `'irm' is not recognized` means you are in CMD, so open PowerShell or use the CMD command. `The token '&&' is not a valid statement separator` means you ran the CMD command in PowerShell. A prompt that starts with `PS` is PowerShell.
- Running the macOS and Linux command on Windows. In PowerShell, `curl` is an alias for another command and rejects the `-fsSL` flags. Use the PowerShell command instead.
- Getting a web page where the script should be. `syntax error near unexpected token '<'` means the address returned HTML. If that page says "App unavailable in region", Claude Code is not offered in your country. Otherwise run the command again, or install with Homebrew.
- Leaving an old `ANTHROPIC_API_KEY` in your shell profile. Anthropic lists a stale key from a previous job or project as a cause of a disabled-organization error, because the key overrides your subscription.
- Following an older tutorial. Some in the search results still give Node.js 18 as the minimum, or start with `sudo npm install -g`. The setup page asks for Node.js on the npm route only, warns against `sudo` and lists the native installer first.
- Giving up when the browser does not open at login. Press `c` to copy the login address and paste it into a browser. If a login fails for no clear reason, `/logout` and then `claude` starts it clean.

## Try it yourself

- Run `claude --version` and `claude doctor` in a plain terminal. Both should finish without an error.
- Open Claude Code in a project and ask the quickstart's three questions: what does this project do, what technologies does it use, and where is the main entry point.
- Ask for a one-line change in a scratch file. If Claude asks first, read the proposed edit before you approve it. Then press `Esc` during the next request to see that you can interrupt.
- Exit, run `claude -c` in the same folder and check that your earlier conversation is back.

## Next: plan mode

Claude Code is installed, and it has made its first edit. Whether it asked first depends on the session's permission mode. [Lesson 2](https://mindket.com/learn/claude-code/claude-code-plan-mode) explains the modes and shows how to make Claude plan first and change nothing until you agree.

Two Mindket posts fit while you settle in. The [CLAUDE.md guide](https://mindket.com/blog/claude-md-file) covers the file of standing instructions for a project. [Adding an MCP server to Claude Code](https://mindket.com/blog/add-mcp-server-claude-code) covers connecting it to outside tools.

## Check yourself

1. After the installer finishes, which command in a new terminal window confirms that Claude Code installed?

   A. `claude update`
   B. `claude --version`
   C. `claude -c`
   D. `claude -r`

   Answer: B. A working install prints a version number followed by "(Claude Code)", such as `2.1.211 (Claude Code)`.

2. The installer finished, but the terminal says it cannot find `claude`. What is the most likely cause?

   A. Your Node.js is older than version 22
   B. You ran the installer without `sudo`
   C. The free claude.ai plan has no Claude Code
   D. The folder `~/.local/bin` is not in your PATH

   Answer: D. The installer puts the program in that folder, so it has to be in your PATH, and you open a new terminal window after you fix it.

3. Which account can you log in to Claude Code with?

   A. A Claude Console account
   B. A free claude.ai account
   C. A free GitHub account

   Answer: A. Claude Code needs a paid Claude plan or a Console account, and free claude.ai accounts are not on that list.

4. You installed Claude Code with Homebrew. How does it get updates?

   A. It updates itself in the background like a native install
   B. Only when you run the native installer again
   C. You upgrade it yourself, for example with `brew upgrade claude-code`

   Answer: C. A native install updates itself in the background, but Homebrew, WinGet, apt, dnf and apk installs do not by default, so you upgrade them by hand.

## Frequently asked questions

### Is Claude Code free?

No. The setup page names the accounts that include it and gives no prices, so the figures are on [Anthropic's pricing page](https://claude.com/pricing), and plans and limits change. If you already have access to Amazon Bedrock, Google Cloud or Microsoft Foundry, you can run Claude Code with that provider instead.

### Do I need Node.js to install Claude Code?

No. Node.js is not in Anthropic's system requirements, and only the npm route needs it. The npm package downloads a native binary that does not use your Node.js at runtime.

### Does Claude Code work on Windows?

Yes, natively in PowerShell or CMD, or inside WSL. You do not need Administrator rights. Git for Windows is optional: with it Claude Code uses Git Bash for its Bash tool, and without it Claude Code uses PowerShell. Sandboxing works on WSL 2 but not on native Windows.

### What goes wrong if I install Claude Code with npm 12?

Anthropic's troubleshooting page says npm 12 skips the package's postinstall step unless your npm config allows it. The install finishes, but on macOS and Linux `claude` then prints `Error: claude native binary not installed.` On Windows the shell cannot run it. The first fix the page lists is the native installer. To stay on npm, it has you add Claude Code to `allow-scripts` in your user npm config and reinstall. To upgrade an npm install, run `npm install -g @anthropic-ai/claude-code@latest`, because `npm update -g` may not reach the newest release.

### Can I use an API key instead of logging in?

Yes. If `ANTHROPIC_API_KEY` is set and you approve the key when Claude Code asks, it skips the login prompt. A Console account is the other API route, with pre-paid credits, and its first login creates a "Claude Code" workspace for cost tracking.

### How do I uninstall Claude Code?

A native install is two paths to delete: `rm -f ~/.local/bin/claude` for the program and `rm -rf ~/.local/share/claude` for its data, on macOS, Linux and WSL. Those leave `~/.claude` alone. Deleting that folder as well removes your settings and session history. The setup page lists the Windows paths.

### Can I use Claude Code without a terminal?

Yes. Claude Code also runs in a desktop app, in VS Code and JetBrains IDEs, on the web at [claude.ai/code](https://claude.ai/code), in Slack, and in CI with GitHub Actions and GitLab.

## Sources

- [Claude Code docs: Quickstart](https://code.claude.com/docs/en/quickstart) (read 2026-11-04)
- [Claude Code docs: Advanced setup](https://code.claude.com/docs/en/setup) (read 2026-11-04)
- [Claude Code docs: Terminal guide for new users](https://code.claude.com/docs/en/terminal-guide) (read 2026-11-04)
- [Claude Code docs: Troubleshoot installation and login](https://code.claude.com/docs/en/troubleshoot-install) (read 2026-11-04)
- [Boris Cherny on X: his Claude Code setup, 2 January 2026](https://x.com/bcherny/status/2007179832300581177) (read 2026-11-05)
- [Boris Cherny on X: tip 10, permissions, 2 January 2026](https://x.com/bcherny/status/2007179854077407667) (read 2026-11-05)

[Start lesson 2](https://mindket.com/learn/claude-code/claude-code-plan-mode)
