skills/debug-hooks/SKILL.md
This skill should be used when the user says "startup hook error", "hook not working", "debug hooks", "fix hook error", "SessionStart error", "hook script failing", "node:internal/modules error", "diagnose hook", or sees hook-related errors in Claude Code.
npx skillsauth add kyuna0312/kyuna_token_saver Debug HooksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Diagnose and fix Claude Code hook errors. Covers startup hook failures, broken MCP configs, missing dependencies, and invalid hook schemas.
node:internal/modules/cjs/loaderCause: Hook script references a Node.js file that doesn't exist or has bad require/import.
Fix procedure:
~/.claude/settings.json — find SessionStart hooksls [script-path]require() paths insidestartup hook errorCause: Hook command fails on session start.
Fix procedure:
npm install [package]node --versionchmod +x [script]Cause: Wrong event matcher or hook not registered.
Fix procedure:
hooks/hooks.json or settings.json hooks sectionPreToolUse, PostToolUse, SessionStart, Stop, SubagentStop, SessionEnd, UserPromptSubmit, PreCompact, Notificationclaude --debug to see hook execution logs# Step 1: Find all hook configs
find ~/.claude -name "hooks.json" 2>/dev/null
grep -r "hooks" ~/.claude/settings.json
# Step 2: Test each hook script manually
bash [hook-script-path]
# Step 3: Check node/python availability
which node && node --version
which python3 && python3 --version
# Step 4: Validate JSON syntax
cat ~/.claude/settings.json | python3 -m json.tool
Valid hook entry structure:
{
"SessionStart": [{
"hooks": [{
"type": "command",
"command": "bash $CLAUDE_PLUGIN_ROOT/scripts/my-hook.sh",
"timeout": 30
}]
}]
}
Common schema mistakes:
hooks array wrappertype not set to "command"$CLAUDE_PLUGIN_ROOTTo safely remove a broken hook from settings.json:
Emit structured output as LTX rows when reporting hook validation results.
@v1:hook|status|error|fix
| Field | Description |
|-------|-------------|
| hook | Hook identifier or script path |
| status | ok, warn, error, missing |
| error | Short error description or - if none |
| fix | Suggested fix command/action or - if none |
Example:
@v1:hook|status|error|fix
SessionStart:session-start.sh|ok|-|-
SessionStart:broken-hook.sh|error|file not found|recreate or remove hook entry
references/hook-errors.md — Full error catalog with root causes and fixesscripts/validate-hooks.sh — Script to validate all hook configstools
This skill should be used when the user asks to "show recent changes", "show forge changelog", "show changelog for <project>", "what did I add this week", "what files did I touch today", "what packages keep recurring", "what drifts from the template", "review template suggestions", "show pending forge suggestions", "sync forge templates", "apply template suggestion", or "compute back-mapping suggestions". Provides read, drift-discovery, and template back-mapping workflows that wrap the `forge-db` MCP tools (`get_changelog`, `compute_suggestions`, `apply_suggestion`).
development
This skill should be used when the user says "build a wiki", "maintain a wiki", "ingest docs into wiki", "query my wiki", "set up llm wiki", "wiki-based knowledge base", "stop re-reading docs every session", "persistent knowledge base", or "compress my docs into wiki pages".
testing
Use this skill when the user says "/task_brain", "break down this task", "plan this", "decompose this problem", or when a task has multiple moving parts, unclear dependencies, or high ambiguity.
tools
This skill should be used when the user says "optimize settings.json", "tune settings for low tokens", "settings.json for performance", "disable auto memory", "configure for token savings", "minimal context window settings", or "settings taking too many tokens".