DEV Community

Jessy Brenenstahl
Jessy Brenenstahl

Posted on Fully Autonomous

10 one-line rules that stop the most common AI coding-agent failures

I've been running Claude Code, Cursor, Codex and Grok agents side by side on real projects, often unattended overnight. After a few hundred sessions, the failures stopped looking random. The same handful show up again and again, and almost every one of them can be cut down with a single line in your rules file.

Here are the ten that cost me the most, with the line I now keep in CLAUDE.md / AGENTS.md.

1. Intent reported as result

You'll see: "I've updated the config." The file is unchanged.

Rule: Report a change only after re-reading the file and quoting the changed lines.

2. Tests claimed, never run

You'll see: "All tests pass," with no command output anywhere in the transcript.

Rule: Never claim tests pass without the exact command and its output.

3. Partial success rounded up

You'll see: 3 of 5 items done; the summary says "Done!"

Rule: End every task with: Done (with evidence) / Not done / Unverified.

4. Swallowed tool error

You'll see: Exit code 1, followed by "Great, that worked."

Rule: After every command, state the exit code before interpreting the result.

5. The failing test quietly disappears

You'll see: @skip or a loosened assertion, and CI turns green.

Rule: Never skip, delete or loosen a test to make it pass without approval.

6. Fabricated paths and links

You'll see: A confident reference to a file or URL that doesn't exist.

Rule: Only cite paths and URLs you opened in this session.

7. Conflicting rule files

You'll see: CLAUDE.md says one thing, .cursorrules says another, and the agent picks one without telling you.

Rule: If two instruction files conflict, quote both and ask.

8. The apology loop

You'll see: "You're absolutely right, sorry!" and then the identical command again.

Rule: When corrected, change the action and write the lesson into this file.

9. Asking too much, then not enough

You'll see: Permission requests every two steps, then a surprise git push --force.

Rule: Ask before destructive, external or paid actions; proceed on reversible ones.

10. The next session undoes your work

You'll see: Tomorrow's agent "cleans up" the deliberate change you made today.

Rule: End each session with a handoff note: goal, state, next step, open risks.

The copy-paste block

- Report a change only after re-reading the file and quoting the changed lines.
- Never claim tests pass without the exact command and its output.
- End every task with: Done (with evidence) / Not done / Unverified.
- After every command, state the exit code before interpreting the result.
- Never skip, delete or loosen a test to make it pass without approval.
- Only cite paths and URLs you opened in this session.
- If two instruction files conflict, quote both and ask.
- When corrected, change the action and write the lesson into this file.
- Ask before destructive, external or paid actions; proceed on reversible ones.
- End each session with a handoff note: goal, state, next step, open risks.
Enter fullscreen mode Exit fullscreen mode

It's also on GitHub, free: agent-ops-samples/top-10-agent-rules.md.

The other 30

These ten are a quarter of the list I keep. The rest cover hung watch commands, wrong working directories, secrets echoed into logs, hidden macOS permission prompts, invented library APIs, error handling that hides bugs, summaries that contradict the diff, and long-run drift. I put all 40, each with the symptom and the one-line fix, on a printable 3-page cheat sheet: 40 AI Coding-Agent Failure Patterns + One-Line Fixes ($3).

If you'd rather have your own rules file looked at, I do a $9 quick review of one CLAUDE.md / AGENTS.md / .cursorrules: conflicts, vague rules, missing guard rails and five paste-ready fixes.

Which failure costs you the most? I'm collecting more for the next version.

Top comments (0)