Agent skill · software engineering · aiskillstore

hook-development

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.

Why this skill is useful

Adds executable scripts for event-driven automation and validation that enhance the AI's capabilities in managing tool interactions.

What it needs

Requires claude installed locally. About 8k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Hook Development for Claude Code Plugins Overview Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows. Key capabilities: Validate tool calls before execution (PreToolUse) React to tool results (PostToolUse) Enforce completion standards (Stop, SubagentStop) Load project context (SessionStart) Automate workflows across the development lifecycle Hook Types Prompt-Based Hooks (Recommended) Use LLM-driven decision making for context-aware validation: Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse Benefits: Context-aware decisions based on natural language reasoning Flexible evaluation logic without bash scripting Better edge case handling Easier to maintain and extend Command Hooks Execute bash commands for deterministic checks: Use for: Fast deterministic validations File system operations External tool integrations Performance-critical checks Hook Configuration Formats Plugin hooks.json Format For plugin hooks in hooks/hooks.json, use wrapper format: Key points: description field is optional hooks field is required wrapper containing actual hook events This is the plugin-specific format Example: Settings Format (Direct) For user settings in .claude/settings.json, use direct format: Key points: No wrapper - events directly at top level No description field This is the settings format Important: The examples below show the hook event structure that goes inside either format. For plugin hooks.json, wrap these in {"hooks": {...}}. Hook Events PreToolUse Execute before any tool runs. Use to approve, deny, or modify tool calls. Example (prompt-based): Output for PreToolUse: PostToolUse Execute after tool completes. Use to react to results, provide feedback, or log. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/hook-development--11ff78

View the source on GitHub

Browse the @skills marketplace