Dev & Engineering ✓ Anthropic · Official claude-code-hooksevent-driven-automationprompt-based-hookstool-validationplugin-developmentbash-scripting

Claude Code Hook Development

Design, configure, validate, and debug event-driven hooks for Claude Code plugins.

FollowSkills review · FSRS-2.0
Not recommended
53/ 100 5-point scale 2.7 / 5
Trust15 / 25 · 3.0/5

The material emphasizes input validation, path safety, quoting, timeouts, and user confirmation, and warns against logging sensitive information. However, examples for Slack, databases, metrics, and audit logging transmit or persist tool inputs, commands, user data, or environment data without consent, least-privilege, redaction, access-control, or rollback guidance. validate-write.sh also interpolates an unescaped path into JSON, risking malformed output or injection. Points are deducted for incomplete data-flow transparency, isolation, and recovery.

Reliability8 / 20 · 2.0/5

The skill covers configuration, events, inputs, exit codes, and debugging, with several example scripts. However, it first says plugin hooks.json requires a hooks wrapper, while a later plugin configuration example uses top-level events, creating a key configuration contradiction. The prompt-hook supported-event list conflicts with the PostToolUse prompt example. Several referenced validation and test scripts are not included in the supplied material. Examples also use fragile string matching, omit symlink and path-boundary handling, and the linter may terminate early under set -e because of ((warnings++)). Static evidence is insufficient, so the score is conservative.

Adaptability9 / 15 · 3.0/5

The audience, trigger phrases, major events, and command/prompt scenarios are reasonably clear. Boundaries, non-fit cases, dependency installation, permission prerequisites, and Claude Code version differences are not systematically stated. The material is primarily English and Bash/Unix-oriented, with no Chinese guidance or examples; it relies on Claude Code, bash, jq, and potentially overseas model/services, without explaining mainland-China reachability or fallback behavior.

Convention9 / 15 · 3.0/5

The skill has a name, description, version, layered sections, examples, references, and a debugging workflow. Repository material supplies Apache-2.0 licensing, official maintenance provenance, and installation guidance. Points are deducted because there is no changelog, compatibility matrix, dependency-installation guidance, explicit support/update channel, or complete troubleshooting coverage. Several referenced references, examples, and utility scripts are not fully verifiable from the supplied files, and some configuration examples are inconsistent.

Effectiveness7 / 15 · 2.3/5

It provides directly adaptable configurations and script patterns for common PreToolUse, Stop, and SessionStart hooks, so the core task is plausible on the happy path. However, prompt-hook decision reliability, parallel-execution semantics, output formats, and permission behavior lack observed results; the security examples can produce false positives or false negatives, and some scripts should not be treated as production-ready without review. Static calibration caps effectiveness at 7.

Verifiability5 / 10 · 2.5/5

The material includes concrete configurations, scripts, test commands, a linter, and auditable repository CI and license evidence, providing limited reproducibility. No scripts were executed, and there are no real test outputs, coverage results, CI tests covering this skill's key paths, or independent corroborating sources. The listed CI mainly concerns repository plugins and MCP URL liveness, not this skill's behavior. Static calibration caps verifiability at 5.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision b0b9f02b0581
Before you use it
  • Do not deploy the Slack, database, metrics, or audit-log examples directly; establish consent, data minimization, redaction, credential protection, and access controls first.
  • Resolve the hooks.json wrapper-versus-top-level format conflict and verify event support, fields, decision outputs, and parallel semantics for the installed Claude Code version.
  • Treat the scripts as instructional examples: add JSON escaping, canonical path and symlink protection, robust command parsing, dependency checks, and recoverable failure handling.
  • The supplied material does not prove that validate-hook-schema.sh, test-hook.sh, and other referenced utilities exist or run; verify them at the exact revision before installation.
  • For mainland-China users, confirm reachability of Claude Code, model services, and external integrations, and provide a no-external-service fallback.
See the full review method →

What it does & when to use it

Hook Development is the hook-development skill under the repository’s plugin-dev plugin. It provides implementation guidance for Claude Code plugin hooks, including prompt-based and command hooks, event matchers, structured input and output, security checks, and lifecycle behavior. It fits developers who need to validate tool calls, block risky operations, load project context, or verify completion. Because it relies on Claude Code hook configuration and CLI debugging, other clients require adaptation.

It explains how to configure hooks in hooks/hooks.json or .claude/settings.json; define matchers for PreToolUse, PostToolUse, Stop, SubagentStop, UserPromptSubmit, SessionStart, SessionEnd, PreCompact, and Notification; configure prompt and command hooks; read JSON event data from stdin; and produce structured JSON decisions, feedback, or system messages. It also references Bash, jq, ${CLAUDE_PLUGIN_ROOT}, claude --debug, and supplied schema-validation, testing, and lint scripts.

  1. A Claude Code plugin developer needs to check path traversal, credentials, or sensitive files before Write or Edit runs.
  2. A team wants Stop or SubagentStop hooks to verify tests, builds, and task completeness.
  3. A developer needs SessionStart to load project context and persist environment variables.
  4. A plugin needs matcher-based policies for MCP tools, Bash commands, or file operations.
  5. A maintainer wants to enable strict validation temporarily through a flag file or configuration file.

Pros & cons

Pros
  • Covers major hook events, configuration formats, input and output structures, and exit codes.
  • Explains both recommended prompt hooks and deterministic command hooks.
  • Includes practical guidance on path safety, input validation, quoting, timeouts, and parallel execution.
  • Documents supplied validation, testing, linting, and example scripts.
Limitations
  • It is specifically oriented toward Claude Code plugin hooks rather than a general Agent Skills hook standard.
  • Hooks load at session start, so configuration or script changes require restarting Claude Code.
  • Matching hooks run in parallel without shared output or guaranteed ordering.
  • The supplied material provides no cross-platform test results and does not establish that every example works in every environment.

How to install

The skill is located at plugins/plugin-dev/skills/hook-development/SKILL.md. The repository README says plugins can be installed in Claude Code with /plugin install {plugin-name}@claude-plugins-official or discovered through /plugin > Discover; the supplied material does not specify a standalone installation command or exact plugin name for this skill.

How to use

In Claude Code, ask for tasks such as “create a hook,” “add a PreToolUse hook,” “block dangerous commands,” or “implement prompt-based hooks.” Choose a prompt or command hook, edit hooks/hooks.json, use ${CLAUDE_PLUGIN_ROOT} in command paths, then run scripts/validate-hook-schema.sh hooks/hooks.json and scripts/test-hook.sh; use claude --debug for runtime testing. Restart Claude Code after hook configuration changes.

FAQ

Can this skill be installed separately?
The material explains installation for the marketplace collection but does not provide a standalone installation command or exact plugin name for hook-development.
When should I use a prompt hook versus a command hook?
Use prompt hooks for context-aware reasoning and command hooks for fast deterministic checks, filesystem operations, or external integrations.
Do hook changes take effect in the current session?
No. Hooks load when the session starts, so configuration, script, and prompt changes require exiting and restarting Claude Code.
How can a hook block a dangerous operation?
Use a PreToolUse hook to inspect tool input and return allow, deny, or ask. Command hooks should validate inputs, check paths and sensitive files, and return structured JSON.

More skills from this repository

All from anthropics/claude-plugins-official

Productivity & Collaboration ✓ Anthropic · Official

Project Status Artifact

Turn complex, multi-stream work into a living project status page.

Design & Frontend ✓ Anthropic · Official

Distinctive Frontend Design

Build an intentional visual identity for interfaces that should not feel templated.

Dev & Engineering ✓ Anthropic · Official

MCP Interactive App Builder

Add chat-embedded forms, pickers, dashboards, and confirmation widgets to MCP servers.

Dev & Engineering ✓ Anthropic · Official

Claude Skill Template Example

A reference for understanding and creating Claude Code plugin skill templates.

Dev & Engineering ✓ Anthropic · Official

MCPB Local Server Packager

Bundle a local MCP server with its runtime into one installable file.

Dev & Engineering ✓ Anthropic · Official

Claude Code Receipts

Turn local Claude Code sessions and Git history into a shareable impact report.

Design & Frontend ✓ Anthropic · Official

Playground Builder

Turn complex visual or structural choices into a live, self-contained HTML explorer.

Dev & Engineering ✓ Anthropic · Official

MCP Server Builder

Helps developers choose the right MCP deployment, tool pattern, framework, and authentication before writing code.

Dev & Engineering ✓ Anthropic · Official

Claude Code Agent Development Guide

Design, write, and validate autonomous agents for Claude Code plugins.

Automation & Ops ✓ Anthropic · Official

Discord Channel Access

Manage Discord pairings, allowlists, and DM or group policies through a local JSON configuration.

Dev & Engineering ✓ Anthropic · Official

CLAUDE.md Improver

Audit and precisely improve CLAUDE.md files across a repository.

Dev & Engineering ✓ Anthropic · Official

Skill Creator

Create, evaluate, and iteratively improve Agent Skills.

Dev & Engineering ✓ Anthropic · Official

MCP Integration for Claude Plugins

Configure MCP servers in Claude Code plugins to connect external services and expose their tools.

Dev & Engineering ✓ Anthropic · Official

Claude Code Plugin Skill Development

A practical guide to designing, writing, organizing, validating, and testing skills for Claude Code plugins.

Dev & Engineering ✓ Anthropic · Official

Claude Automation Advisor

Analyze a codebase and identify the most useful Claude Code automations for the project.

Dev & Engineering ✓ Anthropic · Official

Math Olympiad Adversarial Solver

Solve and stress-test IMO, Putnam, USAMO, and AIME problems with adversarial proof verification.

Dev & Engineering ✓ Anthropic · Official

Claude Code Plugin Blueprint

A practical guide to structuring plugins, configuring manifests, and organizing Claude Code components.

Dev & Engineering ✓ Anthropic · Official

Project Plugin Settings Pattern

Store and read configurable Claude Code plugin settings in project-local Markdown files.

Automation & Ops ✓ Anthropic · Official

M5Stack Onboarding

Detect, flash, and provision M5Stack ESP32 boards with UIFlow firmware and MicroPython apps.

Automation & Ops ✓ Anthropic · Official

Discord Channel Configurator

Save a Discord bot token and lock down channel access.

Related skills