Reading and approving edits

10 min read text
Course contents (20 lessons)
  1. Meet Claude Code
  2. What Claude Code is and how it differs from a chat window
  3. Installing Claude Code and signing in
  4. Your first session: explore, ask, change
  5. Asking well and staying in control
  6. Asking for changes: context, goal, constraints and acceptance criteria
  7. Reading and approving edits
  8. Permission modes: how much freedom to give
  9. Project memory and slash commands
  10. CLAUDE.md: teaching the tool about your project
  11. Slash commands and custom commands
  12. Everyday coding workflows
  13. The plan-first workflow
  14. Understanding unfamiliar code
  15. Debugging with Claude Code
  16. Refactoring safely
  17. Writing tests with Claude Code
  18. Git, small changes, cost and security
  19. Git workflows: branches, commits and pull request descriptions
  20. Keeping changes small and reviewable
  21. Context and cost awareness
  22. Security habits: secrets, commands and untrusted input
  23. Extending the tool, teamwork and a final project
  24. Hooks and MCP servers explained
  25. Team practices for AI-assisted coding
  26. 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:

  1. Scope. Does the change touch only the files and areas I expected? Extra files are a warning.
  2. Intent. Does it do what I asked? Not what is easy, not something similar.
  3. Deleted lines. What was removed? Deleted checks, deleted tests, deleted error handling and commented-out code deserve extra suspicion.
  4. Edge cases. Null input, empty lists, very large values, concurrent calls, time zones.
  5. Consistency. Naming, structure and error handling that match the rest of the code.
  6. 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 likeMy response
Run tests, lint or buildUsually approve.
Recursive delete or force git operationsStop and read carefully. Usually decline.
Installing a new packageAsk why it is needed and check the package.
Downloading and piping into a shellDecline.
Anything with secrets or environment variables printedDecline.

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