Make the agent prove it: checks, evidence and review
An AI agent stops when the work looks done. Give it a check that passes or fails (a test, a build, a screenshot), ask for evidence, and get a fresh reviewer, so 'done' really means done.
By Shakir Sajad & Claude (AI by Anthropic) · 2 min read · Updated 2026-11-19
Step 08 of the agentic coding learning path.
The problem
Anthropic's best practices put it plainly: Claude stops when the work looks done. If it has nothing to run, "looks done" is all it has, and you become the test suite. Every mistake waits until you happen to notice it.
Give it something that comes back pass or fail, and it can close the loop itself: change, run the check, read the error, fix, run again.
What counts as a check
- A test file
- A build's exit code (
npm run build) - A linter
- A script that compares output with a known-good copy
- A browser screenshot next to the mockup
If your project has one of these, the docs call its command the single most useful line in your CLAUDE.md. See CLAUDE.md and AGENTS.md.
Put it in the prompt
The easiest way, with no setup: say it in "Done when".
{task}
Done when: npm run build passes and {the page / the test} shows {expected result}. Keep going until it does. Then show me the exact command you ran and its output.Ask for evidence
"All tests pass" on its own tells you very little. Ask for:
- The command it ran and the output
- A screenshot for anything visual
- What it didn't check, and why
Reading output is faster than re-running the check yourself.
Get a fresh reviewer
The agent that wrote the code believes its own reasoning. A fresh one doesn't. In Claude Code, /code-review reviews your changes in a new subagent that never saw your conversation. Or write the review prompt yourself:
use a subagent to review the diff against SPEC.md, check every requirement is implemented and the listed edge cases have tests, report gaps that affect correctness and skip styleKeep the skip style part. The docs warn that a reviewer asked to find problems always finds something, and fixing every nitpick adds layers you don't need.
Make it a hard rule (optional)
A prompt line works most of the time, not every time. When a check must always pass before a task ends, Claude Code can enforce it with a Stop hook: a script that runs when Claude tries to finish and sends it back to work if the check fails. That's the "Rules that can't break" step in the learning path.
Check it yourself, too
Before anything goes live, use it like a customer would. On this site, every change gets a build check by the agent, then I open the page on my phone. Some problems, like spacing that looks wrong, only a person notices.
What's next
Keep sessions lean and cheap: context, tokens and cost.
Do this now
- Find your project's check command npm run build, npm test, a lint. Ask the agent if you don't know it. (5 min)
- Put that command in CLAUDE.md or AGENTS.md The single most useful line in the file, per Anthropic's docs. (5 min)
- Add 'Done when' to your next prompt Say which check must pass, and ask to see the output. (5 min)
- Ask for evidence, not a summary "Show me the command you ran and its output." (5 min)
- Get one fresh review Run /code-review or ask a subagent to review the diff against your spec. Skip style. (15 min)
Frequently asked questions
Why does the agent say it's done when it isn't?
It stops when the work looks done. Without something to run that says pass or fail, 'looks done' is all it has. Give it a check and it can close the loop itself.
What counts as a check?
Anything with a result it can read: a test file, a build's exit code, a linter, a script that compares output, or a browser screenshot next to the mockup.
I'm not technical. How do I check?
Ask the agent to run the build and show you the output, then try the feature yourself on your phone and laptop. Your own eyes on the real thing are a check too.
Should I fix everything a reviewer finds?
No. A reviewer asked to find problems always finds something. Anthropic's docs suggest asking it to skip style and only report gaps that affect correctness.