Dev & Engineering ✓ Anthropic · Official hook-developmentevent-driven-automationtool-validationprompt-hooksbash-scriptingsecurity-validation

Claude Code Hook Development

Build controlled, testable event automation for Claude Code plugins.

FollowSkills review · FSRS-2.0
Not recommended
42/ 100 5-point scale 2.1 / 5
Trust11 / 25 · 2.2/5

The documentation covers input validation, path safety, variable quoting, timeouts, permission confirmation, and sensitive-file warnings, and recommends CLAUDE_PLUGIN_ROOT for portability. Deductions apply because examples send raw input to Slack, databases, and audit logs without consent, least-privilege guidance, redaction, rollback, or recovery procedures; an administrator bypass and predictable /tmp state files further weaken the security model.

Reliability6 / 20 · 1.5/5

The skill specifies events, input fields, exit codes, debugging methods, and a testing workflow; example scripts use set -euo pipefail and some empty-input checks. Deductions apply because static material does not prove key paths run successfully, and several examples depend on jq, the Claude Code runtime, external commands, or scripts not otherwise supplied; some output-format and parallel/sequential behavior claims may be inconsistent, while abnormal-input, timeout, and missing-dependency diagnostics are thin.

Adaptability8 / 15 · 2.7/5

Trigger phrases, supported events, and use cases for command and prompt hooks are clearly described, covering validation, context loading, stop checks, and notifications. Deductions apply because non-fit scenarios, runtime-version boundaries, platform differences, and prompt-hook reliability limits are not clearly defined; there is no Chinese-language guidance or mainland-China reachability assessment, and external integrations may depend on network access.

Convention7 / 15 · 2.3/5

The material has useful information architecture with overview, events, configuration formats, patterns, examples, script documentation, debugging, limitations, and workflow; the skill declares version 0.1.0, while the repository supplies README, LICENSE, and security-policy material. Deductions apply because the skill metadata does not declare a license, lacks a changelog, named maintenance responsibility, and explicit update path, and provides no compatibility matrix; some advanced examples present high-risk practices as copyable templates.

Effectiveness6 / 15 · 2.0/5

The skill provides reusable JSON configurations, shell examples, an event reference, migration guidance, and a testing workflow that can cover the core task of creating common Claude Code hooks. Deductions apply because static review cannot verify actual event semantics, outputs, or runtime behavior; users must supply plugin structure, dependencies, and environment details, and heuristic security policies still require substantial review and modification for complex cases.

Verifiability4 / 10 · 2.0/5

The material includes concrete configurations, scripts, test commands, debug commands, and repository CI evidence, giving some claims an auditable basis. Deductions apply because the supplied files contain no real CI coverage for this skill's key paths or third-party execution evidence; the testing material is largely illustrative and does not cover prompt hooks, event compatibility, parallel behavior, or external integrations, so static verifiability remains limited.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 015170d3fd84
Before you use it
  • Do not copy the Slack, database, or audit-logging examples directly; first define data scope, redaction, user consent, credential protection, and network-egress policy.
  • Verify prompt-hook and event-output semantics against the target Claude Code version's official documentation, then test in an isolated project.
  • Examples depend on jq, Claude Code environment variables, and external tools; missing dependencies, Windows compatibility, symlinks, complex shell commands, and parallel-hook behavior require additional validation.
  • The skill metadata does not clearly state licensing, changelog, or maintenance ownership; confirm version and update provenance before adoption.
See the full review method →

What it does & when to use it

This skill guides developers in creating and configuring hooks for Claude Code plugins. It focuses on prompt-based hooks for context-aware decisions and also covers command hooks for deterministic checks and external tool integration. It explains hooks.json formats, matchers, JSON input and output, environment variables, security validation, debugging, and testing. It is best suited to developers building plugins that control tool use, load project context, or automate development workflows.

Guides users to configure PreToolUse, PostToolUse, Stop, SubagentStop, UserPromptSubmit, SessionStart, SessionEnd, PreCompact, and Notification events in hooks/hooks.json or user settings; write prompt-based or Bash command hooks; read session, tool, and prompt data from standard input; return structured JSON for approval, denial, asking, blocking, or system messages; use ${CLAUDE_PLUGIN_ROOT}, $CLAUDE_PROJECT_DIR, and $CLAUDE_ENV_FILE; and validate, test, and lint hooks with jq, claude --debug, and the repository's provided scripts.

  1. A plugin developer needs to check sensitive files, path traversal, or dangerous operations before Write or Edit runs.
  2. A team wants to analyze tool results, log activity, or provide feedback to Claude after a tool completes.
  3. A project maintainer needs to load project context and persist environment variables at session start.
  4. A developer wants to verify tests, builds, and task completeness before the agent stops.
  5. A plugin author needs prompt hooks for complex decisions and command hooks for fast deterministic checks.

Pros & cons

Pros
  • Covers hook events, configuration formats, inputs, outputs, and lifecycle behavior.
  • Explains when to use prompt-based versus command hooks.
  • Includes guidance on path safety, input validation, quoting, timeouts, and parallel execution.
  • Points to validation, testing, and linting utilities.
Limitations
  • It is explicitly focused on Claude Code plugins and requires adaptation for other clients.
  • The source provides no standalone installation procedure or test results for this skill.
  • Hooks load at session start, so configuration changes require restarting Claude Code.
  • Matching hooks run in parallel and have no guaranteed order, so hooks cannot rely on each other's output.
  • The README does not state pricing or a license; the repository license is listed as unknown.

How to install

The README documents installation of Claude Code itself: on macOS/Linux, run curl -fsSL https://claude.ai/install.sh | bash or use brew install --cask claude-code; on Windows, run irm https://claude.ai/install.ps1 | iex or use winget install Anthropic.ClaudeCode. Then enter a project directory and run claude. The source does not document a separate installation or placement procedure for this skill.

How to use

In a Claude Code plugin-development context, ask for something like “create a hook” or “add a PreToolUse hook,” specifying the event and validation logic. Configure the hook in hooks/hooks.json, use ${CLAUDE_PLUGIN_ROOT} for command paths, restart Claude Code after changes, and test with claude --debug plus the repository's validation and testing scripts.

FAQ

Can this skill be installed independently?
The source only documents installation of Claude Code and the plugin collection; it does not provide independent installation or folder-placement instructions for this skill.
What runtime does a command hook need?
The examples use Bash, and the security-validation examples use jq; no version requirements are stated.
Can hooks block dangerous tool calls?
Yes. A PreToolUse hook can return allow, deny, or ask and can provide updated input; command hooks can also report a blocking error with exit code 2.
Why do hook changes not take effect immediately?
Hooks are loaded when the Claude Code session starts, so configuration or script changes require exiting and restarting the session.

More skills from this repository

All from anthropics/claude-code

Related skills