T

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.

HookAnthropicautomationv1.0.0MIT
0 views0 copies

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 prompt type 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:

  1. The Stop hook fires and evaluates the prompt
  2. The LLM reviews the conversation for completeness
  3. If tasks remain: returns {"ok": false} with a reason, and Claude continues working
  4. If all tasks are done: returns {"ok": true} and Claude stops normally
  5. This adds a small overhead per stop attempt but catches significant issues
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates