hook-development

Design and validate Claude Code hooks for tool usage and workflow automation.

1|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/lucasfth/config --skill hook-development-lucasfth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/lucasfth/config/tree/main/.claude/plugins/marketplaces/claude-plugins-official/plugins/plugin-dev/skills/hook-development
Command: npx skills add https://github.com/lucasfth/config --skill hook-development-lucasfth

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Design and enforce robust Claude Code hooks to govern tool usage and workflow automation.

Core Features & Use Cases

  • Comprehensive reference of hook events, formats, and best practices for plugin development.
  • Ready-to-use templates and patterns for prompt-based and command hooks, including SessionStart and Stop workflows.
  • Built-in tooling and scripts for validation, testing, and linting (validate-hook-schema.sh, test-hook.sh, hook-linter.sh) to ensure safe, reliable deployments.

Quick Start

Begin by inspecting the included scripts and references, then craft and validate your first prompt-based hook using the provided examples.

Frequently Asked Questions about hook-development

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

FAQPage Schema
How do I build Claude Code hooks to control tool usage and workflow automation?

Claude Code hooks are governed by defining structured JSON schemas for events like PreToolUse and Stop, then validating them with linter scripts to ensure safe execution. This Skill provides templates, validation scripts, and debugging guidance for reliable plugin development.

What hook events are supported for Claude Code plugin development?

Supported Claude Code hook events include PreToolUse, PostToolUse, Stop, and SessionStart. The Skill provides ready-to-use templates and best practices for implementing both prompt-based and command hooks across these full lifecycle events.

How do I validate a hooks.json configuration file before deploying a Claude Code plugin?

You validate a hooks.json configuration using built-in shell scripts like validate-hook-schema.sh and hook-linter.sh. These tools check JSON schemas, verify portable path references, and ensure secure hook execution before deployment.

Does Claude Code hook development require jq as a dependency?

Yes, jq is required as a dependency for Claude Code hook development. It is used within the provided validation, testing, and linting scripts to parse and validate JSON structures during hook execution and testing workflows.

Can I use prompt-based hooks instead of command hooks for Claude Code workflow automation?

Yes, you can use prompt-based hooks as an alternative to command hooks for Claude Code workflow automation. The Skill offers ready-to-use templates and patterns for both approaches, including specific workflows for SessionStart and Stop events.

How do I test Claude Code hooks with sample inputs during plugin development?

You test Claude Code hooks using the included test-hook.sh script alongside sample test inputs. This allows you to validate hook behavior, debug execution issues, and verify safe, auditable hook performance before real-world deployment.