Reviewing the agent's changes

Cursor · Essentials · 10 min

Reviewing is now your main job; skipping it is how plausible-looking bugs ship.

When Agent edits files, Cursor shows the changes as diffs: the old lines in red and new lines in green, grouped per file. Treat them like a pull request from a fast but sometimes careless colleague.

A simple review routine:

  • Scan the file list first. Did it touch files you didn't expect, such as config, lock files or tests it "fixed" by weakening them?
  • Read each change. Does the logic match what you asked? Are error cases handled? Did it invent a function or library option that doesn't exist? Models can do that confidently.
  • Run the checks. Ask Agent "run the tests, the type checker and the linter and show me the output", or run them yourself. A diff that looks right but fails tests is not done.
  • Use git as your record. git status and git diff show exactly what changed on disk, including anything a terminal command modified, and committing in small steps gives you safe points to return to.

Cursor can also help review. Agent Review runs a dedicated AI review of your local changes: type /agent-review in the agent input, run it from the Source Control tab to compare everything against your main branch, or enable it to run automatically. It offers a quick, cheap pass and a deeper, slower one for risky code, and it reads repository review rules from BUGBOT.md files. Treat its findings as suggestions, not proof of correctness.

If a change is wrong, say what is wrong and let Agent fix it, or roll it back (next lesson) and retry with a sharper prompt.

Example

# after Agent finishes
git status            # which files changed (including via terminal commands)
git diff              # exact line changes
npm test && npx tsc --noEmit && npm run lint    # your project's checks

# in the Agent input
/agent-review         # AI review of local changes (quick or deep)

git add -p            # stage only the hunks you've reviewed
git commit -m "Validate empty email on signup"

Remember

  • Check which files changed before reading line by line
  • Run tests, type checks and linters; a good-looking diff isn't proof
  • Agent Review (/agent-review) adds an AI second opinion; git is the record

Watch out for

  • Accepting changes where the agent made a failing test pass by editing the test's expectations.

Check yourself

  1. The diff looks right. What should you do before committing?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: cursor.com/docs/agent/agent-review