SKILL

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.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Hook Development for Claude Code Plugins
  • Overview
  • Hook Types
  • Prompt-Based Hooks (Recommended)
  • Command Hooks
  • Hook Configuration Formats
  • Plugin hooks.json Format
  • Settings Format (Direct)

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 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 Execute bash commands for deterministic checks: Use for: Fast deterministic validations File system operations External tool integrations Performance-critical checks 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: For user settings in .claude/settings.json, use direct format: Key points: No wrapp

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
davila7/claude-code-templates
Source file
cli-tool/components/skills/development/hook-development/SKILL.md
Fixed revision
21be197f100a12b8d0dd9a211cc244c8179f84d3
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: davila7/claude-code-templates · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:44.435Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.