What problem does done-check solve?
AI coding agents say "done" before they check. They edit a file, read it back, and report the bug as fixed, while the test suite was never run after the change. You find out later, usually in review or in production.
done-check closes that gap with one rule: after the last code edit, a passing test run must exist before the agent may say it is done. If it does not, the agent is sent back once, with the exact command to run. It is a plugin for Claude Code, free and open source at github.com/kilazi/done-check.
How does it work?
done-check is a Claude Code Stop hook: Claude Code runs it every time the agent tries to end its turn. The hook reads the session transcript and asks four questions.
- Does the final message claim success? Words like done, fixed, works, passing, all set, ready to merge. It also knows Spanish, Japanese and Chinese claims, and ignores negations like "not fixed yet".
- Did the agent edit code in this repo? Edits through Edit, Write, MultiEdit and NotebookEdit count, and so do shell writes like
>,teeandsed -i. Docs (Markdown, LICENSE, CHANGELOG,docs/) do not. - What is this repo's test command? It looks for one in this order: a
verify:line in AGENTS.md or a.done-checkfile, then thetestorbuildscript in package.json (npm, pnpm, yarn or bun, from the lockfile),make test, pytest,cargo test,go test ./...,just test,deno task test,mix testand rspec. - Did that command run and pass after the last edit? Exit codes are trusted, except when the run was piped (
npm test | tail), masked with|| trueor followed by another command. Then the output is read for failure markers instead.
If the answer to the last question is no, the hook blocks the stop once and tells the agent what to run. The agent runs it, fixes what fails, and stops again. Claude Code flags that second stop, and done-check lets it go.
What does it let through on purpose?
A guard that cries wolf gets turned off, so done-check is strict about one thing and relaxed about the rest.
- Old failures. If a test was already failing before the agent's first edit, and nothing new fails, the stop goes through. Set the option to
warnif you want to hear about them. - Scoped runs in monorepos. In a turbo, nx, pnpm or npm workspaces repo, running the tests of the package that changed counts. You get a one-line reminder to run the full suite before you merge.
- No claim, no check. A message that does not claim success, like a question or a plan, is not blocked.
- Errors. Any internal error lets the stop through. done-check is standard-library Python with no dependencies, and it does not break a session.
How do I set it up?
Install it as a Claude Code plugin, then restart Claude Code:
claude plugin marketplace add kilazi/done-check && claude plugin install done-check@kilaziThat is the whole setup for most repos, because the test command is detected. To name your own command, add one line to AGENTS.md at the repo root:
verify: npm run lint && npm testRequirements: Claude Code and python3, on macOS or Linux (Windows is untested). Update with claude plugin marketplace update kilazi.
How do I turn it off?
Three switches, from widest to narrowest:
- For every repo:
/plugin configure done-check@kilaziin Claude Code and set Enabled to off, orexport DONE_CHECK=offin your shell. - For one repo:
verify: offin that repo's AGENTS.md. - For one stop: stop again. The second stop in a turn goes through.
Can I reuse the code?
Yes, under Apache-2.0. Keep LICENSE and NOTICE, and credit the repo in your README or NOTICE with one line: Uses done-check by Kilazi (https://github.com/kilazi/done-check). The same rule is written for coding agents in the repo's AGENTS.md, so an agent that copies the hook into your project adds the credit line too. See also kilazi-live, a live call transcript with a copilot that reads along.
Get done-check
claude plugin marketplace add kilazi/done-check && claude plugin install done-check@kilaziQuestions people ask
Can I reuse it?
Yes. done-check is Apache-2.0: copy it, change it, ship it in your own product. Keep the LICENSE and NOTICE files with the code, and add one line to your README or NOTICE: Uses done-check by Kilazi (https://github.com/kilazi/done-check). Coding agents get the same rule in the repo's AGENTS.md.
Does done-check slow Claude Code down?
No. It only runs when the agent stops, reads the session transcript once, and answers in well under a second. It does not run your tests itself; it only checks whether the agent ran them. The hook has a 30 second timeout and lets go on any internal error.
What if my project has no tests?
If it finds no test command, it does not block. It shows one line asking you to add verify: <command> to AGENTS.md. Any command counts, for example a build, a lint, or a script that hits your local server.
Can the agent get stuck in a loop?
No. Claude Code marks the second stop in the same turn, and done-check lets that one through. The worst case is one extra turn where the agent runs your tests.
Does it work with Codex, Cursor or other agents?
It is built for Claude Code's Stop hook and plugin system. The check itself is a small standard-library Python script that reads a JSON transcript, so it can be adapted to any agent that has a stop or after-turn hook.
Does it send my code anywhere?
No. It runs locally, reads only the session transcript and a few files in your repo (package.json, Makefile, AGENTS.md), and makes no network calls.
