SWE.for vibe coders
Lesson 2 of 411 min

Review what the AI wrote

You are the senior engineer now. Here's how to actually read a generated change.


Here’s the mindset shift that makes you good at this: when the AI writes code, you’re not the typist — you’re the reviewer. Your job is to read the change and decide whether it’s right. That sounds hard. It’s a skill, and it’s learnable.

Accepting code you didn’t read is the #1 mistake

The AI is confident. Its code looks clean. It’s usually right. All of that makes it easy to hit “accept” without looking — and that’s exactly how bugs and security holes slip in. A suggestion being well-formatted tells you nothing about whether it’s correct.

Read the diff, not the vibe

You already learned to read a diff in the last module. That’s your main tool here. Before accepting a change, scan it and ask three questions:

terminal
$git diff
@@ -12,7 +12,7 @@ function saveUser(user) {
-  db.save(user);
+  db.save(user);
+  sendMarketingEmail(user.email);
}

That diff was supposed to be a small fix — but it quietly added a sendMarketingEmail call. Reading the diff caught something you never asked for. That’s the whole point.

Check yourself

You asked the AI to 'fix the typo in the header.' The diff shows the typo fix AND a rewrite of an unrelated function. What should you do?

Ask “why,” not just “what”

When you don’t understand a piece of generated code, the AI is also your best tutor. Paste it back and ask: “Explain what this does and why.” You’ll learn faster than from any textbook, because you’re learning on your own real code.

Check yourself

What's the best reason to read AI-generated code even when it 'looks fine'?

Try it for real

Turn on your reviewer brain:

  1. Ask your AI tool for a small change in a real project.
  2. Before accepting, open the diff and answer the three questions: did it change more than I asked? Did it delete anything I need? Do I understand each part?
  3. Pick one line or block you’re unsure about and ask the AI to explain it.
  4. Only then accept (or reject) — and commit if you kept it.