Skip to content

Install Claude Code and open it in your project

The repo is cloned, the ticket is open, and you have no agent yet. This is the shortest lesson in the chapter because the install genuinely is a one-liner — but there’s one decision buried in it that quietly shapes everything Claude Code can see, and it’s worth getting right on the first run rather than learning later.

The recommended install is the native installer — one line on macOS, Linux, or WSL:

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

On Windows it’s a PowerShell one-liner instead, and if you’d rather go through a package manager there’s Homebrew (brew install --cask claude-code), WinGet, or an npm global package (npm install -g @anthropic-ai/claude-code). They all land the same thing: a claude command on your PATH that you can run from any directory. Because the exact commands and supported platforms shift over time, treat the official setup guide as the source of truth — it carries the current one-liner for every OS.

Here’s the part that isn’t obvious. Claude Code is scoped to the directory you start it in. That directory becomes its world — the files it can read, the project it reasons about, the CLAUDE.md it picks up. So you don’t run it from your home folder and then point it somewhere; you cd into the project first and launch it there:

> cd ~/work/payments-service
> claude
▐ Claude Code
▐ cwd: ~/work/payments-service
How can I help?

That cwd line is the agent telling you what it can see. Launch from the repo root and it can reach the whole project; launch from a subdirectory and you’ve quietly fenced it into that corner. For this chapter you want the root, so the agent can find the routes, the tests, and the config without you hand-feeding paths.

This scoping isn’t a quirk to memorize — it’s the same fact that governs how sessions resume and how the context window fills, and you’ll meet it again in later chapters. For now just internalize the habit: the directory you launch from is the directory the agent lives in. Start it in the wrong place and nothing else in this chapter works the way it should.

The REPL is up and waiting. But if this is a fresh machine, it doesn’t yet know who you are — the first thing it needs is for you to sign in.