Universal Agent Diff
Review any AI agent's changes line by line. Accept or reject each one.
Latest .vsix from
GitHub Releases. Not on the Marketplace (why).
The simplest safeguard between an AI agent and your code. Modeled on the interactive diff review flow in Cursor and Google's Antigravity IDE: every change shows inline until you accept or reject it. It watches files on disk, so it works with any agent or script, from Claude Code to Codex to Copilot.
How Reviews Work
- Snapshot is taken just before an agent first changes a file (gitignored files and node_modules skipped; .env is always tracked).
- Accept makes that change the new baseline. Reject restores the old lines.
- Anything left pending stays pending, and further agent writes fold into it.
- If the agent later rewrites something you accepted or rejected, that's a new pending change. Nothing is accepted without you.
- Your own edits in a file with pending agent changes become pending too. Once everything in it is accepted or rejected, your edits are untracked again, like normal VS Code.
Features
- Added lines show green; deleted lines show as red blocks between the lines (long lines wrap).
- Accept or Reject buttons above every change. After either one, the cursor jumps to the next change.
- Brand-new files the agent creates get a third button, Delete (Reject empties the file, Delete removes it).
- Files the agent deletes show up as "deleted": see what was removed, then keep it deleted or restore it.
- Orange marks on the scrollbar show where every pending change is in the file.
- A side panel lists every file with pending changes, with a count badge; hover a file to Accept all / Reject all.
- Next / Previous Pending Change commands to step through everything.
- Restores by source control (discard, checkout) aren't mistaken for agent changes; they clear the review.
- Reviews survive restarts.
Install
-
Install the extension
Download universal-agent-diff.vsix. In VS Code: Extensions view → ··· menu → Install from VSIX… → pick the file.
Or from a terminal:
curl -L -o universal-agent-diff.vsix https://github.com/mattsessa/universal-agent-diff/releases/latest/download/universal-agent-diff.vsix code --install-extension universal-agent-diff.vsixCursor / Windsurf users: replace
codewithcursororwindsurf. -
Enable the proposed API (one-time)
Command Palette → Preferences: Configure Runtime Arguments, then add this line inside the outer
{ }:"enable-proposed-api": ["mattsessa.universal-agent-diff"]Put a comma after the previous line. If an
"enable-proposed-api"line already exists, add the ID to that list instead. Then fully quit and restart VS Code (a window reload isn't enough). -
Turn off your agent's review buttons (recommended)
If your agent has its own inline diff, change review, or CodeLens buttons, turn them off in its settings. Otherwise you get two sets of buttons.
Keep VS Code's own CodeLens on (
editor.codeLens). Accept / Reject are CodeLens buttons. -
Make Accept / Reject stand out (optional)
Command Palette → Preferences: Open User Settings (JSON), then add:
"editor.codeLensFontSize": 14, "workbench.colorCustomizations": { "editorCodeLens.foreground": "#ff8c00" }
Updating: download the new .vsix and install it the same
way.
Requirements & Caveats
-
VS Code 1.144+. Also works in VS Code forks such as Cursor or Windsurf that can
install
.vsixfiles. - The open folder must be a Git repository. The extension uses Git to know what files looked like before the agent changed them.
-
It is not on the VS Code Marketplace. The red deleted-line blocks use
a VS Code "proposed API", which the Marketplace doesn't allow, so it's distributed as
a
.vsixdownload from GitHub instead. - Without the one-time opt-in setting (install step 2) it still works, but deleted lines show as a thin red line with the old text on hover instead of full red blocks.