hook-development

Validate and react to Claude Code events with plugin and user hooks.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/BFLabsAI/algoritmo-milionario --skill hook-development-bflabsai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/BFLabsAI/algoritmo-milionario/tree/main/skills/hook-development
Command: npx skills add https://github.com/BFLabsAI/algoritmo-milionario --skill hook-development-bflabsai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Developers building Claude Code plugins need a robust, standard way to implement, manage, and validate hooks that respond to events like PreToolUse, PostToolUse, Stop, and SessionStart, ensuring safety, policy compliance, and reliable automation.

Core Features & Use Cases

  • Event-driven hooks: support for PreToolUse, PostToolUse, Stop, SessionStart, SessionEnd, and more with both plugin-wide and user-specific configurations.
  • Hook types: prompt-based hooks for flexible reasoning and command-based hooks for deterministic checks, plus patterns for context loading and conditional activation.
  • Testing and debugging: provides hook schema validation, sample inputs, and debugging workflows to ensure hooks perform safely before deployment.

Quick Start

Create an initial PreToolUse hook that validates a write operation and run Claude Code in debug mode to observe hook interactions.

Frequently Asked Questions about hook-development

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

FAQPage Schema
How do I automate Claude Code plugin behavior using event-driven hooks?

Event-driven hooks automate Claude Code plugins by validating and reacting to tool usage across events like PreToolUse, PostToolUse, Stop, and SessionStart. They use prompt-based or command-based architectures to trigger actions safely.

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

Prompt-based hooks enable flexible reasoning for dynamic responses, while command-based hooks execute deterministic checks. Both hook types support context loading and conditional activation to manage plugin automation safely.

How do I create a PreToolUse hook that validates write operations in Claude Code?

To create a PreToolUse hook, define a validation script that checks write operations, then run Claude Code in debug mode. This workflow provides schema validation and sample inputs to observe hook interactions before deployment.

Does Claude Code support user-specific hooks alongside plugin-wide hook configurations?

Claude Code supports both plugin-wide and user-specific hook configurations. This allows developers to manage event-driven automation across PreToolUse, PostToolUse, Stop, and SessionStart events at different scopes.

How can I validate and debug Claude Code hooks before deploying them?

You validate and debug Claude Code hooks using provided schema validation, sample inputs, and debugging workflows. Running Claude Code in debug mode lets you observe hook interactions and ensure safe performance before deployment.

Can I persist environment variables across hook executions in Claude Code?

Claude Code hooks support environment persistence architectures. This allows you to maintain context and state across prompt-based and command-based hook executions triggered by events like SessionStart and SessionEnd.