Keeping changes small and reviewable
Course contents (20 lessons)
- Meet Claude Code
- What Claude Code is and how it differs from a chat window
- Installing Claude Code and signing in
- Your first session: explore, ask, change
- Asking well and staying in control
- Asking for changes: context, goal, constraints and acceptance criteria
- Reading and approving edits
- Permission modes: how much freedom to give
- Project memory and slash commands
- CLAUDE.md: teaching the tool about your project
- Slash commands and custom commands
- Everyday coding workflows
- The plan-first workflow
- Understanding unfamiliar code
- Debugging with Claude Code
- Refactoring safely
- Writing tests with Claude Code
- Git, small changes, cost and security
- Git workflows: branches, commits and pull request descriptions
- Keeping changes small and reviewable
- Context and cost awareness
- Security habits: secrets, commands and untrusted input
- Extending the tool, teamwork and a final project
- Hooks and MCP servers explained
- Team practices for AI-assisted coding
- Final project: building a small app step by step
The bottleneck is review
The tool can write code faster than you can read it. That means the limit on safe speed is your reviewing, not its typing. If it produces a 1,500-line change, you will skim it, and skimming is how bugs get through. The best fix is to keep each change small enough to review properly.
A rough rule I use: if I cannot review a diff in about 15 minutes, it is too big. Your number may differ. The point is to have one.
Slice the work
Break a feature into steps where each step works on its own and can be tested.
| Slice | Result you can check |
|---|---|
| 1. Database change and model | Migration runs, model tests pass |
| 2. Service logic with unit tests | Tests pass, no UI yet |
| 3. API endpoint | Endpoint tests and a manual call work |
| 4. UI | The screen works in the browser |
| 5. Polish: errors, empty states, docs | Review checklist done |
Each slice becomes one prompt, one diff, one commit. If slice 3 turns out wrong, slices 1 and 2 are untouched.
Put limits in the prompt
Implement only the service logic (slice 2). Limits:
- Change at most 3 files, plus tests.
- Do not touch controllers, UI or migrations.
- No new dependencies.
- No reformatting of existing code.
If you think more files need to change, stop and tell me why instead of changing them.
Why it works
It sets a measurable boundary and an escape hatch. The tool can say "I need to change the controller" without silently doing it. You then decide. This turns scope creep from a surprise into a decision.
Check the size before you read
Before reading any change line by line, look at its shape:
git diff --stat
This lists the files changed and the number of lines. If the list contains files you did not expect, or a large number of lines in one file, deal with that first. Ask: "Why did you change these files? List each file with a one-line reason." Then decide what to revert.
Separate noise from signal
Formatting changes, import reordering and renames make a diff look much bigger than the real change. Ask for them in separate commits, or not at all. A prompt line such as "Keep the existing formatting and do not reorder imports" avoids a lot of noise.
Stop scope creep in the middle
If you see the tool wandering into other files, press Escape and say:
Stop. You are changing files outside the scope. Revert any changes outside src/Invoices and tests/Invoices, then continue only with the original task.
Write down the "later" list
While working, the tool and you will notice other problems: a bad name, a missing test, an old TODO. Resist fixing them now. Ask the tool to add them to a short list:
Add to a file called notes/later.md a one-line bullet for each unrelated problem you noticed while working on this task. Do not fix them now.
This keeps the current diff clean and makes sure you do not lose good observations.
Why small diffs also help the tool
Small tasks have clear success checks. The tool does better when it can run a test and see a pass. Long tasks drift, fill the context and lose early decisions. Short tasks with a clear end give better results and cost less.
The common mistake
The common mistake is saying "do the whole thing, I will review at the end" and then reviewing for two hours, or not at all. The time you save on prompts is lost, with interest, in review. Smaller steps feel slower and finish sooner.
Try it yourself
Take a feature you would normally do in one go. Write the slices on paper, with the check for each. Run it slice by slice with scope limits in every prompt. After each, run git diff --stat and note the size. Compare the total review time with your last big change.
This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.
Sign up free I already have an account