plainweb

4 minute read

How to review what your AI agent changed

Commit your work in Git before the agent starts, then look at the diff when it finishes: run git diff in a terminal, or open the Source Control panel in VS Code to see every added and removed line. Keep what you understand, ask the agent to explain the rest, and undo anything wrong with git restore.

The loop

  1. git add -A and git commit -m "before agent". A save point.
  2. Let the agent work.
  3. git diff or the VS Code Source Control panel shows every change in red and green.
  4. Keep good changes with a new commit. Throw away bad ones with git restore .

What to look for

  • Files you did not expect it to touch. Ask why.
  • Deleted code. Agents sometimes remove things to make an error go away.
  • Secrets. Any key or password written into code.
  • Tests weakened or skipped to make them pass.
  • New packages added. Check that each is real and popular; fake look-alike packages exist.

Ask it to explain

“Explain each change you made and why, file by file” is one of the most useful prompts there is.

Related

Next