StoicBuilder

HandbookIV the PraetoriumReading a diff

IVthe Praetorium, Direct the agent

Reading a diff

1 min readUpdated 28 November

In plain words

A diff shows exactly what changed between two versions of your code: removed lines in red with a minus, added lines in green with a plus.

Where you see it

The review panel in Cursor, the changes Claude Code shows before it edits a file, or "Files changed" on a GitHub pull request. If your Lovable project syncs to GitHub, each change it makes appears there as a commit with its own diff.

git diffterminal
@@ src/lib/notes.ts @@ const { data } = await supabase .from("notes")- .select("*")- .eq("user_id", user.id);+ .select("*");
The removed .eq() line was the filter. Now the query asks for every user's notes, not only yours.

What goes wrong

  1. Reading only the green lines

    Added code is what you asked for. Removed code is where surprises hide: a deleted check, a dropped filter, a missing error message.

  2. Skipping the list of files

    Before reading any line, look at which files changed. A colour tweak that touched login and the database tells you most of the story already.

  3. Accepting every change unread

    Cursor and Claude Code can apply all edits in one go. For anything bigger than a small fix, scroll through first; it's faster than hunting the bug later.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
After each change, list every file you touched with one line on why, and flag anything you deleted or renamed so I can check it in the diff.

Quick check

Sign in to earn +10 XP for it

You asked for a new button label. The diff shows changes in Button.tsx, auth.ts and package.json. What does that tell you?

Got a prompt that touches reading a diff?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.