Reading and approving edits
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
You are the reviewer
When the tool proposes an edit, you see it before it is applied, unless you have chosen a mode that applies edits automatically. This moment is where your skills matter most. A tool that writes quickly is only as good as the person who reads what it wrote.
What to look for in a diff
I read in this order:
- Scope. Does the change touch only the files and areas I expected? Extra files are a warning.
- Intent. Does it do what I asked? Not what is easy, not something similar.
- Deleted lines. What was removed? Deleted checks, deleted tests, deleted error handling and commented-out code deserve extra suspicion.
- Edge cases. Null input, empty lists, very large values, concurrent calls, time zones.
- Consistency. Naming, structure and error handling that match the rest of the code.
- Invented things. Functions, options or packages that do not exist in this project. Check imports.
Red flags I have learned to spot
- A failing test "fixed" by changing the test instead of the code.
- Broad try-catch blocks that swallow errors.
- Hard-coded values where a setting or constant exists.
- A new dependency for something the standard library does.
- Large reformatting mixed in with a small logic change.
- Comments that describe what the code was supposed to do, not what it does.
Commands need review too
Besides edits, the tool may want to run shell commands. Read them. Normal ones are your test runner, build, linter, git status and git diff. Slow down for anything that deletes, overwrites, installs, downloads, changes permissions, touches the network or runs a script from somewhere else.
| Command looks like | My response |
|---|---|
| Run tests, lint or build | Usually approve. |
| Recursive delete or force git operations | Stop and read carefully. Usually decline. |
| Installing a new package | Ask why it is needed and check the package. |
| Downloading and piping into a shell | Decline. |
| Anything with secrets or environment variables printed | Decline. |
Giving useful feedback
When you decline or want a change, say exactly what is wrong and what to do instead.
Not this. The new function swallows the exception and returns null, which hides failures from callers. Let the exception propagate and add a test that proves it.
Good approach, but you changed 6 files and I only asked about the invoice total. Revert the changes to the formatting helper and the date utilities. Keep the invoice change only.
Why this works
Both messages give a reason and an instruction. The reason helps the tool understand your standards, which it can apply to the rest of the session. The second message also says what to keep, so you do not lose good work.
Ask the tool to review itself
Review the change you just made as if you were a strict colleague. List any bugs, missing edge cases, missing tests and places where it does not match the project conventions.
This catches real issues surprisingly often, but it is a supplement, not a replacement for your own reading. A tool reviewing its own work shares its own blind spots.
Git as a safety net
Commit before a risky task, so you can always return. If you want to throw away the tool's uncommitted changes to a file, the usual git command for that is git restore <file>. For the whole working tree, you would use it with care, because it discards work. Always run git status first and be sure you are discarding only what you mean to.
git status
git diff --stat
git restore path/to/file
Keep your attention
Approving fifty small edits in a row creates fatigue, and fatigue makes you click yes. If you notice that, stop and change the approach: ask for a plan first, or use smaller tasks, or review the full diff at the end instead of edit by edit.
The common mistake
The common mistake is judging by whether the code runs. Code can run and still be wrong, insecure or hard to maintain. Judge it by whether you would approve it in a pull request from a human colleague.
Try it yourself
Ask the tool for a change that touches at least two files. Review it using the six-point order above and write down your findings in a short note, even if there are none. Then ask for the self-review prompt and compare its findings with yours. Did it find something you missed? Did you find something it missed?
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