Verboo Code: how to see what the agent changed with /diff before you commit
Back to the blog
Articleverboo codetutorialdev toolshow toagente de programação

Verboo Code: how to see what the agent changed with /diff before you commit

MafraOctober 21, 20265 min read

The agent spent ten minutes editing your project and replied "done". Before you commit, you want to know exactly what changed, and ideally which of your prompts caused each change. The /diff command in Verboo Code shows both without leaving the session: everything uncommitted in the repository and, separately, what each turn of the conversation edited.

What does /diff do in Verboo Code?

It opens a dialog with your uncommitted changes, computed with git diff HEAD, plus one tab for each conversation turn in which the agent edited a file. You move through the file list and open each file's diff with added and removed lines in color, without opening another terminal.

How do you review the agent's changes, step by step?

Inside the session, type:

/diff

The dialog opens with the title Uncommitted changes (git diff HEAD) and a summary such as 4 files changed +87 -12. The file list sits below it. These are the keys:

KeyIn the file listInside a file
↑ / ↓Select a file(no effect)
EnterOpen the file's diff(no effect)
← / →Switch source: Current, T3, T2...← goes back to the list
EscClose the dialogBack to the list
Flowchart of /diff in Verboo Code: /diff opens Uncommitted changes, the Current source shows git diff HEAD, arrow keys and Enter open a file; left and right arrows switch to the per-turn diff T3, T2, T1, one per prompt you sent, Edit/Write edits only
/diff opens on Current, which is everything uncommitted. The left and right arrows switch to the diff of each conversation turn.

How do you see only what one specific prompt changed?

Use the ← and → arrows in the list. When any conversation turn edited a file, a selector shows up at the top, for example Current · T3 · T2 · T1, with the most recent turn first. Each turn starts at one of your messages, and the title shows the turn number and the start of your prompt, cut at 30 characters, like Turn 3 "add validation to the login f…".

That solves the classic case: the agent touched six files across three prompts and a test broke. Instead of reading the whole diff, you open T2 and see only what the second prompt changed. Turns with no file edits don't appear in the selector.

Gotcha: the per-turn diff only sees edits made by the file tools. It builds each turn from the results of the file edit and write tools (Edit and Write). If the agent changed a file through a terminal command, such as sed -i, npm run format, prettier --write or a code generator, that change does not show up in the turn. It shows up in Current, because git does the math there. When in doubt, compare the two:

# what git sees, regardless of how the file was edited
git diff HEAD --stat

If a file is in --stat and in no turn, it was changed by a command, not by the edit tool.

Why does /diff say "Working tree is clean" when I have changes?

Because Current shows that message whenever git returns no diff, not only when the repository is clean. Check these four cases before assuming the agent saved nothing:

SituationWhat /diff shows in CurrentWhat to do
Merge, rebase, cherry-pick or revert in progressWorking tree is clean, on purpose: those changes come from another branch, not from the agentFinish or abort the operation (git rebase --continue, git merge --abort) and open /diff again
Repository with no commits yetWorking tree is clean, because git diff HEAD fails without a HEADMake the first commit; until then use the turns (←/→)
Folder outside a git repositoryWorking tree is cleangit init, or review through the turns
Very large repository, git takes more than 5 secondsMay come back empty, because each git call has a 5 second limitRun git diff HEAD --stat straight in the terminal

What are the limits of /diff?

The dialog is built for quick review, not for giant diffs. The limits live in the CLI source:

CaseBehavior
More than 50 changed filesThe list shows only the first 50; the summary at the top keeps the real total
More than 500 changed filesShows only the totals and the message Too many files to display details
File with more than 400 changed linesMarked (truncated), with diff truncated (exceeded 400 line limit) at the end
A single file's diff above 1 MBLarge file - diff exceeds 1 MB limit
Binary fileBinary file - cannot display diff
New file, not tracked yetShows as (untracked), with no content and the hint Run `git add <file>` to see line counts.

New files ignored by .gitignore are left out of the list. To see a new file's content in Current, put it in the index, because git diff HEAD compares the last commit with what is on disk, staged or not:

git add src/new-module.ts

Close and reopen /diff: the dialog computes the diff when it opens, and the file then shows up with its added lines. In the per-turn diff the new file already shows up in full, because it comes straight from the write tool's result.

I found a wrong change in /diff. How do I undo it?

It depends on where it came from. If it was the last prompt, /rewind takes the conversation and the code back to before that turn. If it is a single file, git handles it without touching the conversation:

# discard the change to one tracked file
git restore src/auth/login.ts

If you want to try another approach without losing the current one, /branch forks the conversation before you ask for the alternative.

Reviewing turn by turn works best with small prompts: one prompt, one change, one T in the selector. On Verboo Code the plans run with unlimited tokens, so splitting a task into ten short prompts costs the same as sending it all at once.

Enjoyed this article?
Share knowledge with your network.
// Read also

Related articles