From claude-code-hook-debugging
Debug Claude Code hook errors (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse). Use when: (1) console shows "hook error" with no details, (2) plugin hooks fail silently, (3) need to trace which plugin registers which hook event. Covers finding hooks.json across plugin cache, diagnosing missing dependencies, and resolving auth/config issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-hook-debugging:claude-code-hook-debuggingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code shows generic "hook error" messages (e.g., "SessionStart:resume hook error",
Claude Code shows generic "hook error" messages (e.g., "SessionStart:resume hook error", "UserPromptSubmit hook error") with no stack trace or details, making it unclear which plugin is failing and why.
SessionStart:resume hook error or similarUserPromptSubmit hook errorPostToolUse:Write hook blocking error# Search all plugin hooks.json files for the event name
grep -r "SessionStart\|UserPromptSubmit\|PreToolUse\|PostToolUse" \
~/.claude/plugins/cache/*/hooks/hooks.json
# Read the specific hooks.json files found above
# Look for the "command" field to see what's being executed
cat ~/.claude/plugins/cache/<plugin-name>/*/hooks/hooks.json
Run the command from the hooks.json directly in your terminal to see the actual error:
# Example: if the hook runs "semgrep mcp -k inject-secure-defaults"
semgrep mcp -k inject-secure-defaults
# This will show the real error (command not found, auth missing, etc.)
| Symptom | Cause | Fix |
|---|---|---|
command not found | Tool not installed | brew install <tool> |
No APP_TOKEN found | Tool needs authentication | Run the tool's login command |
Permission denied | Script not executable | chmod +x <script> |
blocking error | Hook is synchronous and failing | Fix or disable the plugin |
Edit ~/.claude/settings.json and set the plugin to false:
"plugin-name@marketplace": false
Changes take effect after /reload-plugins or restart.
/reload-plugins~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/hooks/hooks.json~/.claude/settings.json under the hooks keyasync: false flag in hooks.json means the hook blocks — if it fails, it can block Claude's responseCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub dmaynor/dmaynor-skills-marketplace --plugin claude-code-hook-debugging