debug-hooks

Featured

Systematic hook debugging workflow. Use when hooks aren't firing, producing wrong output, or behaving unexpectedly.

AI & Automation 3,951 stars 303 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Debug Hooks Systematic workflow for debugging Claude Code hooks. ## When to Use - "Hook isn't firing" - "Hook produces wrong output" - "SessionEnd not working" - "PostToolUse hook not triggering" - "Why didn't my hook run?" ## Workflow ### 1. Check Outputs First (Observe Before Editing) ```bash # Check project cache ls -la $CLAUDE_PROJECT_DIR/.claude/cache/ # Check specific outputs ls -la $CLAUDE_PROJECT_DIR/.claude/cache/learnings/ # Check for debug logs tail $CLAUDE_PROJECT_DIR/.claude/cache/*.log 2>/dev/null # Also check global (common mistake: wrong path) ls -la ~/.claude/cache/ 2>/dev/null ``` ### 2. Verify Hook Registration ```bash # Project settings cat $CLAUDE_PROJECT_DIR/.claude/settings.json | grep -A 20 '"SessionEnd"\|"PostToolUse"\|"UserPromptSubmit"' # Global settings (hooks merge from both) cat ~/.claude/settings.json | grep -A 20 '"SessionEnd"\|"PostToolUse"\|"UserPromptSubmit"' ``` ### 3. Check Hook Files Exist ```bash # Shell wrappers ls -la $CLAUDE_PROJECT_DIR/.claude/hooks/*.sh # Compiled bundles (if using TypeScript) ls -la $CLAUDE_PROJECT_DIR/.claude/hooks/dist/*.mjs ``` ### 4. Test Hook Manually ```bash # SessionEnd hook echo '{"session_id": "test-123", "reason": "clear", "transcript_path": "/tmp/test"}' | \ $CLAUDE_PROJECT_DIR/.claude/hooks/session-end-cleanup.sh # PostToolUse hook (Write tool example) echo '{"tool_name": "Write", "tool_input": {"file_path": "test.md"}, "session_id": "test-123"}' | \ $CLAUDE_PROJECT_DIR/.claude/h...

Details

Author
parcadei
Repository
parcadei/Continuous-Claude-v3
Created
11 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

debug-hooks

Systematic hook debugging workflow. Use when hooks aren't firing, producing wrong output, or behaving unexpectedly.

552 Updated 6 days ago
vibeeval
AI & Automation Listed

hook-development

Use for auditing, reviewing or debugging Claude Code hooks, and for questions about how they behave - a hook that never fires, fires on the wrong calls, or has its block, deny, allow, exit code 2 or additionalContext ignored; a check of the hooks in settings.json, hooks/hooks.json or skill and agent frontmatter before a release; the debug log; or how an event, matcher, if filter, handler type, exit code, JSON output, timeout or async hook works. Covers command, HTTP, MCP tool, prompt and agent hooks, workspace trust and mods in the same chain, checked against the current docs and the changelog for the installed version, with a config linter, a hook probe and a changelog script. Use it even when the user only pastes a hook or says it does nothing. Not for writing a new hook (writing-hooks), Git hooks, React hooks or webhooks.

1 Updated today
nerymurillohnd
AI & Automation Listed

hooks-configuration

Claude Code hooks creation and debugging assistant. Configures PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit, and other lifecycle hooks in settings.json. Creates command hooks (Bash/Python scripts), prompt-based hooks (LLM evaluation), and agent hooks. Handles exit codes (0=allow, 1=error, 2=deny), matchers, async execution, and security enforcement patterns. Use when creating a hook, debugging a hook, blocking dangerous commands, auto-formatting on save, running tests on stop, or adding session logging.

1 Updated 1 months ago
seanwinslow28