cd /news/ai-agents/5-mistakes-ai-coding-agents-make-and… · home › topics › ai-agents › article
[ARTICLE · art-173926] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

5 mistakes AI coding agents make, and how to catch them before merge

A developer published a pre-merge checklist for reviewing AI-generated code, cataloguing five recurring failure modes: calls to nonexistent functions or packages, swallowed errors, assertion-free or mock-only tests, unverified test-run claims, and refactors that quietly change behavior. The guidance recommends searching for every unfamiliar call, requiring real assertions on observable behavior, rerunning test commands personally, and splitting behavior changes into separate commits. A 12-point filter and a Claude Code code-reviewer subagent are offered free on GitHub.

recommendation

Rerun the test command yourself and read the output on every AI-written diff, and rewrite any test that only checks a mock was called.

more in playbook: Working with AI coding agents
read2 min views4 publishedNov 21, 2026

AI coding agents write code fast. They also make the same handful of mistakes over and over. None of them are exotic, which is exactly why they slip through review: the diff looks plausible, the summary sounds confident, and the reviewer is busy.

Here's what to check every AI-assisted diff for before it merges.

How to spot it: calls to functions, methods, flags or packages that don't exist in the versions you actually depend on. The name is usually reasonable, which is the problem.

What to do: search the codebase and the library's docs for every unfamiliar call. Delete or replace anything you can't find. If the tests "pass," check that they actually execute that line.

How to spot it: empty catch blocks, except: pass, or an error that's logged and then ignored so the function carries on with bad state.

What to do: handle the error, rethrow it, or write a comment explaining why ignoring it is safe. "It made the test pass" isn't a reason.

How to spot it: tests with no assertions, tests that only check a mock was called, or tests that mirror the implementation line by line so they can never fail.

What to do: rewrite them to assert behavior someone outside the function would notice: the return value, the saved record, the HTTP response.

How to spot it: "All tests pass" or "Fixed the bug," with no command output shown.

What to do: run the command yourself and read the output. Every time. An agent's summary of a test run isn't a test run.

How to spot it: a diff labeled as a refactor that also changes defaults, error messages, log lines or the order things happen in.

What to do: move behavior changes into their own commit, with a test that shows the new behavior on purpose.

Before merging, ask:

Would I be comfortable defending this diff in review if I had written every line myself?

If not, it isn't ready, no matter who or what wrote it. A checklist only helps if it's used on every diff, not just the ones that look suspicious. Two things that help:

The full 12-point slop filter, the pre-merge checklist and a ready-to-use code-reviewer subagent for Claude Code are free on GitHub: lean-team-products/ai-code-review-gates. Copy them into your repo and you're set up in two minutes.

Originally published on the Lean Team blog. Free download: the Codebase Antipattern Checklist, 48 signs a codebase is getting harder to change.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/5-mistakes-ai-coding…] indexed:0 read:2min 2026-11-21 · —