AI coding agents are fast, and confidently wrong about 1 in 5 times. They ignore your conventions, "fix" a failing test by deleting it, and quietly refactor things you never asked about.
The fix is not a better model. It is a system. Here is the checklist I run before any agent-written code hits main, plus the red flags I watch for in the agent's output.
Pre-merge checklist (for agent-written code)
- [ ] I read the whole diff, not just the summary
- [ ] No files changed that I did not expect (
git diff --stat) - [ ] Tests cover the behaviour, and would fail if the code were wrong
- [ ] No test deleted, skipped, or loosened
- [ ] Lint, types, build pass (output seen, not claimed)
- [ ] No new dependency, or it is justified
- [ ] Errors handled; no swallowed exceptions; no silent fallbacks
- [ ] Input validated at the boundary; no secrets or PII in code, logs or fixtures
- [ ] No dead code, debug prints, commented-out blocks, stray TODOs
- [ ] Migrations and config changes reviewed by a human
Red flags in agent output
| Red flag | What it usually means | Do this |
|---|---|---|
| "This should work" | It did not run it | Ask for the command output |
| Test changed in the same diff as the code, to pass | Behaviour changed or bug hidden | Revert test, re-check |
| Huge diff for a small ask | Scope creep or reformatting | Re-prompt, tighter scope |
| New helper that duplicates an existing one | Did not search | "Search for existing utilities first" |
| Catch-all try/except | Masks failures | Require specific errors |
| Confident claim about a file it did not open | Hallucination | "Cite file:line" |
| Same failing fix repeated | Stuck loop | Stop and reset context |
The single highest-value habit
Keep a short rules file (CLAUDE.md / AGENTS.md / .cursorrules) and add a "Known traps" line every time the agent makes the same mistake twice. That one section compounds more than any prompt trick.
I put the full universal rules file plus this checklist in a free gist here:
https://gist.github.com/luccasbeckreistakehometest/b0095f5ef7ba7935bd5c305a4f7075b6
And I packaged the whole system I use, a drop-in rules file with 6 stack blocks, 42 prompts (understand to ship), 5 workflows and 4 checklists, into a kit if it saves you time:
https://luccasbreis.gumroad.com/l/bvhxerp
What is on your pre-merge checklist for agent code? Curious what I am missing.
Top comments (0)