VS Code Extension v1.0.0 MIT

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.
Editor showing added lines in green and deleted lines in red, with orange Accept | Reject buttons above each change.
Added lines in green, deleted in red. Accept or reject each change.
Side panel in the Explorer listing four files with pending changes, next to a diff of checkout.ts.
Every file with pending changes, in one panel.
A file the agent deleted, shown in full red, with restore and accept buttons in the side panel.
Deleted files stay visible. Keep deleted or restore.

Install

  1. 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.vsix

    Cursor / Windsurf users: replace code with cursor or windsurf.

  2. 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).

  3. 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.

  4. 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 .vsix files.
  • 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 .vsix download 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.