brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: end a Claude prompt with what to verify before it finishes

Claude
~/tips/tip-claude-self-check-criteria

Before you finish, verify your answer against these cases:

Asks Claude to check its answer against criteria you name, which catches mistakes in code and math.

Asking Claude to “double-check” is vague. Telling it what to check against works better.

Write a function that converts a duration like "1h30m" to seconds.
Before you finish, verify your answer against these cases:
"45s" gives 45, "2m" gives 120, "1h30m" gives 5400, and "" raises an error.

Anthropic’s prompting guide lists this as a way to get better results: append something like “Before you finish, verify your answer against [test criteria]”. The guide says it catches errors reliably, especially in coding and math. Concrete cases are the key. Claude walks through them and fixes the function when one fails, before you even see it.

I think it doubles as a spec. Writing down four test cases makes you think about the edge cases too, like the empty string, which is easy to forget otherwise.

The guide also names an exception. Claude Opus 5 already verifies its own work well, and on that model such instructions can cause over-verification: more tokens and more waiting for no gain. The advice there is to remove the instruction. So if you use a model picker, this is a prompt habit for the other models.

A self-check is still Claude checking Claude. For code that matters, run the real tests.

Further reading: Prompting best practices: thinking and reasoning

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link