Claude Code is an AI that lives in your terminal and reads and writes your repository directly. Pasting code into a browser chat box, then copying the answer back into your editor—that round trip goes away.

This chapter builds the mental model that all six remaining chapters rest on. Skip it, and in the later chapters you will never quite feel why things are designed the way they are.

First, the lay of the land — where this tool runs

Tools that let AI write code split into three groups, by where they run. Claude Code belongs to the first.

TYPE 1
CLI agents

Runs in the terminal and touches files directly. Claude Code, Codex CLI, and the like. Good at taking on a whole chunk of work.

TYPE 2
AI editors

Built into the editor, suggesting right beside what you are typing. Cursor, GitHub Copilot, and the like. Good at writing while you watch.

TYPE 3
Cloud builders

Everything happens in the browser, and you can publish straight from there. v0, Bolt, Lovable, and the like. Good at needing no local setup.

The three-way comparison itself is covered in Chapter 1 of the AI Coding course. This course narrows to the first type and goes deep.

Claude Code is not terminal-only, by the way. The same thing is available as a VS Code or JetBrains extension, as a desktop app, and from the browser. But its design thinking starts at the terminal, and once you understand that, none of the other entry points will confuse you.

The decisive difference from chat tools

"Claude in the browser can write code too, so what is actually different?"—that question always comes first. The difference is not intelligence. It is reach.

Chat style (Claude in the browser)

It only sees what you paste. What it hands back is text. You are the one who applies it. When the change spans 10 files, that is 10 pastes and 10 trips back.

Agent style (Claude Code)

It finds and reads on its own. What it hands back is a diff. It runs the tests, and when they fail it fixes them and runs them again. It locates those 10 files itself.

The difference bites when the work involves finding things out. "Track down everywhere this function is called and fix them all" means you do the tracking down, with a chat tool. An agent runs the search itself.

Turn that around and the wider the reach, the wider the damage when it gets something wrong. That is why permissions need designing (Chapter 5). Smart does not mean safe.

The agent loop — gather → act → verify

While Claude Code is working, the same cycle keeps turning underneath.

STEP 1
Gather context

It looks for files, reads them, and searches when it has to. What you let it read here decides the result.

STEP 2
Act

It rewrites files and runs commands. The permission gate sits here.

STEP 3
Check the result

It reads the output of tests and type checks. If they failed, it goes back to STEP 1.

What matters is that STEP 3 exists. A chat tool stops at "this is probably right." An agent can run its own output and find out. Being able to keep fixing until the tests pass comes from this loop.

Which also means the advantage disappears on tasks you cannot verify. "Clean this code up" has no definition of success, so the loop just spins. The pattern covered in Chapter 3, handing it a way to verify up front, comes straight from here.

Tools and permissions — what it can do, and what you can stop

What Claude Code can do is set by the range of "tools" it has been given. Read a file, write a file, run a command, search—each one is its own tool.

And every tool call passes a permission check. By default it asks for your approval each time it rewrites a file or runs a command. There are settings that skip the approval, and Chapter 5 covers what to watch out for there.

You: "Fix the tests around authentication" ↓ [SEARCH] find the files that touch auth ← read. no confirmation by default ↓ [READ] read auth.test.ts ← read ↓ [EDIT] rewrite auth.test.ts ← write. the prompt comes here ↓ [RUN] run npm test ← execute. another prompt here ↓ read the failure, back to [EDIT]

Once you can see this flow, you know why it stopped where it stopped. It did not get stuck. It hit a permission gate.

The context window as a constraint

There is a ceiling on how much Claude Code can "hold in mind" at once. That ceiling is the context window. The longer the conversation runs and the more files it reads, the fuller it gets.

As it fills, two things happen.

Responses get sluggish

It rereads a huge history every turn, so it slows down and costs more. This ties directly into the cost discussion in Chapter 7.

The early part gets forgotten

The premises you set at the start get pushed out. "But I told you that already" is usually this.

The fix is to fold the conversation up—either summarize and compress it, or cut it off and start a fresh one. Knowing when to fold takes judgment, so Should you run /compact on a schedule? works through the criteria. The hands-on steps are in Chapter 3.

What it suits, what it does not

You get the shape of a tool by learning what it is bad at.

Good fit

Fixes that span several files / investigating existing code / iterating until the tests pass / routine migration work / tracing a cause back from an error message

Poor fit

Work with no definition of correct / territory you cannot run and check / business calls only you know / one-line fixes (the approval round trip costs more)

The "poor fit" side is not a matter of capability. It is structural: the verification loop cannot turn. That is why swapping in a smarter model does not solve it.

A map of this course

Here is where the remaining six chapters sit. Reading in order is the default, but if you are already stuck, starting at Chapter 4 is fine.

2. Setup and the First Hour

Installing it, connecting it, and getting your first instruction through.

3. The Daily Workflow

Putting the work on the explore → plan → implement → commit rails.

4. Getting Unstuck

A procedure for working down from symptom to cause.

5. Permissions and Safety

Designing how far to delegate and where to stop it.

6. Extending It

When to reach for CLAUDE.md, hooks, subagents, and MCP.

7. Cost and Limits

The operational know-how for using it over the long haul.

There is an official learning site too. Anthropic runs a free learning platform, Claude Academy, and it includes a Claude Code course. This course is not a replacement for it. It leans toward explanations in your own language, worked backwards from cases where people actually got stuck. Using both should be the faster route.

Summary

  • Claude Code is an agent-style tool that runs in the terminal and reads and writes your repository directly
  • The gap against chat tools is not intelligence but reach. It searches on its own, hands back diffs, and runs things to check
  • Underneath is a gather → act → verify loop. Because STEP 3 exists, it can keep fixing until the tests pass
  • What it can do is set by the range of its tools, and every tool call passes a permission gate
  • When the context window fills, it gets sluggish and forgets the early part. Deciding when to fold takes judgment
  • The poor fit is tasks where the verification loop cannot turn. Changing the model does not solve it

By now you should have a grip on what kind of tool Claude Code is. Next we actually run it. Move on to Chapter 2, "Setup and the First Hour".