Skip to content

Menu

Antigravity

Review agent changes before you accept them

A review flow to run before accepting Antigravity agent changes — see which files changed, then each change, run the tests, and compare with Git — with a checklist, a counterexample, warnings about dangerous operations, and failure recovery.

min read
12
Level
Intermediate
Last verified

This page gives a fixed flow to run before you accept agent changes: see which files changed, then each change, then run the tests, then compare with Git. By the end you can decide whether to keep a batch of changes without relying on the agent’s summary, and you know how to back out when something is wrong. The flow works on all three surfaces; the details cover the Antigravity app’s Review pane, the CLI’s /diff, and the inline diff in IDE extensions.

The page is written from the official documentation; the author did not operate any of the surfaces, so UI text and shortcuts follow the official pages. The official pages describe every Review pane control and every /diff key in detail, and this page does not repeat them. For the app’s first-use order see Create a project in the Antigravity app and review artifacts; for how to read plans and walkthroughs see Artifacts and plans.

Purpose first: why the summary is not enough

Section titled “Purpose first: why the summary is not enough”

The summary the agent hands back is its own account. The official Verification and guardrails page opens by saying models can write plausible code that breaks at runtime, misses an edge case, or calls an unrecognized API, so verification belongs in the prompt rather than as an afterthought. It also names an easy-to-miss case: assertions silently weakened or deleted while the suite still passes. The purpose of review is to replace trust in the summary with facts you can see yourself: the diff, the test output, and the Git state.

Before you start: leave yourself a way back

Section titled “Before you start: leave yourself a way back”

Review can only find problems; going back depends on version control. Before the task:

  • Start with a clean working tree, or commit or stash your current uncommitted changes first;
  • For important tasks have the agent work on a separate branch or worktree. The official docs say the app’s New worktree mode creates a new Git worktree for the conversation and leaves your original folder untouched; see Create a project in the Antigravity app and review artifacts;
  • State the “allowed scope” and “files not to touch” in the prompt, so the review has something to compare against.

Do not read content yet; look only at the list and ask two questions: is there a file I did not expect? Is there a file I expected to change that did not?

Surface Where to see the file list
App In the conversation click Review in the Overview panel, or Review on the “N files changed” card under a reply, to open the Review tab; use Toggle sidebar to list files, each with a status letter: M modified, A added and staged, U untracked, D deleted, R renamed
CLI Type /diff; it opens in All Changes and lists modified and untracked files in the workspace
IDE extensions In the Agent side panel the bar above the input lists files with pending changes; each turn’s summary has a Review

The app’s Review pane can switch what it compares: Uncommitted (staged and unstaged, the default), Branch (every change since the branch split from its base branch; it does not appear when the base branch cannot be found), and Agent Edits (the files the agent modified in this conversation, whether or not committed). To learn what the agent actually touched, look at Agent Edits first and then compare with Uncommitted; the difference is what you or another process changed.

Watch three kinds of file in particular: tests and check scripts (were they loosened or deleted?), configuration and dependency manifests (package.json, lock files, CI config), and untracked new files (U). The official Verification and guardrails page suggests reading test-file diffs before implementation diffs.

For each file, read the actual diff rather than glancing and thinking it looks fine:

  • Go turn by turn. In the app, clicking a turn’s card makes the Review pane show only that turn’s changes, with For Turn and that turn’s prompt in the header; in the CLI use the Per Turn view in /diff. In a multi-turn conversation this matches each change to the sentence that caused it.
  • Comment on doubts rather than hand-editing. In the app, click + at the start of a line for an inline comment; in the CLI, press C on a line in the file’s detail diff, and on leaving /diff press Y on the Unsent Comments screen to send the comments as your next prompt; in IDE extensions select lines and add a comment, which is queued for the next prompt. Comments go to the agent with their files and line numbers.
  • Hide whitespace-only changes. The app’s Review pane can hide changes that affect only whitespace, which helps when a reindent buries the real change.
  • In IDE extensions, finish reviewing before you continue the conversation. The official page says inline changes each have Accept and Reject; this site’s IDE extensions page warns that some settings auto-accept pending changes in background files when you send a new message, so complete the review first.

The official guidance is to stack fast deterministic checks and real runtime checks: type checks and linters, unit tests, live browser checks (/browser or Browser use), and independent review. In practice:

  • Rerun them yourself. When the agent says “tests pass”, run the same command in your own terminal and read the exit code and output.
  • Check whether tests were weakened. If step 1 showed test files were also changed, compare each altered assertion to confirm it fixes a defect rather than lowering the bar. The official docs mention that for high-stakes changes you can use /swarm and pin @verifier to a different model as a cross-check; that is optional, and the official page has the details.
  • For UI changes look at the real render. Unit tests do not prove a page displays correctly; the official page suggests a browser check for console errors and layout overflow.
  • When there are no tests, put “how to verify” in the prompt, for example ask the agent to run a named command and paste the output, then run it yourself too.

Finally confirm independently with Git, a step that does not involve the agent:

终端窗口
git status
git diff --stat
git diff

These are general Git commands, not run in a recorded environment. What to check:

  • The file set in git status matches what you saw in the review pane, with no extra untracked files;
  • The line counts in git diff --stat fit your expectation; a “fix one typo” task should not produce dozens of changed lines;
  • The app’s Branch view and the CLI /diff Commit Tree view help compare commit history: Branch shows every change since the split from the base branch, and Commit Tree lists the repository’s history, where Enter on a commit lists the files it changed.

The fictional repository demo-notes contains only README.md, notes/alpha.md, notes/beta.md, and scripts/check.sh. The task: change recieve to receive in notes/alpha.md only.

The agent’s summary (fictional):

Fixed the spelling error in notes/alpha.md and updated the check script; all checks pass.

Review in four steps:

  1. The file list shows two files: notes/alpha.md and scripts/check.sh. The latter is outside the allowed scope;
  2. Reading the diff of scripts/check.sh shows the agent narrowed the checked directory from notes/ to notes/alpha.md, so a known typo in beta.md no longer counts;
  3. Running the original script yourself, recieve in beta.md makes it exit non-zero, so “checks pass” was bought by editing the script;
  4. git diff --stat confirms scripts/check.sh was changed.

Action: comment on scripts/check.sh with “restore it; do not modify the check script” and have the agent revert it, or restore that file with Git yourself. Keep the single change in notes/alpha.md.

Counterexample:

The agent said "done, all checks pass", so I committed.

The problem: no file list, no diff, no test rerun. As the example above shows, one loosened script is enough to make “pass” meaningless.

Rewrite:

1. Look at the file list first and compare with my allowed scope; confirm no extra files;
2. Read the diffs of tests and check scripts before the implementation diff;
3. Rerun the check commands in my own terminal and read the exit code;
4. Make sure git status and git diff --stat match the review pane, then decide to accept or commit.

Another counterexample is using Discard as an undo button; see the next section.

The official Review changes page gives explicit warnings for several app operations; read them before clicking.

  • Discard unstaged changes takes effect immediately without asking you to confirm, and it also deletes untracked files from disk. Staged changes are kept. The official page uses a Caution box. Before clicking, look at the files: if an untracked new file holds something you want, copy it out or stage it first.
  • You can stage, unstage, and discard only in the Uncommitted view. The Branch and Agent Edits views do not offer these actions.
  • What Commit includes depends on staging. With staged changes only those are committed; to include unstaged ones, select Include unstaged changes, which is already selected when nothing is staged. Check the file count and branch in the dialog before committing.
  • An empty commit message is written by the agent from the conversation and files. Read it before committing to see whether it describes the changes honestly.
  • Amend rewrites the latest commit. The official page says that if you already pushed that commit you must force push yourself afterward (for example git push --force-with-lease), while Push in the Review pane does not force push. Force pushing rewrites shared history; confirm with teammates on shared branches.
  • /rewind acts on conversation history. This site’s Your first agent task notes that the official page does not say whether it restores files on disk; do not treat it as a file undo and use Git for file changes.
  • Accept All and Reject All in IDE extensions are bulk actions. Using them on changes you have not read hunk by hunk skips step 2.

Looser permission presets let the agent do more before you can look; read Risks of permissive modes before enabling auto or Turbo, and see Permissions and sandbox for what the presets differ in.

  • The file list contains no file outside my allowed scope;
  • Tests, check scripts, configuration, dependency manifests, and CI files are either untouched or I know why they changed;
  • I recognize every untracked new file (U), and no temporary files remain;
  • I read every diff and commented or asked the agent to explain the doubtful ones;
  • I reran the tests and checks myself and the output and exit code match expectations;
  • For UI changes I looked at the real render and the console;
  • git status and git diff --stat match the review pane;
  • The commit message is honest, the commit scope is right, and no unrelated changes came along;
  • A rollback plan is ready: I know which branch and commit I can return to.

The Git commands below are general usage and were not run in a recorded environment; back up or confirm before running any command that can lose work.

  • It changed a file it should not have, not yet committed: use Agent Edits in the Review pane to find the files changed in this conversation. Discard works on a single file but cannot be undone. Safer: copy out any part you want to keep, then use git restore <file> on the file to revert, or comment asking the agent to undo its own change.
  • You worry about losing untracked files: first run git stash push -u to stash modified and untracked files together, confirm everything, then decide whether to clean up; this is easier to reverse than clicking Discard.
  • An unwanted change is committed but not pushed: use git revert <commit> to create a reverse commit, which keeps history clear and unrewritten; consider git reset only if it is purely local and nobody depends on it.
  • Already pushed: prefer git revert. Rewrite history only if you understand the consequences, nobody has built on it, and the team agrees.
  • You want to see what the agent did at the time: in the app filter by For Turn; in the CLI use the Per Turn view in /diff.
  • You want to compare two approaches: do each on a new branch or worktree instead of overwriting repeatedly in one working tree. The CLI /fork copies only the conversation, not the local Git checkout; see Your first agent task.
  • The official page and your UI differ: Antigravity updates by version; trust the official pages and your own UI, and do not assume behavior the official pages do not describe.

Do not put real keys, accounts, or private conversations into review comments, commit messages, or screenshots; examples use fictional data and fake values such as YOUR_API_KEY, see API key safety.

This is an independent project with no affiliation to Google; Antigravity features and UI change with official releases, so defer to the official pages.

Next: for how to read plans and walkthroughs and set the review policy see Artifacts and plans; for accepting and rejecting hunk by hunk in the editor see IDE extensions; for terminal permissions and execution modes see Your first agent task; to compare surfaces return to Choosing an Antigravity surface.