Why AI Code Fails (and Where to Always Look First)
Use in this lesson
First five checklist skillOpenFirst Five
AI-generated code has a specific problem: it looks right. The syntax is clean, the naming is reasonable, and it runs without errors on the first try. This makes it dangerously easy to trust.
Before we can start our code review workflow, we need to know the patterns to identify, communicate and fix. Once you know the patterns, you'll spot them in seconds. In this lesson, you'll learn the First Five checklist, five places where AI code consistently goes wrong, and the five things you should check before reading anything else in a diff:
- Error handling. For example, AI wraps things in try/catch and does nothing in the catch block. The code doesn't crash, but nothing happens, the user gets a blank screen or stale data… and there's nothing in the logs.
- Input boundaries. AI writes for the happy path. It doesn't think about what happens when an array is empty, the user submits the form twice, the input is null, or someone pastes 50,000 characters into a text field.
- External or API calls. AI will confidently call a method that doesn't exist in your library version, or pass parameters in an order no documentation has ever described.
- State mutations. AI modifies shared data without considering what else depends on it. A change that looks scoped to one feature breaks another.
- Assumed dependencies. AI imports files that were never created, reads environment variables that were never set, and calls helper functions that don't exist anywhere in your codebase.
These five checks take 2–3 minutes, they catch the most common issues AI introduces, and they become the starting point for every code review you do from this point forward.