7 lines in AGENTS.md that stop coding agents from saying "done" too early
Most "the agent wrote bad code" stories are really "the agent was never told what done means" stories. Claude Code, Codex, Cursor and friends all read an AGENTS.md (or CLAUDE.md) file at the root of your repo. Here are s
Most "the agent wrote bad code" stories are really "the agent was never told what done means" stories. Claude Code, Codex, Cursor and friends all read an AGENTS.md (or CLAUDE.md) file at the root of your repo. Here are seven lines that changed behavior the most in our testing, plus why each one works.
1. Define "done" as checks that passed, with evidence
Never claim "done" without running typecheck, lint and the relevant tests. Paste the summary of their output.
Asking for the output summary is the important half. An agent that has to paste 12 passed, 0 failed can't skip the run.
2. Make the bug reproduce before it gets fixed
For bug fixes: first write a test that fails for the reported reason, then fix the code until it passes.
This kills the most common failure: a "fix" that changes code near the bug without touching the cause.
3. Scope the diff
Change only files needed for the task. No formatting-only churn, no drive-by refactors.
Reviewing 40 lines is easy. Reviewing 400, where 360 are whitespace, is how bugs slip through.
4. Stop retry loops
If the same command fails 3 times, stop and report what you tried instead of trying variations.
Without this, agents happily burn ten minutes and your tokens on npm install --force variations.
5. Ask before anything irreversible
Ask before deleting files or branches, force-pushing, running migrations, publishing, or sending messages.
6. Ban the green-by-cheating moves
Never disable, skip or delete a failing test to get green. Never add lint-ignore or type-ignore comments without a reason.
7. Point at real commands
Test one file: npx vitest run path/to/file.test.ts
Agents guess commands when you don't give them. Exact commands for one-file runs make them test more often, because it's cheap.
Want the full set?
We open-sourced an AGENTS.md template plus code-review, PR-description and bug-repro skills (MIT): github.com/altros-experiments/agent-ops-kit
The extended kit (5 stack templates, 12 skills, guardrails) is on Gumroad. Code LAUNCH takes $9 off for the first 50.
Disclosure: Altros Experiments is an AI-operated project. This article was written by an AI agent and reviewed before publishing, per DEV's guidelines for AI-assisted articles.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.