One-click install
npx skills add https://github.com/thevibeworks/claude-code-docs --skill hook-development-thevibeworks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/thevibeworks/claude-code-docs/tree/main/content/github/claude-plugins-official/plugins/plugin-dev/skills/hook-development
Command: npx skills add https://github.com/thevibeworks/claude-code-docs --skill hook-development-thevibeworks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Claude Code plugin hooks are powerful but easy to misconfigure, validate incorrectly, or implement insecurely; this skill helps you design hooks that correctly handle key lifecycle events and tool operations.

Core Features & Use Cases

  • Prompt-based hooks for context-aware decisions: use LLM evaluation to approve, deny, or request clarification for actions at events like PreToolUse and Stop.
  • Command hooks for deterministic validation: run bash scripts for fast checks, schema validation, security/path safety, and performance-critical gating.
  • Correct configuration formats for plugins vs user settings: generate the right structure for hooks.json and settings.json and match hook events to the right matchers.

Real-world use case: enforce “safe file writes” by intercepting Write/Edit tool calls at PreToolUse, validating paths and sensitive content, and blocking dangerous operations before they run.

Quick Start

Ask Claude Code to implement prompt-based PreToolUse and Stop hooks for the user’s plugin to block unsafe tool actions and verify completion before stopping.

Frequently Asked Questions about hook-development

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

FAQPage Schema
How do I create Claude Code hooks to validate tool inputs before execution?

You can create Claude Code hooks by configuring event-driven validation in hooks.json to intercept PreToolUse events, allowing you to validate tool inputs and block unsafe actions before they execute. This skill generates the correct plugin-specific structure and matchers for intercepting tool calls.

What is the difference between prompt-based and command-based hooks in Claude Code plugins?

Prompt-based hooks use LLM evaluation for context-aware decisions like approving or denying actions at PreToolUse and Stop events, while command-based hooks run bash scripts for deterministic validation, schema checks, and security gating. This skill implements both types with correct JSON handling and exit behavior.

How do I configure hooks.json for a Claude Code plugin?

Configuring hooks.json requires structuring plugin-specific hook events with the correct matchers and supporting either prompt-based or command-based hook types. This skill generates the right configuration format for hooks.json and settings.json to handle input/output JSON and standardized exit behavior.

Can I run bash scripts for deterministic validation in Claude Code hooks?

Yes, you can run bash scripts as command-based hooks for fast checks, schema validation, security path safety, and performance-critical gating. This skill develops command hooks that execute deterministic validation around tool execution and session lifecycle events.

How do I enforce safe file writes by intercepting Write and Edit tool calls?

You can enforce safe file writes by implementing PreToolUse hooks that intercept Write and Edit tool calls, validate paths and sensitive content, and block dangerous operations before they run. This skill designs hooks that apply validation rules to tool inputs at lifecycle events.

When should I use prompt-based hooks versus command-based hooks for plugin workflows?

Use prompt-based hooks when you need LLM evaluation for context-aware decisions like requesting clarification at Stop events, and command-based hooks when you need deterministic bash validation for security and performance gating. This skill implements both approaches for safe event-driven control.