hooks
Hooks
Hooks are Claude Code's automation surface — deterministic bash (or any shell) scripts that fire on lifecycle events. Each hook receives JSON on stdin and returns JSON on stdout: {"decision": "approve"|"block", "reason"?: "..."}.
Events (matcher + input + output)
| Event | Fires | Input | Output shape |
|---|---|---|---|
PreToolUse |
Before any tool | {tool_name, tool_input} |
{decision, reason?} — block prevents the tool call |
PostToolUse |
After tool succeeds | {tool_name, tool_input, tool_output} |
{decision, reason?} |
PostToolUseFailure |
After tool fails | {tool_name, tool_input, error} |
{decision} — almost always approve |
Notification |
Claude needs input | {message} |
{decision} |
Stop |
Agent finishes turn | {stop_reason} |
{decision} |
UserPromptSubmit |
Prompt submitted | {prompt} |
{decision} + optional modified prompt |
SessionStart |
New session | {} |
{decision} — usually for context injection |
Installing a hook pack
Use MCP cc_kb_hook_recipe(name) to fetch a security-hardened pack. Each pack returns:
More from lobbi-docs/claude
vision-multimodal
Vision and multimodal capabilities for Claude including image analysis, PDF processing, and document understanding. Activate for image input, base64 encoding, multiple images, and visual analysis.
273design-system
Apply and manage the AI-powered design system with 50+ curated styles
127complex-reasoning
Multi-step reasoning patterns and frameworks for systematic problem solving. Activate for Chain-of-Thought, Tree-of-Thought, hypothesis-driven debugging, and structured analytical approaches that leverage extended thinking.
113gcp
Google Cloud Platform services including GKE, Cloud Run, Cloud Storage, BigQuery, and Pub/Sub. Activate for GCP infrastructure, Google Cloud deployment, and GCP integration.
75kanban
Kanban methodology including boards, WIP limits, flow metrics, and continuous delivery. Activate for Kanban boards, workflow visualization, and lean project management.
64debugging
Debugging techniques for Python, JavaScript, and distributed systems. Activate for troubleshooting, error analysis, log investigation, and performance debugging. Includes extended thinking integration for complex debugging scenarios.
60