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:
- Did it change more than I asked? If you asked to fix a button and it also “helpfully” rewrote your database code, that’s a red flag.
- Did it delete anything I need? Watch the red
-lines. AI sometimes removes code it didn’t understand. - Do I roughly understand what each part does? You don’t need to grasp every line, but if a whole section is a mystery, ask the AI to explain it before accepting.
$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.
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.
What's the best reason to read AI-generated code even when it 'looks fine'?
Try it for real
Turn on your reviewer brain:
- Ask your AI tool for a small change in a real project.
- 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?
- Pick one line or block you’re unsure about and ask the AI to explain it.
- Only then accept (or reject) — and commit if you kept it.