hook-debugger

Diagnose Claude Code hook failures with logging templates and exit code logic.

Updated May 3, 2026
One-click install
npx skills add https://github.com/skogai/marketplace --skill hook-debugger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-debugger
Source: https://github.com/skogai/marketplace/tree/main/skogai-hook-debugging
Command: npx skills add https://github.com/skogai/marketplace --skill hook-debugger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of managing and troubleshooting event-driven hooks in Claude Code, helping you identify why a hook fails, how to inspect its input, and how to control its execution flow.

Core Features & Use Cases

  • Event Inspection: Provides a standardized logging template to capture and inspect JSON input from any of the 18 hook events.
  • Flow Control: Explains the critical exit code logic, specifically how to use exit 2 to block tool execution or prompt submission.
  • Use Case: If a custom hook is failing to trigger or blocking actions unexpectedly, use this skill to implement the logging template and verify the exact JSON payload received by the hook.

Quick Start

Ask the hook-debugger to explain how to debug a specific hook event like PreToolUse or how to implement the standard logging template in a new script.

Frequently Asked Questions about hook-debugger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Claude Code hooks that fail to trigger or block actions unexpectedly?

To debug Claude Code hooks, implement a standardized logging template to capture and inspect the exact JSON payload received during hook execution, verifying input validation and flow control across all 18 lifecycle events.

How does exit code logic control hook flow in Claude Code event-driven scripts?

Exit code logic controls hook flow by using specific codes like exit 2 to block tool execution or prompt submission, allowing shell scripts to manage conditional blocking during event-driven lifecycle hooks.

What's the best way to inspect JSON input from Claude Code PreToolUse events?

The best way to inspect JSON input from PreToolUse events is applying a standardized logging template within your shell script to capture and output the exact event payload for diagnostic analysis.

Do I need shell scripting experience to troubleshoot Claude Code lifecycle hooks?

Yes, you need familiarity with shell scripting and JSON processing to implement logging templates and conditional blocking logic required to troubleshoot and debug Claude Code lifecycle hooks effectively.

Why does my custom Claude Code hook block tool execution when it should pass?

Your custom hook blocks tool execution due to flow control exit codes; verify your script's exit logic, as returning exit 2 explicitly halts actions, and inspect the JSON input to ensure validation passes.

Can I use event hooks to validate tool inputs before execution in Claude Code?

Yes, you can use event hooks like PreToolUse to validate tool inputs by processing the JSON payload within a shell script and using exit 2 to conditionally block execution if validation fails.