hook-debugging

Diagnose Claude Code hook startup, stdin, and import failures.

1|Updated Sep 20, 2025
One-click install
npx skills add https://github.com/Alex1980Alex/1C-Enterprise_Framework --skill hook-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-debugging
Source: https://github.com/Alex1980Alex/1C-Enterprise_Framework/tree/main/.claude/skills/hook-debugging
Command: npx skills add https://github.com/Alex1980Alex/1C-Enterprise_Framework --skill hook-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Claude Code hook debugging is a structured method to identify why a hook does not fire in a real session, isolating issues from startup failures, stdin handling, or import errors.

Core Features & Use Cases

  • Canary-based startup verification to confirm the hook process is actually invoked.
  • File-based logging to capture diagnostics across runs and environments.
  • Manual stdin testing and subprocess wrappers to validate inputs and execution paths.
  • A comprehensive diagnostic checklist guiding step-by-step investigation during debugging.
  • Clear guidance to avoid creating hooks or debugging known Claude Code bugs.

Quick Start

Run the canary test to verify the hook starts, then review logs and perform a manual stdin test to reproduce and diagnose the issue.

Frequently Asked Questions about hook-debugging

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

FAQPage Schema
How do I debug Claude Code hooks that fail to run?

To debug Claude Code hooks that fail to run, you can use a structured diagnostic workflow involving canary tests, file-based logging, and manual stdin testing to isolate startup, import, or input handling failures.

Why does my Claude Code hook not fire in a real session?

A Claude Code hook might not fire due to startup failures, incorrect stdin handling, or import resolution errors. Running a canary test verifies if the hook process is actually invoked during the session.

What is the best way to capture diagnostics for hook debugging across environments?

The best way to capture diagnostics for hook debugging across environments is file-based logging, which records execution details across runs to help reproduce and fix hook issues reliably.

How do I test stdin handling for Claude Code hooks?

You can test stdin handling for Claude Code hooks by performing manual stdin tests and using subprocess wrappers to validate inputs and trace execution paths before applying fixes.

Can I create new hooks while debugging Claude Code hook issues?

No, you should not create new hooks while debugging Claude Code hook issues. Safe diagnostics limit debugging to known, non-production steps using a structured checklist to avoid altering the environment.

Does hook debugging work for isolating import resolution errors?

Yes, hook debugging works for isolating import resolution errors by combining canary-based startup verification and subprocess wrappers to identify where the hook process fails during execution.