Anti-Rationalization Gate Hook
Stop hook that catches when Claude rationalizes leaving work incomplete. Uses LLM analysis to detect phrases like 'good enough', 'can be done later', or 'out of scope' and forces Claude to actually finish the job before stopping.
Hook Type
Stop -- Fires when Claude attempts to stop, uses prompt-based analysis.
Description
LLMs sometimes rationalize stopping early with phrases like "this should be sufficient", "the rest can be done later", or "this is out of scope". This hook detects these rationalization patterns and forces Claude to either genuinely complete the work or explicitly acknowledge what remains undone with a concrete plan.
Patterns/Rules
- Triggers every time Claude attempts to stop
- Uses a prompt-type hook for LLM-based analysis
- Detects rationalization patterns in Claude's final message
- Forces continuation if incomplete work is detected
- Allows stopping if work is genuinely complete
Configuration
{ "hooks": { "Stop": [ { "hooks": [ { "type": "prompt", "prompt": "Analyze the assistant's last response critically. Look for these rationalization patterns that indicate incomplete work:\n\n1. HEDGING: 'should work', 'probably fine', 'this should be sufficient'\n2. DEFERRAL: 'can be done later', 'as a follow-up', 'left as an exercise'\n3. SCOPE DEFLECTION: 'out of scope', 'beyond what was asked', 'not strictly necessary'\n4. MINIMIZATION: 'just needs', 'only requires', 'a simple change'\n5. INCOMPLETE PATTERNS: TODO comments left in code, placeholder implementations, untested changes\n6. PREMATURE COMPLETION: Stopping after planning without implementing, or implementing without testing\n\nIf ANY of these patterns are present AND actual work remains to be done, respond with:\n{\"ok\": false, \"reason\": \"Detected rationalization: [specific pattern]. Remaining work: [what needs to be done]\"}\n\nIf the work is genuinely complete OR the user explicitly asked to stop, respond with:\n{\"ok\": true}" } ] } ] } }
Stricter Version
{ "hooks": { "Stop": [ { "hooks": [ { "type": "prompt", "prompt": "You are a strict completion auditor. Check the assistant's work against the user's ORIGINAL request (not the assistant's interpretation of it). Verify: 1) Every item the user asked for was actually delivered, not just discussed. 2) Code changes were tested or at minimum syntax-checked. 3) No TODO/FIXME/HACK comments were introduced. 4) The response doesn't end with a list of 'next steps' that should have been done now. If incomplete: {\"ok\": false, \"reason\": \"...\"}. If complete: {\"ok\": true}." } ] } ] } }
Action
When Claude attempts to stop:
- The prompt-based hook analyzes Claude's final response
- Scans for known rationalization and deferral patterns
- Cross-references against the original request
- If rationalization detected: returns
{"ok": false}with specific feedback, and Claude continues - If work is genuinely done: returns
{"ok": true}and Claude stops
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.