From hook-guard
This skill should be used when the user asks to "check hooks", "diagnose hook issues", "verify hook setup", "run hook doctor", "hook health check", "troubleshoot hooks", "are my hooks working", "hook-guard doctor", "check pre-commit status", or wants to verify that their hook configuration is correct and complete. Inspects hook files, permissions, tool availability, and configuration integrity.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hook-guard:doctorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Diagnose hook health: check all hook components are correctly installed and functional.
Diagnose hook health: check all hook components are correctly installed and functional.
Run ALL of the following checks and present results as a status table.
# Check core.hooksPath
git config core.hooksPath
.githooks → OKCheck these files exist and are executable:
# Pre-commit hook
test -f .githooks/pre-commit && test -x .githooks/pre-commit
# Commit-msg hook (if conventional commits enabled)
test -f .githooks/commit-msg && test -x .githooks/commit-msg
For each file:
chmod +x)Read .claude/settings.local.json and check:
hooks.PostToolUse array exists with Edit/Write matcher → OK or MISSINGhooks.PreToolUse array exists with Bash matcher (test gate) → OK or MISSINGenv.CLAUDECODE is set to "1" → OK or MISSINGFor each tool referenced in the hooks, verify it's installed:
command -v <tool> &>/dev/null
Check all tools mentioned in:
Report: INSTALLED or MISSING for each tool.
Verify the pre-commit script contains CLAUDECODE skip logic:
grep -q 'CLAUDECODE' .githooks/pre-commit
Check for .claude/hook-guard.local.md (read skills/setup/references/settings.md for the expected schema):
If user wants a deeper check, offer to run:
# Dry run the pre-commit hook
.githooks/pre-commit
This runs all checks against the current working tree (not staged changes, since nothing is staged during doctor).
Present results as a table:
Hook Guard Doctor
═══════════════════════════════════════
core.hooksPath ✓ .githooks
.githooks/pre-commit ✓ exists, executable
.githooks/commit-msg ✓ exists, executable
CC hooks (PostToolUse) ✓ lint + format on Edit/Write
CC hooks (PreToolUse) ✓ test gate on commit
CC env.CLAUDECODE ✓ set
CLAUDECODE skip logic ✓ present in pre-commit
Tools:
ruff ✓ installed (0.9.x)
pytest ✓ installed
jq ✓ installed
python3 ✓ installed
Settings: ✓ .claude/hook-guard.local.md found
═══════════════════════════════════════
Result: 10/10 checks passed
Use ✓ for pass, ✗ for fail, ⚠ for warning, ℹ for info.
For each FAIL or WARN, suggest the fix:
| Issue | Fix |
|---|---|
| core.hooksPath not set | git config core.hooksPath .githooks |
| Hook not executable | chmod +x .githooks/pre-commit |
| Tool not installed | Suggest install command for the platform |
| CLAUDECODE skip missing | Re-run setup to regenerate |
| CC hooks missing | Re-run setup to regenerate |
Ask user if they want to auto-fix the issues found.
npx claudepluginhub musingfox/cc-plugins --plugin hook-guardDiagnoses Claude Code hooks setup by checking active hooks, file permissions, dependencies (jq, python3, node), env vars, settings.json integration, and recent activity logs.
Audits Claude Code hooks for config validity, script structure, matchers, env vars, decisions, and tests. Run after hook creation, before releases, or for periodic checks.
Guides creation of Claude Code writing hooks for code quality gates, static analysis, and workflow automation using structured TDD tasks on events like PreToolUse.