---
id: claude-code
lang: en
title: "Claude Code"
seoTitle: "What is Claude Code? A practical guide"
description: "Claude Code is Anthropic's AI coding agent that lives in your terminal: it reads your files, proposes changes you approve, and runs the whole dev loop."
part: advanced
partTitle: "Advanced and specialised"
partOrder: 5
order: 1
level: Advanced
durationMinutes: 11
outcome: "Understand what Claude Code is, how its approve-first loop works, and run it on a small task in a real codebase."
summary: "Claude Code is an AI coding agent in your terminal. It reads your files, proposes changes you approve, and runs the whole build loop, one approved step at a time."
draft: false
updated: "2026-07-26"
keywords:
  - Claude Code
  - what is Claude Code
  - AI coding agent
  - Claude terminal
  - AI pair programming
  - Claude Code getting started
furtherReading:
  - title: "Claude Code overview (Anthropic docs)"
    url: "https://code.claude.com/docs/en/overview"
    note: "What Claude Code is and what it can do."
  - title: "Your first day in Claude Code (Help)"
    url: "https://support.claude.com/en/articles/14552382-your-first-day-in-claude-code"
    note: "A gentle, step-by-step first session."
  - title: "Quickstart (Anthropic docs)"
    url: "https://code.claude.com/docs/en/quickstart"
    note: "Install and make your first change in about 15 minutes."
  - title: "Claude Code (product page)"
    url: "https://claude.com/product/claude-code"
    note: "The overview, plans, and IDE integrations."
quiz:
  intro: "Five questions on how Claude Code works and how to stay in control. Ace them and you finish Part 5's first lesson."
  passScore: 5
  questions:
    - q: "Where does Claude Code run?"
      options:
        - "Only inside a web browser tab"
        - "In your terminal, alongside your normal editor and tools"
        - "As a plugin that replaces your code editor"
      answer: 1
      explain: "It runs in the terminal and works next to your editor and tools, without asking you to change your setup."
    - q: "Before Claude Code changes a file or runs a command, what happens?"
      options:
        - "It applies the change and tells you afterwards"
        - "It shows you the change and waits for your approval"
        - "Nothing, it only ever suggests text you copy yourself"
      answer: 1
      explain: "The default is approve-first: you see a diff or the command and choose Yes, 'Yes and stop asking for edits', or No."
    - q: "Do you need to upload your code for Claude Code to see it?"
      options:
        - "Yes, you attach the files first, like in a chat"
        - "No, it reads files from the project on demand"
        - "Only the files larger than 30MB"
      answer: 1
      explain: "You start it inside the repository and it reads what it needs, when it needs it. Nothing to upload."
    - q: "What is a CLAUDE.md file good for?"
      options:
        - "Storing your password for the project"
        - "Standing instructions and context Claude Code reads every session"
        - "A log of every change, written automatically"
      answer: 1
      explain: "A CLAUDE.md in the repo is a standing brief: conventions, how to run tests, what to avoid. Claude Code reads it each session."
    - q: "When is Claude Code the right tool, rather than chat or Cowork?"
      options:
        - "Whenever you want a quick written answer"
        - "When the work is a real codebase: reading, changing, testing, and committing code"
        - "Only when you have no internet connection"
      answer: 1
      explain: "Reach for Claude Code when the job is code in a real project. Chat is for answers; Cowork is for files on your computer."
  pass:
    badge: "Perfect score"
    title: "You get the coding agent."
    body: "Full marks. You know what Claude Code is, how its approve-first loop keeps you in control, and when to reach for it."
  retry: "Check the marked answers and try again. This one rewards a second read."
---

> **Level:** Advanced · **Reading time:** ~11 min
>
> **What you'll be able to do:** explain what Claude Code is, understand its approve-first loop, and run it on a small task in a real codebase.

Everything so far has lived in a chat window or in [Cowork](/glossary#cowork). This lesson steps onto different ground: **Claude Code**, an AI agent that works in your *terminal* and edits real code. It is the most technical tool in the course, and the most powerful for one job: building and changing software.

You do not have to be a developer to get value from this lesson. Plenty of business people run small scripts, tweak a website, wrangle a spreadsheet of data, or work with a technical team and want to understand what their engineers are now using every day. Even if you never open a terminal, knowing what Claude Code is and how it behaves will sharpen how you talk about AI at work. And if you *are* comfortable poking around, this is the lesson where AI stops answering questions and starts doing the work.

> **Last checked: July 2026.** Claude Code changes quickly. Prices, commands, and features may have moved on; treat the specifics as a snapshot and check the linked docs for the current detail.

## What Claude Code actually is

**Claude Code is a coding agent that runs in the terminal.** The terminal (also called the command line) is the plain text window where you type commands to your computer instead of clicking buttons. Claude Code lives there. You describe what you want in plain English, and it reads your files, writes and changes code, runs commands, and works through multi-step jobs, checking its own results as it goes.

Three things make it different from a chat about code:

- **It sees your whole project.** You start it inside a repository (the folder that holds a piece of software), and it reads whatever files it needs, when it needs them. There is nothing to upload or paste.
- **It acts, it does not just advise.** It can edit files, run tests, use command-line tools, and work with Git and GitHub, all from the same window.
- **It keeps you in the loop.** By default it asks before it changes anything, so you approve each step. More on that below, because it is the heart of using it well.

It is the same [agent](/glossary#agent) idea from lesson 1.1, pointed squarely at software: give it a goal, and it plans and carries out the steps rather than handing you a to-do list.

<figure class="lesson-svg">
<svg viewBox="0 0 640 250" width="100%" role="img" aria-labelledby="cc1-t cc1-d" xmlns="http://www.w3.org/2000/svg">
<title id="cc1-t">How Claude Code works</title>
<desc id="cc1-d">You type in the terminal to Claude Code, which reads your files, works with Git and GitHub, and runs tests and commands, asking before it changes anything.</desc>
<g font-family="Inter, Arial, sans-serif">
<rect x="18" y="96" width="150" height="58" rx="12" fill="#fff" stroke="var(--part, var(--coral))" stroke-width="1.5"/>
<text x="93" y="121" text-anchor="middle" font-size="14" font-weight="700" fill="#4A4A4A">You, in the</text>
<text x="93" y="140" text-anchor="middle" font-size="14" font-weight="700" fill="#4A4A4A">terminal</text>
<path d="M170 118 h60" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc1a)"/>
<path d="M230 138 h-60" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc1a)"/>
<rect x="232" y="96" width="156" height="58" rx="12" fill="var(--part, var(--coral))"/>
<text x="310" y="130" text-anchor="middle" font-size="16" font-weight="800" fill="#fff">Claude Code</text>
<g font-size="13.5" fill="#4A4A4A" text-anchor="middle">
<rect x="452" y="34" width="170" height="44" rx="10" fill="var(--part-tint, var(--coral-tint))" stroke="var(--part, var(--coral))"/>
<text x="537" y="61">Your files</text>
<rect x="452" y="103" width="170" height="44" rx="10" fill="var(--part-tint, var(--coral-tint))" stroke="var(--part, var(--coral))"/>
<text x="537" y="130">Git &amp; GitHub</text>
<rect x="452" y="172" width="170" height="44" rx="10" fill="var(--part-tint, var(--coral-tint))" stroke="var(--part, var(--coral))"/>
<text x="537" y="199">Tests &amp; commands</text>
</g>
<path d="M388 118 C 420 100, 430 70, 452 58" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc1a)"/>
<path d="M388 125 h60" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc1a)"/>
<path d="M388 132 C 420 152, 430 182, 452 194" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc1a)"/>
<text x="310" y="180" text-anchor="middle" font-size="12.5" fill="#8A8A8A">Asks before it changes anything</text>
</g>
<defs>
<marker id="cc1a" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto"><path d="M0 0 L9 4.5 L0 9 z" fill="var(--part, var(--coral))"/></marker>
</defs>
</svg>
</figure>

## Who it is for, and why a non-coder might still care

The honest answer: Claude Code is aimed at people who work with code, and it is happiest in the hands of someone who can read a diff and knows roughly what "run the tests" means. Anthropic says you do not need to know how to code to use it, and that is true for small, self-contained tasks. But the further you get from things you can *check*, the more you are trusting output you cannot judge, and that is where trouble hides.

So here is a fair way to place yourself:

- **You write code for a living.** This is likely already part of your day. The rest of this lesson is a tour of the habits that make it reliable.
- **You are semi-technical:** you edit a website, run the odd script, or manage a small tool. Claude Code can genuinely help, as long as you work on a copy, review changes, and keep a backup. Treat it like a very fast junior who needs checking.
- **You are not technical at all.** You probably will not open a terminal, and that is fine. Read this to understand what your engineers now use, and lean on [Cowork](/glossary#cowork) for file work instead. Knowing the difference is the win.

**The rule of thumb:** the value of an AI that writes code is capped by your ability to tell whether the code is right. Claude Code raises the ceiling on what you can build; it does not remove your responsibility for the result.

## Getting in: install and first run

Setup is short. You install Claude Code once with a single command for your operating system (macOS, Linux, or Windows), then sign in with your Claude account. The linked quickstart walks through the exact command, which changes often enough that it is not worth reprinting here.

Once installed, the pattern is always the same:

```
cd my-project
claude
```

That is: move into the project folder, then start Claude Code. It opens a prompt right there in the terminal, already able to see the project around it. **There is no upload step**, which is the first thing that surprises people coming from chat. You are not handing it files; you are standing it inside your workshop.

From there you just talk. Type a message, press Enter. A good first line is not "fix everything", it is something small and legible:

```
Explain what this project does and how it is organised. Keep it to a short tour.
```

Type `/help` at any time to see the built-in commands. You do not need most of them on day one.

## The core loop: ask, review the diff, approve

This is the part worth slowing down for, because it is what separates a useful session from a scary one.

When you ask Claude Code to change something, it does not silently rewrite your files. It shows you a **diff**, a side-by-side of exactly what it wants to add or remove, and waits. You get three choices:

- **Yes** applies that single change.
- **Yes, and don't ask again for edits** auto-approves further file edits for the rest of the session. Fast, but you have handed over the wheel, so use it only when you trust the task.
- **No** rejects the change, and you can say why, which steers the next attempt.

The same gate applies to running commands. This **approve-first loop** is the safety model: nothing touches your files or your machine until you say so. New users should stay in approve-first mode until they have a feel for how the agent behaves on their project.

<figure class="lesson-svg">
<svg viewBox="0 0 640 250" width="100%" role="img" aria-labelledby="cc2-t cc2-d" xmlns="http://www.w3.org/2000/svg">
<title id="cc2-t">The approve-first change loop</title>
<desc id="cc2-d">You ask, Claude Code proposes a diff, you choose Yes, Yes and stop asking, or No, then it applies the change and can run the tests, and the loop repeats.</desc>
<g font-family="Inter, Arial, sans-serif" text-anchor="middle">
<rect x="20" y="40" width="150" height="46" rx="10" fill="#fff" stroke="var(--part, var(--coral))" stroke-width="1.5"/>
<text x="95" y="68" font-size="14" fill="#4A4A4A">Ask in English</text>
<path d="M170 63 h40" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc2a)"/>
<rect x="212" y="40" width="170" height="46" rx="10" fill="#fff" stroke="var(--part, var(--coral))" stroke-width="1.5"/>
<text x="297" y="68" font-size="14" fill="#4A4A4A">Proposes a diff</text>
<path d="M382 63 h40" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc2a)"/>
<rect x="424" y="32" width="196" height="62" rx="10" fill="var(--part-tint, var(--coral-tint))" stroke="var(--part, var(--coral))" stroke-width="1.5"/>
<text x="522" y="56" font-size="13" font-weight="800" fill="var(--part-ink, var(--coral-ink))">You choose</text>
<text x="522" y="76" font-size="12" fill="#4A4A4A">Yes  /  Yes, stop asking  /  No</text>
<path d="M522 94 V 140 H 297 V 158" fill="none" stroke="var(--part, var(--coral))" stroke-width="2" marker-end="url(#cc2a)"/>
<rect x="212" y="158" width="170" height="46" rx="10" fill="var(--part, var(--coral))"/>
<text x="297" y="186" font-size="14" font-weight="800" fill="#fff">Applies the change</text>
<path d="M212 181 H 95 V 92" fill="none" stroke="#B8B2AD" stroke-width="2" stroke-dasharray="4 4" marker-end="url(#cc2b)"/>
<text x="120" y="150" text-anchor="start" font-size="12" fill="#8A8A8A">and runs tests, then repeat</text>
</g>
<defs>
<marker id="cc2a" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto"><path d="M0 0 L9 4.5 L0 9 z" fill="var(--part, var(--coral))"/></marker>
<marker id="cc2b" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto"><path d="M0 0 L8 4 L0 8 z" fill="#B8B2AD"/></marker>
</defs>
</svg>
</figure>

## What it can do beyond single edits

If it only edited one file at a time, Claude Code would be a fancy autocomplete. The power is that it strings steps together into real work:

- **Read and explain a codebase.** Point it at an unfamiliar project and ask for a tour. It will map the structure and explain how the pieces fit, which is worth the install on its own when you inherit someone else's code.
- **Make a change across many files.** "Rename this concept everywhere and update the tests" is the kind of tedious, error-prone job it handles well, showing you each edit.
- **Run and fix tests.** It can run your test suite, read the failures, and fix the code until they pass, looping on the feedback rather than guessing once.
- **Work with Git and GitHub.** It can create branches, write sensible commit messages, open a pull request, and even read an issue and take it from description to proposed fix.
- **Plan first on hard jobs.** For anything gnarly, ask it to *plan* before it edits. You review the plan, correct the approach, and only then let it start. Cheap insurance against a confident wrong turn.

A realistic first task, start to finish, might read:

```
Read issue #142. Draft a plan to fix it, wait for my okay, then make the change on a new branch and run the tests. Do not open a pull request until I have reviewed the diff.
```

Notice how much of that sentence is *control*: plan first, new branch, wait, review before the PR. That is the shape of a good instruction to an agent.

## Give it standing context: CLAUDE.md, skills, and connectors

Everything you learned about [context](/glossary#context) in Part 2 applies here, with a coding twist.

- **CLAUDE.md.** Drop a file called `CLAUDE.md` in the project and Claude Code reads it every session. It is a standing brief for the repo: the conventions to follow, how to run the tests, what to never touch, where the tricky bits are. Write it once and every future session starts already briefed, exactly like the profile instructions from lesson 2.5, but scoped to this codebase.
- **[Skills](/glossary#skill).** The same Skills idea from lesson 4.2 works here: package a repeatable task ("prepare a release", "add a new API endpoint our way") so it is done the same way each time.
- **[Connectors](/glossary#connector) and [MCP](/glossary#mcp).** Claude Code can reach the same connected tools you met in lesson 4.5, so it can pull a ticket from your tracker or check your error monitor while it works.

The theme is consistent across the whole course: **the more standing context you give it, the less you repeat yourself, and the closer its first attempt lands.**

## Where it fits: chat, Cowork, or Claude Code

You now have three ways to put Claude to work, and picking the right one is a real skill.

<figure class="lesson-svg">
<svg viewBox="0 0 640 210" width="100%" role="img" aria-labelledby="cc3-t cc3-d" xmlns="http://www.w3.org/2000/svg">
<title id="cc3-t">Chat versus Cowork versus Claude Code</title>
<desc id="cc3-d">Chat answers in the window; Cowork works on the files on your computer; Claude Code works in a real codebase in the terminal.</desc>
<g font-family="Inter, Arial, sans-serif">
<rect x="18" y="30" width="192" height="150" rx="14" fill="#fff" stroke="var(--line,#E5E1DE)"/>
<text x="114" y="60" text-anchor="middle" font-size="16" font-weight="800" fill="#4A4A4A">Chat</text>
<text x="114" y="90" text-anchor="middle" font-size="13" fill="#4A4A4A">Answers, drafts,</text>
<text x="114" y="108" text-anchor="middle" font-size="13" fill="#4A4A4A">and thinking</text>
<text x="114" y="150" text-anchor="middle" font-size="12.5" fill="#8A8A8A">Best for: a fast reply</text>
<rect x="224" y="30" width="192" height="150" rx="14" fill="#fff" stroke="var(--line,#E5E1DE)"/>
<text x="320" y="60" text-anchor="middle" font-size="16" font-weight="800" fill="#4A4A4A">Cowork</text>
<text x="320" y="90" text-anchor="middle" font-size="13" fill="#4A4A4A">Files on your</text>
<text x="320" y="108" text-anchor="middle" font-size="13" fill="#4A4A4A">computer, no terminal</text>
<text x="320" y="150" text-anchor="middle" font-size="12.5" fill="#8A8A8A">Best for: documents</text>
<rect x="430" y="30" width="192" height="150" rx="14" fill="var(--part-tint, var(--coral-tint))" stroke="var(--part, var(--coral))" stroke-width="2"/>
<text x="526" y="60" text-anchor="middle" font-size="16" font-weight="800" fill="var(--part-ink, var(--coral-ink))">Claude Code</text>
<text x="526" y="90" text-anchor="middle" font-size="13" fill="#4A4A4A">A real codebase,</text>
<text x="526" y="108" text-anchor="middle" font-size="13" fill="#4A4A4A">in the terminal</text>
<text x="526" y="150" text-anchor="middle" font-size="12.5" fill="var(--part-ink, var(--coral-ink))">Best for: code</text>
</g>
</svg>
</figure>

Use **chat** for a quick answer, a draft, or thinking something through. Use **Cowork** when the work is files on your computer: a spreadsheet, a deck, a folder of documents. Use **Claude Code** when the work *is* code in a real project, and you want it read, changed, tested, and committed. They share the same brain; they differ in where they reach.

## Staying safe and in control

Claude Code is powerful precisely because it can act, so a few habits matter more here than anywhere else in the course:

- **Work on a branch, keep a backup.** Never let an agent loose on the only copy of anything. Version control (Git) is your undo button; use it.
- **Stay in approve-first mode** until you trust a given task. "Yes, and don't ask again" is convenient and occasionally the right call, but it is also how a small mistake becomes twenty files of small mistakes.
- **Review the diff, every time it matters.** The whole design hands you a checkpoint. Skipping it defeats the point.
- **Mind prompt injection.** If Claude Code reads a file, a web page, or an issue that contains sneaky instructions, those can try to hijack the task, the same risk you met with Cowork in 4.4. Watch what you point it at.
- **You own the output.** As with every tool in this course, the code that ships is your responsibility, not the model's. Claude Code makes you faster; it does not make you unaccountable.

## Cost and plans

Claude Code comes with the paid Claude plans: **Pro and Max include it** with usage limits that scale with the tier, and teams can also bill usage through the Claude API. Heavy, long-running sessions use more than a quick chat, so keep an eye on usage the same way you learned to keep the [context window](/glossary#context-window) lean in Part 4. As always, the linked pages carry the current numbers.

## Try it

If you have a terminal and a small project handy, this takes ten minutes. If you do not, read it as a walkthrough so the shape is familiar when you need it.

1. Open your terminal, move into a small project folder (`cd` into it), and start Claude Code.
2. Ask it for a short tour: *"Explain what this project does and how it is organised."* Read the reply. This alone is often a revelation on unfamiliar code.
3. Now ask for a tiny, safe change, for example: *"Add a short comment at the top of the main file explaining what it does. Show me the diff first."*
4. When the diff appears, read it, then choose **Yes** or **No**. Feel the checkpoint. That pause is the whole safety model.
5. If you use Git, ask it to *"commit this on a new branch with a clear message."* You have now run the core loop end to end.

The goal is not the comment. It is to feel how an agent proposes, waits, and acts, so you trust the loop before you point it at something that matters.

*(General exercise. Role and industry versions come once accounts are in.)*

## Key terms

[Claude Code](/glossary#claude-code), [Terminal](/glossary#terminal), [Agent](/glossary#agent), [Cowork](/glossary#cowork), [Skill](/glossary#skill)
