Make Claude Code prove fixed and tests pass claims with a Stop hook

A solo founder who runs long Claude Code sessions wrote a Stop hook that sends the agent back when it claims a fix with nothing run. Replayed over 406 past claims, the current version blocks 2.

Done withClaude Code· Nov 11, 2026

What they did

The author, GapMine, runs a one-person company on long Claude Code sessions and scheduled AI jobs, and kept losing time to replies like "it's fixed" or "that isn't used anywhere" that turned out to be unchecked. They wrote claim-check, a Stop hook. When the agent tries to end a turn with a claim of finished work, the hook reads the session: for a fix or passing tests it wants something to have run without failing after the last code edit, or proof in the reply such as a commit hash, a pass count or a 2xx status. For a claim that something does not exist it wants two different kinds of lookup. If proof is missing it sends the agent back once with a note saying what to run. On November 4, 2026 they replayed it over their own session history.

How it went

After removing 1,649 duplicated turns, 3,977 turns were left and 406 ended with a claim of done, fixed, deployed or passing. Version 0.2.0 would have blocked 86, mostly wrap-up messages with no tool calls; only 1 was the target case of a claim right after an edit with nothing run. A hand check of 24 of the 86 found 18 unproven wrap-ups, 3 that were not claims, and 3 unclear. After feedback that blocking correct wrap-ups gets a hook switched off, 0.3.0 accepts an earlier check if no code changed since, and blocks 2 of the 406. An older copy blocked 19 times in the week before release.

Worth knowing

It matches set phrases in English and Chinese, so wording like "Fixed the redirect loop" slips through, and any honest "not verified" in a reply lets the whole reply pass. A command run after an edit proves only that something ran, not that it tested the right thing. A replay mode and a log-only option let you see what it would block before turning it on. Needs Python 3.9 or later.

Try it

With Claude Code· 3 parts to fill in

Write a Stop hook for [Claude Code or my agent harness] in [language]. When my agent ends a turn with a claim like fixed, tests pass, deployed or doesn't exist, read the session transcript and check for proof: a command that ran without failing after the last code edit, or a commit hash, pass count or 2xx status cited in the reply. For absence claims require two different kinds of search. If proof is missing, send the agent back once with a note saying what to run, and never block twice in a row. Add a replay mode that runs over [path to my past sessions] and prints how many claims it would block, and stop there so I can review the count before enabling blocking.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related