It usually works
That is the frustrating part. AI-generated code often runs. It passes the demo. It may even pass a shallow test suite. The failure is not always a crash; it is a quiet mismatch between what the code appears to do and what it actually does when a request fails, a user is missing a permission, or two operations need to happen together.
“Slop code” is not a comment on the model. It is a description of the result: plausible code that has not been read closely enough for the confidence placed in it.
Six shapes worth recognising
1. Swallowed errors
The most common shape. A generated function wraps a request in try/catch, then returns a default value in the catch block. The UI shows an empty list, a zero balance, or a successful-looking state. Nothing alerts. Nobody notices until a customer asks why their data disappeared.
try {
return await loadOrders(userId);
} catch (e) {
// ignore for now
return [];
}
2. Invented behaviour
Generated code can call methods that sound right but do not exist in your version of the library. It can reference props that were never passed, or assume an endpoint returns a shape it does not. TypeScript helps only where the boundary is actually typed; any at the edge removes the help.
3. Duplicated rules
Ask for a feature in two places and you may get two implementations with slightly different filters. Each looks reasonable in isolation. Together they produce a dashboard that disagrees with itself.
4. Placeholder values that ship
Test keys, localhost URLs, dummy emails and changeme strings are useful in a draft. They are not useful in production. Generated snippets are especially prone to leaving a plausible-looking placeholder behind because the model does not know which environment the code will run in.
5. Dead branches and confident comments
A branch that can never run, a check that duplicates the framework's check, a comment that describes the previous version of the function. None of these break the build. They make the next change harder and the next reader less certain.
6. Boundary blindness
Generated code is good at the happy path inside one function. It is less reliable at the boundaries: authorization, retries, idempotency, timeouts, and what happens when two systems disagree. Those are exactly the places where incidents live.
How to read it without rewriting it
- Start at the failure path. Find every catch, every fallback, every early return. Ask what the user sees when the call fails.
- Check the boundaries. Who is allowed to call this? What happens on a retry? Is the operation idempotent? Where does untrusted input enter?
- Read the diff, not the final file. Generated additions are easier to judge when you can see what changed and what assumptions came with it.
- Run it against a hostile case. An expired session, a missing row, a slow network, a duplicate submission. The demo will not show you these.
- Remove what you cannot justify. Dead branches, speculative abstractions and unused helpers are not neutral; they are future confusion.
The compiler checks types. It does not check whether the error path is honest, whether the retry is safe, or whether the user can see someone else's data.
What a slop-code review covers
A focused review reads the generated parts as code, not as output: error handling, boundary conditions, duplicated logic, placeholder values, dependency choices and the assumptions baked into comments. It is not a style audit and it is not a rewrite. The goal is to find the places where the code is more confident than it has earned the right to be.
If you want to run a first pass yourself, the slop-code smell detector flags several of the shapes above. Treat it as a reading list, not a verdict.
Want this read for you?
Appmint reviews shipped apps, code and AI-generated features. Tell us what you're building and we'll suggest the smallest useful next step.
Start a review