Debug Hooks
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.
Run in terminal (recommended)
claude mcp add debug-hooks npx -- -y @trustedskills/debug-hooks
Or manually add to ~/.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
SessionEndevent isn't working as intended. - When a
PostToolUsehook 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
SessionEndhook isn't running." - "Verify the registration of my
PostToolUsehook in my project settings." - "Test my
session-end-cleanup.shhook manually."
Tips & gotches
- Rebuild after edits: If you modify TypeScript source files, remember to rebuild the hooks using
npx esbuildas 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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
π Community
Passed automated security scans.