Dev.to AI 🤖 Ai 👁 0 📖 2 min read

Review AI Edits Like a PR: My Aider Git Routine (Undo Ladder Included)

The thing that made me comfortable letting an AI edit my code wasn’t a better model. It was knowing that every edit lands as a git commit I can read — and reverse. Here’s the exact routine I run with Aider, the open-sour

The thing that made me comfortable letting an AI edit my code wasn’t a better model. It was knowing that every edit lands as a git commit I can read — and reverse. Here’s the exact routine I run with Aider, the open-source terminal pair programmer.

Before the session

  • Commit or stash my own work first. Aider's auto-commits are only cleanly separable from my changes if my tree starts clean.
  • One config change: dirty-commits: false in .aider.conf.yml, so Aider never commits my uncommitted files for me before it starts editing.
  • One branch per task, named for the task. AI commits on a task branch are cheap to squash, rebase, or abandon wholesale — and Aider never works directly on my deployment branch.

During the session: the review routine

Every AI change, no exceptions:

  1. See the change, don't trust the summary. /diff shows what actually changed since the last message.
  2. Read hunks, not vibes. Especially deletions, changes to tests, and anything touching config, auth, or data handling.
  3. Run the tests myself at least once per session — even with auto-test on. Trust, but verify with my own hands.
  4. Skim the log afterwards: git log --oneline, and git show anything I didn't watch happen.

When it goes wrong: the undo ladder

Least to most drastic:

  1. /undo in chat — undoes the last commit if Aider made it. First resort for "that edit was wrong".
  2. git revert <hash> — for a later bad commit when earlier ones were fine. Safe and history-preserving, so it works on shared branches.
  3. git reset --hard <good-hash> — local-only history, destructive to everything after it. Only when I'm sure.
  4. Edited files in my editor mid-session? /commit commits those outside edits with a generated message, keeping the timeline coherent.

That's the whole system: clean tree in, diff review during, undo ladder in my pocket. The AI can be fast because the recovery is boring.

This routine is one chapter of a $10 pack I put together — the full Git safety guide, six workflow playbooks, a cost-control guide, and my templates (checklists, task brief, full .aider.conf.yml): https://whop.com/checkout/plan_Qnb9d21JZ7LEa

My previous post covered all six workflows: https://dev.to/workflownexus/6-repeatable-aider-workflows-and-the-git-routine-that-makes-them-safe-3ffl — and if Aider isn't installed yet, start with the free Starter Kit: https://whop.com/checkout/plan_diZ6ymgxjRMz2

How do you review AI-generated commits? Curious what other people's routines look like.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.