// Manage Claude Code hooks for workflow automation. Create, configure, test, and debug hooks that execute at various lifecycle points. Supports all hook events (PreToolUse, PostToolUse, SessionStart, etc.) with examples and best practices.
| name | hooks-manager |
| description | Manage Claude Code hooks for workflow automation. Create, configure, test, and debug hooks that execute at various lifecycle points. Supports all hook events (PreToolUse, PostToolUse, SessionStart, etc.) with examples and best practices. |
| version | 1.0.0 |
Manage Claude Code hooks for deterministic workflow automation.
Guides you through Claude Code hook management:
Hooks execute at 9 lifecycle points:
| Event | Timing | Can Block? (Exit 2) |
|---|---|---|
| PreToolUse | Before tool execution | ✅ Yes (blocks tool) |
| PostToolUse | After tool completion | ⚠️ Partial (tool already ran, feeds stderr to Claude) |
| UserPromptSubmit | Before AI processing | ✅ Yes (erases prompt) |
| SessionStart | Session begins/resumes | ❌ No |
| SessionEnd | Session terminates | ❌ No |
| Stop | Claude finishes responding | ✅ Yes (blocks stoppage) |
| SubagentStop | Subagent completes | ✅ Yes (blocks stoppage) |
| PreCompact | Before memory compaction | ✅ Yes (blocks compaction) |
| Notification | Claude sends notification | ❌ No |
Exit Codes:
→ Complete Event Types Reference - Detailed documentation with examples
PRISM uses plugin-level hooks configured in hooks/hooks.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "python ${CLAUDE_PLUGIN_ROOT}/hooks/my-hook.py"
}
]
}
]
}
}
Critical: Use ${CLAUDE_PLUGIN_ROOT} for all plugin paths (not relative paths)
→ Complete Configuration Reference for full schema
*hook-examples (2 min)*create-hook (guided setup)*test-hook [name] (validation)Result: A working hook following best practices
Need a command or pattern right now?
→ Commands Reference - All 15 commands with examples → Examples Library - 13 pre-built hook patterns
Want to understand hook architecture?
→ Event Types Reference - Complete event documentation → Security Best Practices - Hook security guide
| Category | Commands |
|---|---|
| Management | list-hooks, create-hook, edit-hook {name}, delete-hook {name}, enable-hook {name}, disable-hook {name} |
| Testing | test-hook {name}, debug-hook {name}, validate-config |
| Examples | hook-examples, event-types, install-example {name} |
| Sharing | export-hooks, import-hooks {file} |
→ Full Command Reference for detailed usage
Quick access to 13 pre-built patterns:
→ Complete Examples with full implementations
The hooks-manager skill enables automation for:
Current PRISM Hooks:
enforce-story-context - Block workflow commands without active storytrack-current-story - Capture story file from *draft commandvalidate-story-updates - Ensure required sections existvalidate-required-sections - Status-based section validationAll detailed content lives in reference files (progressive disclosure):
Q: Where do I start?
A: Run *hook-examples to browse patterns, then *create-hook for guided setup
Q: Which event should I use? A: See Event Types Reference for complete guide
Q: Can I see working examples?
A: Yes! Run *hook-examples or see Examples Library
Q: How do I test before deployment?
A: Use *test-hook [name] to validate with sample input
Q: How do I share hooks with my team?
A: Use *export-hooks and commit to .claude/settings.json
This skill activates when you mention:
Need help? Use *hook-examples to browse patterns or *create-hook for guided setup.