create-hooks

Design and implement Claude Code hooks for automating, validating and governing tool interactions.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/gerald-ica/opencode-config-snapshot --skill create-hooks-gerald-ica
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hooks
Source: https://github.com/gerald-ica/opencode-config-snapshot/tree/main/opencode/skills/create-hooks
Command: npx skills add https://github.com/gerald-ica/opencode-config-snapshot --skill create-hooks-gerald-ica

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating robust Claude Code hooks can be complex, tedious, and error-prone without a clear blueprint for events, matchers, and input/output contracts.

Core Features & Use Cases

  • Event-driven automation: define PreToolUse, PostToolUse, Stop, SessionStart, and UserPromptSubmit hooks to automate decisions and actions.
  • Safety and governance: enforce validation checks, block dangerous commands, and log activities for auditing.
  • Workflow automation: compose multiple hooks in sequences to chain validations and actions, improving reliability.

Quick Start

Create a basic PreToolUse hook that logs the command before execution.

Frequently Asked Questions about create-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Claude Code hooks for PreToolUse and PostToolUse events?

Claude Code hooks use event-driven automation to intercept tool calls. You define PreToolUse and PostToolUse matchers to validate commands, enforce safety checks, and execute automated actions before or after tool interactions occur.

What are Claude Code hooks and when do I need them?

Claude Code hooks are event-driven scripts that automate, validate, and govern tool interactions. You need them to enforce safety checks, block dangerous commands, or log activities for auditing during workflows like SessionStart or UserPromptSubmit.

How do I set up validation checks to block dangerous commands in Claude Code?

Set up validation checks by creating a PreToolUse hook that evaluates command inputs against safety rules. The hook uses input/output contracts to block dangerous commands and log activities before execution proceeds.

Can I chain multiple Claude Code hooks together for workflow automation?

Yes, you can compose multiple hooks in sequences to chain validations and actions. This event-driven workflow automation improves reliability by ensuring checks execute in a defined order across tool interactions.

What are the limitations of building Claude Code hooks without a blueprint?

Without a clear blueprint for events, matchers, and input/output contracts, creating robust hooks is complex, tedious, and error-prone. Properly defining hook types and safety checks is required to build reliable, auditable automation.