
Hook Developer
Build Claude Code hooks with correct schemas, registration, and testing patterns
What You Can Do
Create, debug, and test Claude Code hooks with confidence using comprehensive schema documentation and registration patterns. You'll understand the lifecycle of each hook type, their blocking capabilities, and how to structure inputs and outputs correctly. This skill covers all hook types from PreToolUse to SubagentStop, helping you implement the right hook for your automation use case.
Features
understand when each hook fires, blocking capabilities, and primary use cases
precise JSON structures for PreToolUse, PostToolUse, UserPromptSubmit, PermissionRequest, and all event hooks
configure hooks in settings.json with correct syntax and hook type options (command vs prompt)
learn which hooks can block execution and how to implement permission decisions or tool modifications
validate hook inputs/outputs and diagnose schema mismatches
use hooks to load context, set environment variables, and coordinate subagents
auto-approve, deny, or modify permissions based on tool execution context
Example Output
PreToolUse Hook Example:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"modifiedToolInput": {
"file_path": "/safe/path/file.txt",
"command": "cat"
}
},
"output": "Tool execution approved and sanitized"
}
UserPromptSubmit Hook Example:
{
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"permissionDecision": "allow",
"injectedSystemContext": "User has elevated permissions. Session started at 2024-01-15."
},
"output": "Prompt accepted with injected context"
}
SessionStart Hook Example:
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"environmentVariables": {
"PROJECT_ROOT": "/workspace",
"API_KEY": "***"
}
},
"output": "Environment initialized"
}
What's Included
- hook-developer SKILL.md: comprehensive reference with all hook types and schemas
- Hook lifecycle table: quick reference showing which hooks can block, inject context, or react to events
- Input/output schema templates: JSON structures for each hook type (PreToolUse, PostToolUse, UserPromptSubmit, PermissionRequest, SessionStart, SessionEnd, Stop, SubagentStart, SubagentStop, PreCompact, Notification)
- Registration checklist: settings.json configuration patterns and hook type options (command vs prompt)
- Testing patterns: validation scripts and debugging workflows for hook execution
Who It's For
- DevOps engineers building automation hooks for Claude Code
- Platform engineers implementing permission and context management systems
- Backend developers integrating Claude into multi-agent architectures
- AI/ML engineers coordinating subagent execution and lifecycle events
- Systems architects designing hook-based approval and validation workflows
Best For
- Blocking or modifying tool execution before it runs
- Validating user prompts and injecting context dynamically
- Handling permission requests and auto-approval workflows
- Coordinating session lifecycle (startup cleanup, environment setup)
- Managing subagent execution and forcing continuation logic
- Debugging hook input/output schema mismatches
- Building notification and alerting systems







