Skip to content

How to read a diff (the changes an AI wants to make)

A diff shows what an AI coding tool wants to change: red lines go, green lines come in. How to read one in a minute, and what to check before you say yes.

By Nick

1 min read

AI Basics Beginner
On this page

A diff is the list of changes a tool wants to make to your files, shown before and after. Claude Code, Codex and similar tools show you one before they change anything, and again when they’ve finished. Reading it is how you catch a mistake before it sticks.

What it looks like

  <h1>Welcome to Sam's Bakery</h1>
- <p>Open Monday to Friday, 9 to 5.</p>
+ <p>Open Monday to Saturday, 8 to 4.</p>
  • Red, with a minus: this line goes.
  • Green, with a plus: this line comes in.
  • No colour: unchanged, shown so you know where you are.

A line that was edited shows up as one red and one green, like the opening hours above.

What to check

You don’t need to understand every line. Check three things:

  1. The right files. Each file starts with its name. If you asked for a new opening time and it changed six files, ask why.
  2. Nothing important went red. A big block of red you didn’t ask for is the thing to stop.
  3. It matches what you asked. Read the green lines you can read. Words, numbers and dates are usually plain enough.

If anything looks off, say no and tell it what you saw. If it’s too long to check, ask it to explain the change in plain English, or to do it in smaller steps.

Work in a folder saved with Git, so even a change you accepted by mistake can be undone. Claude Code can also rewind its own recent edits.

Common questions

Do I need to understand code to read one?

Not every line. You're checking that it changed the files you expected and nothing else, and that nothing you care about turned red.

What if the diff is huge?

Ask it to explain the change in plain English first, then to split the work into smaller steps. A small diff is one you can actually check.

I accepted a bad change. Now what?

If you saved a copy with Git before it started, you can go back to it. That's the main reason to use Git with these tools.

Related reading

Last reviewed 14 October 2026 by Nick.

Software changes fast. If something here is out of date, tell me and I'll fix it.

Get new guides by email

Occasional and practical. No spam, no hype, unsubscribe whenever.

Occasional practical guides from UncomplicateAI. You will get a confirmation email before anything else is sent. Unsubscribe any time. Privacy

You are not subscribed until you confirm the email. Unsubscribe any time.