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
git add -Aandgit commit -m "before agent". A save point.- Let the agent work.
git diffor the VS Code Source Control panel shows every change in red and green.- 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.