Section 2Setup

Section 1 argued that the harness — not the model — decides your results; here you build its first pieces. This is a READ-DO checklist: read each item, do it, move on. Budget half an hour from a blank machine — less if Node and Git are already on it. At the end you'll have a working agent, a package manager it must use, the skills that teach it this guide's workflow, and one guardrail that proves rules can be enforced, not just requested. Then you'll run your first agent and see it work.

Everything here happens in the terminal. If you've never used one, that's fine — every command below is copy-paste, each step ends with a "you'll know it worked" check, and none of the specific commands in this section can damage anything. That last promise is about these particular commands, not about agents in general — an agent can run destructive commands, which is exactly why later sections build guardrails. You'll install the first one before this chapter ends.

For newcomers

The terminal is a program where you operate your computer by typing commands instead of clicking. On a Mac it's the pre-installed app called Terminal; on Windows, PowerShell; on Linux, any terminal app. You type a command, press Enter, and the computer prints its answer as text. Two things nobody tells beginners: nothing happens until you press Enter, and no news is usually good news — many commands print nothing when they succeed.

Before you start (prerequisites)

Three things must exist before the agent can run — a runtime, version control, and an account — plus a folder for it to work in. They get the same treatment as everything else in this chapter: do the step, run the check.

1

Install Node.js

Node.js is the runtime that Claude Code and the other tools run on. Think of it as the motor many developer tools share; you install it once and forget it. Installing it also gives you npm (a package manager, used below). Go to nodejs.org and click the big LTS download button — the "long-term support" installer for your operating system. Run it; the wizard's default answers are all fine.

In your terminal:

node --version
You'll know it worked when it prints a version starting with v20 or higher (something like v22.11.0).

If it says command not found (or not recognized): close the terminal window and open a fresh one, then try again. Newly installed commands often only appear in new terminal sessions — remember this reassurance, it applies to every install in this chapter.

2

Install Git

Git is the version-control tool that saves snapshots ("commits") of your code and lets agents work on separate copies. It's also your safety net: because every change is recorded, anything an agent does can be inspected and undone. The whole workflow assumes a git project. On Windows, download the Git for Windows installer from git-scm.com — the defaults are fine, and it also installs Git Bash, which a later step relies on. On a Mac, run xcode-select --install in the terminal and accept Apple's dialog, or use the installer from the same page.

In your terminal:

git --version
You'll know it worked when it prints a version number. Same fix as before if it doesn't: fresh terminal window.
3

Create a Claude account

Claude Code signs in to Anthropic's service, which needs a paid plan or API credits (you pay per token — roughly, per chunk of text the model reads and writes). Create an account at claude.com. Expect a real cost: as of mid-2026, Claude Pro at roughly $20/month is the typical hobbyist tier, Claude Max at roughly $200/month covers heavy multi-agent use, and pay-per-token API credits are the alternative. Prices change — check the current pricing page before you pick.

You'll know it worked when you can sign in on the website and your plan (or credit balance) shows up in account settings.
4

Make your first project folder

Everything an agent does happens inside a project folder — one folder per project, with git recording every change inside it. The rest of this guide keeps saying "go to your project folder", so make it exist now:

In your terminal:

mkdir my-first-project
cd my-first-project
git init

cd ("change directory") moves your terminal into that folder — every command you type afterwards applies there. You'll type it every time you come back to the project; a handy trick is to type cd  (with a trailing space) and drag the folder from Finder or Explorer into the terminal window — its location gets pasted for you.

You'll know it worked when git status answers "On branch main" (or master) and "No commits yet" — an empty, git-tracked project, which is exactly what the next steps assume.
5

Install Claude Code

Claude Code is the harness — the terminal app that runs the agent. Install it globally with npm (from the prerequisites), then log in. "Globally" means the tool is installed once for your whole computer, not into one project — which is what you want for the tools you'll use everywhere.

In your terminal:

npm install -g @anthropic-ai/claude-code
claude   # first run walks you through login

The first claude run opens your browser so you can sign in to your account; after that, the terminal and the agent are connected. From then on, starting an agent is: open terminal, go to your project folder (cd my-first-project), type claude.

You are now juggling two different prompts, and mixing them up is the classic beginner tangle. The terminal prompt — a line ending in something like $ or > — is where commands like npm and git go. The Claude Code prompt — the bordered chat box that appears after you type claude — is where you talk to the agent in plain English and use slash-commands like /grill-me. Paste a terminal command into the chat box and the agent may run it — or just chat about it; paste /grill-me into PowerShell and you get an error. Every code block in this chapter is labelled with where it belongs.

You'll know it worked when typing claude in any folder opens the chat prompt and shows your working directory.

If the terminal says command not found: claude, close the terminal window and open a fresh one — newly installed commands often only appear in new sessions.

For newcomers

How to read a command. npm install -g @anthropic-ai/claude-code is three parts: the tool being asked (npm), what to do (install, with -g for "globally"), and the thing to act on (the package name). Most commands in this guide follow that pattern — tool, action, target. You never need to memorise them; you copy, paste, and read the answer.

6

Install pnpm

Use pnpm as your project's package manager — the tool that fetches and installs the code libraries (dependencies) your project builds on. It's fast and strict: it refuses to let your project silently use a library nobody declared, a whole class of "works on my machine" bugs that agents are especially prone to introduce. This guide's rules assume it.

In your terminal:

npm install -g pnpm
pnpm --version
You'll know it worked when pnpm --version prints a version number.

Using npm to install these global tools is fine — the "never npm" rule you'll set below is only about commands inside a project. Two package managers in one project create conflicting bookkeeping; that's the actual rule.

7

Install the skills

Matt Pocock's skills are the reusable instructions that teach the agent each part of this workflow — grilling, planning, TDD, review. Think of each as a recipe card the agent pulls out when you ask for that move by name, so you don't re-explain the method every session. Install them once; they work in every project. Follow the current command in the repo's README (at time of writing):

In your terminal (not in the Claude Code chat box):

npx @mattpocock/skills install

npx is npm's "run once without installing" command — it fetches the installer, runs it, and leaves nothing behind but the skills themselves.

You'll know it worked when typing / inside Claude Code lists skills like grill-me, to-prd and tdd.
8

Write a lean AGENTS.md and one hook

AGENTS.md is standing instructions for coding agents — a "README for agents": build/test commands, house rules, environment quirks. It's the open, cross-tool convention that most agents read. Claude Code itself natively reads a different file, CLAUDE.md — so the setup that makes every tool happy is a pair: put your rules in AGENTS.md, and add a CLAUDE.md whose entire content is the single line @AGENTS.md. That line is an import — Claude Code follows it and pulls the shared file in, every other tool reads AGENTS.md directly, and the two can never drift apart. Keep the file tiny: the model has a limited instruction budget, so record only what it can't discover on its own. And do not run claude /init; it dumps a bloated file that rots.

File contents — AGENTS.md (in your project's top folder):

- Use pnpm, never npm.
- Type-check with `pnpm tsc --noEmit` before claiming a task is done.

File contents — CLAUDE.md (one line, nothing else):

@AGENTS.md

You haven't needed a code editor so far, and you don't need one now: the easiest way to create both files is to ask Claude Code itself — inside the chat, say "create AGENTS.md and CLAUDE.md in the project root with exactly these contents" and paste the two blocks above.

Now the second half of the step, and the more important one. Rules the model "should" follow in prose, it will sometimes ignore — not out of defiance, but because a model follows instructions statistically, not mechanically. To make a rule certain, back it with a hook — a script that fires automatically and blocks the wrong action every time. A hook isn't smarter than the model; it's dumber, and that's the point: it cannot be argued with, and it never has an off day. This one rejects npm inside the project. Before each shell command, Claude Code hands the script a small JSON description of the call; the script fishes out the command (using Node — already installed, no new tools), and if it's an npm install-family command, it prints the reason and exits with code 2, the exit code that means "block this and tell the agent why".

File contents — .claude/hooks/pre-bash.sh:

#!/bin/bash
# Blocks npm inside this project — the rule is "pnpm, never npm".
cmd=$(node -e 'const d=require("fs").readFileSync(0,"utf8");try{process.stdout.write(JSON.parse(d).tool_input.command||"")}catch(e){}')
if echo "$cmd" | grep -qE '\bnpm +(install|i|ci|add|exec)\b'; then
  echo "Blocked by hook: this project uses pnpm, never npm. Re-run the command with pnpm." >&2
  exit 2   # exit 2 blocks the tool call; Claude reads the message above
fi
exit 0

Registering it tells Claude Code to actually fire the script before every shell command:

File contents — .claude/settings.json (if the file already exists, merge the "hooks" part into it):

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/pre-bash.sh"
          }
        ]
      }
    ]
  }
}

In your terminal (from the project folder):

chmod +x .claude/hooks/pre-bash.sh

chmod +x marks the script as runnable — on Mac and Linux, a file needs that permission before the system will execute it (Windows has no such permission; skip this one command there). Then restart Claude Code (type /exit, then claude again): hook configuration is read at startup. On Windows, the script runs in Git Bash — Claude Code uses it for hooks automatically when it's installed, and the Git for Windows installer from Step 2 already put it there (no Git Bash? use WSL, or install Git for Windows).

You'll know it worked when, after the restart, telling the agent "run npm install" in the chat makes the command get blocked with the hook's message — and the agent switches to pnpm on its own. More hook patterns: the Claude Code hooks guide.

Once you've seen the hook fire, delete the "Use pnpm, never npm" line from AGENTS.md — it was scaffolding. Section 12's doctrine is that every line in that file must earn its place in the instruction budget, and a rule a hook already guarantees earns nothing. This tiny hook is a preview of the whole discipline: Section 1 said to build machinery that doesn't rely on trust — this is the first piece of that machinery, and Sections 7, 9 and 12 build the bigger ones the same way.

For newcomers

Where did .claude go? Files and folders whose names start with a dot are hidden by default — they hold configuration, and file browsers tuck them away. Your file manager can show them (on a Mac, press Cmd+Shift+. in Finder), the terminal lists them with ls -a, and the agent sees them just fine. Hidden ≠ gone.

Your first win

Start claude in your project folder and — inside the Claude Code chat, not the terminal prompt — type /grill-me with a one-line idea ("a command-line tool (CLI) that renames photos by date"). The agent will start interviewing you. That interview is agentic coding — you've already started. And that grilling, run properly until every fuzzy decision is nailed down, is exactly where Section 3 picks up.

One more thing before the loop

The later chapters of the loop — planning tickets, verifying pull requests, shipping — assume your project lives on GitHub with CI running your checks on every proposed change. Wiring that up is its own twenty minutes and has its own page: Setup, part two: production infrastructure. Do it right after this chapter if you're on a roll, or wait until Section 7 asks for it — nothing before then needs it.

If something doesn't work

Setup problems are almost never subtle — the fix is usually "restart and re-read." The two classics:

Troubleshooting: the skills don't show up after install

Restart Claude Code so it re-reads the skills folder. Confirm the skills landed in your Claude config directory (usually ~/.claude/skills/). If the install command has changed, the repo README is the source of truth — the ecosystem moves fast.

Troubleshooting: command not found after an install

The terminal builds its list of known commands when it starts, so a tool installed a minute ago may not be on it yet. Close the terminal window, open a new one, try again. If it persists, re-run the install command and read its output — the error message usually names the problem directly, and pasting it into the agent (or any chatbot) gets you an explanation in plain language.

Quick check: three days in, the agent runs npm install anyway — even though AGENTS.md says "Use pnpm, never npm." A colleague suggests repeating the rule in capital letters. What do you do instead?

Skip the capital letters and reach for machinery: make sure the Step 8 hook is registered and firing (or build it now), watch it block npm once, then delete the prose line. Prose is a request the model honours most of the time; a hook is a guarantee that holds every time. Louder prose buys you nothing — enforcement does, and that difference is the core idea of this whole guide.