Hooks: doc-guardian still blocks workflow + plugin prefixes not showing #110
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
This is a recurring issue that has been reported multiple times but persists. The user continues to experience:
Evidence
Blocking Error Observed
Problems in this output:
[doc-guardian]prefix in the messageImplementation (2026-01-23)
Fix 1: doc-guardian Hook Rewritten
Completely rewrote the hook to be truly non-blocking:
Key changes:
Fix 2: All Hooks Updated with Strict Prefix Enforcement
Updated all plugin hooks with consistent format:
New standard format in all hooks:
Files Modified
plugins/doc-guardian/hooks/hooks.jsonplugins/code-sentinel/hooks/hooks.jsonplugins/projman/hooks/hooks.jsonplugins/pr-review/hooks/hooks.jsonCHANGELOG.md(v3.1.2 entry)Deployed
Changes synced to installed marketplace location:
~/.claude/plugins/marketplaces/leo-claude-mktplace/Acceptance Criteria
Testing Required
User needs to verify:
[doc-guardian] Config file modified...[plugin-name]prefixIssue Reopened - Model Compliance Problem Identified
The fix in PR #111 updated the hook prompt but did not actually solve the problem. The issue persists.
Root Cause Analysis
The doc-guardian hook at
plugins/doc-guardian/hooks/hooks.jsonhas aprompttype hook with explicit instructions:Despite these explicit FORBIDDEN rules, Claude generates verbose analysis messages like:
This is a model compliance issue - the hook configuration is correct, but Claude is not following the instructions in the prompt.
Evidence
<system-reminder>tags with "hook stopped continuation"Temporary Workaround Applied
The hook has been disabled in the installed location:
Proposed Investigation Plan
Test alternative hook types
commandtype hook instead ofprompttypeTest prompt variations
Research Claude Code hook behavior
<system-reminder>wrapping is Claude Code behavior vs model behaviorConsider architectural alternatives
/doc-auditand/doc-synccommands)Notificationhook type instead ofPostToolUseif it existsAcceptance Criteria (Revised)
Please investigate and determine if this is fixable at the plugin level or if it's a Claude Code/model limitation that needs to be reported upstream.
Additional Approach: Background Agent Spawn
From session notes, another architectural option worth investigating:
Concept
Instead of the hook trying to output anything (which Claude ignores/overrides), the hook could:
doc-guardian:doc-analyzeragent in the backgroundBenefits
Implementation Questions
run_in_background: true?Notificationhook type that could work better?Priority
This should be explored as Option 5 in the investigation plan, potentially the best long-term solution if technically feasible.
Fixed in commit
6c24bcbReplaced prompt hook with command hook. Prompt hooks are unreliable - Claude ignores instructions. Command hooks run a bash script that guarantees exact output.
Changes:
notify.shscript - only outputs for config file changes, silent otherwisehooks.jsonfromprompttype tocommandtypeThe script checks if the modified file is in
commands/,agents/,skills/, orhooks/directories. If yes, outputs notification. If no, exits silently (guaranteed no blocking).