Debug Hooks

🌐Community
by parcadei Β· vlatest Β· Repository

Insert temporary debugging code snippets into running programs to isolate issues and accelerate troubleshooting.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add debug-hooks npx -- -y @trustedskills/debug-hooks
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "debug-hooks": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/debug-hooks"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

The Debug Hooks skill provides a systematic workflow for troubleshooting Claude Code hooks, enabling you to diagnose and resolve issues related to their behavior. It allows you to insert temporary debugging code snippets into running programs to isolate problems and accelerate troubleshooting when your hooks aren't behaving as expected. This is particularly helpful when investigating why hooks fire, produce incorrect output, or fail to trigger under specific circumstances.

When to use it

This skill is useful in the following situations:

  • When a hook isn’t firing at all.
  • When a hook produces unexpected or incorrect output.
  • When a SessionEnd event isn't working as intended.
  • When a PostToolUse hook fails to trigger.
  • To understand why a hook didn't run when you expected it to.

Key capabilities

  • Provides steps for checking hook outputs and cache locations.
  • Offers methods for verifying hook registration in project and global settings files.
  • Includes instructions for testing hooks manually using shell commands.
  • Highlights the issue of silent failures caused by detached spawn processes and provides a fix with temporary logging.
  • Details how to rebuild TypeScript-based hooks after making edits.

Example prompts

Here are some examples of what you might instruct an AI agent equipped with this skill to do:

  • "Check why my SessionEnd hook isn't running."
  • "Verify the registration of my PostToolUse hook in my project settings."
  • "Test my session-end-cleanup.sh hook manually."

Tips & gotches

  • Rebuild after edits: If you modify TypeScript source files, remember to rebuild the hooks using npx esbuild as changes to source code alone won't be reflected.
  • Silent failures: Be aware that detached spawn processes with redirected standard input/output can hide errors; add temporary logging to capture and diagnose these issues.
  • Duplicate registration: Hooks can sometimes run twice if registered in both project and global settings – ensure there are no duplicates.

Tags

πŸ›‘οΈ

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates β€” what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
parcadei
Installs
138

🌐 Community

Passed automated security scans.