Skip to content

Course · Claude Code · Getting started

Install Claude Code and open it in your project

The chapter’s worked task can wait: a payments service that answers health checks at /health while a new monitor polls /healthz. For now, leave the source alone. Install the CLI and check that your shell can find it:

Terminal window
# macOS, Linux, or WSL
curl -fsSL https://claude.ai/install.sh | bash
claude --version

On native Windows, run the installer in PowerShell:

Terminal window
irm https://claude.ai/install.ps1 | iex
claude --version

A working installation prints a version number. Yours may differ from another reader’s; record it if you need to compare behavior later. These are the native installation commands from the official setup guide, which also covers supported systems and package-manager alternatives.

If your shell reports command not found, installation and command discovery have come apart. Open a new terminal and retry. If it still fails, follow the installation troubleshooting guide to check the install location and PATH. Once the command is available, claude doctor can inspect the installation. Repeatedly pasting the installer will not explain which directory your shell is searching.

Open a terminal in a working copy of a repository you own, set aside for this course; any project works for this page’s launch check. The walkthrough uses the payments service supplied by your course host, and ~/work/payments-service below is its illustrative path, not a required one. The health-route lessons that follow need that payments project or an Express project you adapt to the task; the chapter introduction describes the project and the option to read those lessons as a walkthrough.

Terminal window
cd ~/work/payments-service
pwd
git status --short
claude --permission-mode default

Before the last command, check the directory and the Git status. If git status reports that this is not a Git repository, which is the case for the payments project as the course host supplies it, create the history the later review, rewind, and worktree drills rely on: initialize a repository, ignore the installed and built output, and commit a baseline before Claude edits anything.

Terminal window
git init
printf 'node_modules/\ndist/\n' > .gitignore
git add -A
git commit -m "Baseline before the course"

If you already have changes, preserve them and note which files they touch. Later, you need to distinguish the agent’s work from work that was there when it arrived.

The explicit --permission-mode default selects the manual permission mode for this walkthrough, and on current versions that flag is doing real work: a plain claude launch can start in auto mode, where most actions are auto-approved (the default-prompt lesson lists which versions start where). Pinning default selects the manual approval mode while you are learning what the agent does: Claude asks before file edits and shell commands that no saved permission rule or organization setting already allows. Those rules and settings still apply, so the flag is not a promise that every operation will display a new prompt. The modes are documented in the permission-modes reference and taught in Permissions & modes; the flag itself is in the CLI reference.

Launching from the repository root gives the session a sensible place to begin looking for the application, tests, and project instructions. Starting inside src/payments/ instead makes it easier to orient the task around the payment module when the ticket actually concerns an HTTP route elsewhere.

The working directory does not by itself isolate the process from the rest of your machine. File access also depends on permission rules, additional directories, and any configured sandbox. Keep the distinction clear: choosing a directory helps establish the task’s context; restricting access requires the appropriate controls. The working-directory documentation describes those access rules.

There is another distinction you will use throughout the course. Being able to read a file does not mean the model has already read it. The agent still has to gather the information relevant to your question. In the next lesson, you will watch it do that for a route whose location you can check yourself.

On a fresh installation, launching Claude Code also begins account setup. Sign in, then ask where the health check lives.