From context_forge
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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/context_forge:debug-hooksThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Diagnose and fix Claude Code hook errors. Covers startup hook failures, broken MCP configs, missing dependencies, and invalid hook schemas.
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 configsnpx claudepluginhub kyuna0312/context_forge --plugin context_forgeSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.