Task Completion Verifier Hook
Uses an LLM-powered prompt to verify all requested tasks are actually complete before Claude stops working. Catches partially finished work, missed requirements, and forgotten edge cases. Prevents premature task completion.
Hook Type
Stop -- Fires when Claude is about to finish and stop working.
Description
This hook intercepts Claude's stop event and uses a prompt-based check to verify that all requested tasks have been completed. If the check determines work remains, Claude continues instead of stopping. This catches common issues like forgotten subtasks, untested code, and incomplete implementations.
Patterns/Rules
- Triggers every time Claude attempts to stop
- Uses a
prompttype hook (LLM-evaluated, not a script) - Returns
{"ok": false, "reason": "..."}to force Claude to continue - Returns
{"ok": true}to allow Claude to stop normally - The prompt has access to the conversation context to evaluate completeness
Configuration
Basic Version
{ "hooks": { "Stop": [ { "hooks": [ { "type": "prompt", "prompt": "Review the conversation and verify ALL requested tasks are complete. Check: 1) Every explicit request was addressed. 2) Code changes compile/run without errors. 3) Tests were added or updated if code changed. 4) No TODO comments were left unresolved. If anything is incomplete, respond with {\"ok\": false, \"reason\": \"description of what remains\"}. If everything is done, respond with {\"ok\": true}." } ] } ] } }
Strict Version (with test verification)
{ "hooks": { "Stop": [ { "hooks": [ { "type": "prompt", "prompt": "Before stopping, verify: 1) ALL tasks from the user's original request are complete. 2) All modified code has corresponding test coverage. 3) No files were left in a broken state. 4) Git status shows a clean, committable state. 5) No placeholder or TODO code remains. Report {\"ok\": false, \"reason\": \"what's missing\"} if anything is incomplete. Report {\"ok\": true} only if everything is genuinely done." } ] } ] } }
Action
When Claude attempts to stop:
- The Stop hook fires and evaluates the prompt
- The LLM reviews the conversation for completeness
- If tasks remain: returns
{"ok": false}with a reason, and Claude continues working - If all tasks are done: returns
{"ok": true}and Claude stops normally - This adds a small overhead per stop attempt but catches significant issues
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Pre-Commit Security Scanner
Pre-commit hook that scans staged files for hardcoded secrets, API keys, passwords, and sensitive data patterns before allowing commits.
Agents Md Watcher
Streamline your workflow with this automatically, loads, agents, configuration. Includes structured workflows, validation checks, and reusable patterns for automation.
Automated Build Inspector
Boost productivity using this automatically, trigger, build, processes. Includes structured workflows, validation checks, and reusable patterns for automation.