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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement Claude Code plugin hooks reliably so your automations can validate, control, and respond to tool usage without fragile trial-and-error.

Core Features & Use Cases

  • Prompt-based hook logic: Create context-aware validation for events like PreToolUse, Stop, SubagentStop, and UserPromptSubmit.
  • Command hooks for deterministic checks: Add bash-based validation and automation for fast, repeatable enforcement using plugin-relative paths.
  • Correct configuration & outputs: Implement plugin hooks.json (wrapped in a hooks field) and produce the expected decision/output JSON and exit codes.
  • Lifecycle and safety guardrails: Understand hook loading at session start, timeouts, environment variables, and debugging/testing workflows.

Quick Start

Ask the AI to design a PreToolUse prompt hook that blocks file writes to sensitive paths and returns an allow/deny decision with a clear system message.

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 for tool validation and event-driven automation?

Claude Code hooks for tool validation are created by designing event-driven logic for events like PreToolUse or Stop, then mapping these to a correctly formatted hooks.json configuration that outputs specific decision JSON and exit codes.

What is the correct hooks.json format for Claude Code plugin development?

The correct hooks.json format for Claude Code plugins requires wrapping your hook configurations inside a hooks field, ensuring proper event mapping, input/output JSON schemas, and portable command execution via variables like ${CLAUDE_PLUGIN_ROOT}.

Can I use prompt-based hooks to block file writes to sensitive paths in Claude Code?

Yes, you can implement context-aware PreToolUse prompt hooks to block file writes to sensitive paths by returning an allow/deny decision with a clear system message to enforce safety guardrails.

How does Claude Code handle hook loading, timeouts, and debugging workflows?

Claude Code handles hook loading at session start, enforces timeouts, exposes environment variables, and provides debugging and testing workflows to manage lifecycle events and ensure deterministic command execution.

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

Prompt-based hooks provide context-aware validation for events like UserPromptSubmit, while command hooks execute deterministic bash-based checks using plugin-relative paths for fast, repeatable automation enforcement.

Why are my Claude Code plugin hooks failing to execute or timing out?

Claude Code plugin hooks fail or time out when the hooks.json configuration lacks the required hooks wrapper, violates input/output JSON schemas, or uses non-portable execution paths instead of ${CLAUDE_PLUGIN_ROOT}.