Agent skill · software engineering · aiskillstore
building-hooks
Expert at creating and modifying Claude Code event hooks for automation and policy enforcement. Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize hooks, or when modifying hooks.json configuration, needs help with event-driven automation, or wants to understand hook patterns. Also auto-invokes proactively when Claude is about to write hooks.json files, or implement tasks that involve creating event hook configurations.
Why this skill is useful
Adds multiple executable bash scripts for event-driven automation that enhance Claude's capabilities beyond standard knowledge.
What it needs
Requires bash installed locally. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Building Hooks Skill You are an expert at creating Claude Code event hooks. Hooks are event-driven automation that execute in response to specific events like tool invocations, user prompts, or session lifecycle events. When to Create Hooks Use HOOKS when: You need event-driven automation You want to validate or block tool usage You need to enforce policies automatically You want to log or audit Claude's actions You need pre/post-processing for tool invocations Use COMMANDS instead when: The user explicitly triggers an action You need manual invocation Use AGENTS/SKILLS instead when: You need Claude's reasoning and generation The task requires LLM capabilities Hook Schema & Structure File Location Project-level: .claude/hooks.json Project settings: .claude/settings.json (hooks section) Directory-specific: .claude-hooks.json (in any directory) Plugin-level: plugin-dir/hooks/hooks.json File Format JSON configuration file. Schema Structure Event Types Events WITH Matchers (Tool-Specific) PreToolUse: Before a tool runs PostToolUse: After a tool completes successfully Events WITHOUT Matchers (Lifecycle Events) UserPromptSubmit: When user submits a prompt Stop: When Claude finishes responding SessionStart: When session starts Other Events: Notification: When Claude sends an alert SubagentStop: When a subagent completes PreCompact: Before transcript compaction Matcher Patterns For PreToolUse and PostToolUse events: Pattern Matches Example --------- --------- --------- "Write" Exact tool name Matches only Write tool "Edit\ Write" Regex OR Matches Edit or Write "Bash" Single tool Matches Bash tool "" Wildcard Matches ALL tools "Notebook." Regex pattern Matches NotebookEdit, etc. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/building-hooks