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.
Create and manage Claude Code hooks for workflow automation. Use when you need to trigger actions at lifecycle events like PreToolUse, PostToolUse, or SessionStart for testing, security, or automation.
/plugin marketplace add resolve-io/.prism/plugin install prism-devtools@prismThis skill inherits all available tools. When active, it can use any tool Claude has access to.
reference/commands.mdreference/event-types.mdreference/examples.mdreference/security.mdManage 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.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.