Dev & Engineering ✓ Anthropic · Official

Claude Code Hook Development (claude-code)

Build controlled, testable event automation for Claude Code plugins.

42/ 100
Not recommended

Current benefit does not outweigh risk or uncertainty.

See how it was scored ↓
Works as-is in
Claude Code
Stars
★ 151k
Last updated
11d ago
hook-developmentevent-driven-automationtool-validationprompt-hooks
+2bash-scriptingsecurity-validation

What does this skill do, and when should you 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.

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

How do you install this skill?

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.
Before you start
Your agent needs
  • Shell / CLI
  • Local filesystem
Install first
  • Claude Code
  • Bash
  • jq

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.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/anthropics/claude-code.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/plugins/plugin-dev/skills/hook-development" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • create a hook
  • add a PreToolUse hook,

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.

What are this skill's strengths and limitations?

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 does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
Claude Code Hook Development (claude-code) this page ✓ Anthropic · Official 42 · Not recommended ★ 151k 11d ago —
Claude Code Hook Development (official plugins) ✓ Anthropic · Official 53 · Use with care ★ 38k 11d ago Apache-2.0
TDD Guard 61 · Recommended ★ 2.4k 13d ago MIT
Loki Mode Autonomous SDLC Skill 53 · Use with care ★ 1.1k 17d ago NOASSERTION
SkillCheck Free 64 · Recommended ★ 41 14d ago MIT

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Not recommended
42/ 100 5-point scale 2.1 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust11 / 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.

2Reliability6 / 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.

3Adaptability8 / 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.

4Convention7 / 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.

5Effectiveness6 / 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.

6Verifiability4 / 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.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 015170d3fd84 Review evidence[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

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

Dev & Engineering ✓ Anthropic · Official

Claude Code Command Development

Design reusable, interactive slash commands for Claude Code.

★ 151k FS 46 Use with care 11d ago
Dev & Engineering ✓ Anthropic · Official

Claude Code Skill Development

A practical guide to creating, organizing, and validating Claude Code plugin skills.

★ 151k FS 46 Use with care 11d ago
Dev & Engineering ✓ Anthropic · Official

Hookify Rule Writer

Guides Claude Code users in writing Hookify rules that warn about or block matching actions.

★ 151k FS 45 Not recommended 11d ago
Dev & Engineering ✓ Anthropic · Official

Claude Code Plugin Agent Development

A practical guide to designing, writing, validating, and testing autonomous agents for Claude Code plugins.

★ 151k FS 47 Use with care 11d ago
Dev & Engineering ✓ Anthropic · Official

Claude Code Plugin Settings Pattern

Store and read project-specific plugin configuration in local Markdown state files.

★ 151k FS 45 Not recommended 11d ago
Dev & Engineering ✓ Anthropic · Official

Opus 4.5 Migration Assistant

Move existing Claude model integrations to Opus 4.5.

★ 151k FS 40 Not recommended 11d ago
Dev & Engineering ✓ Anthropic · Official

Claude Code Plugin Structure Guide

A practical guide to organizing, configuring, and troubleshooting Claude Code plugins.

★ 151k FS 50 Use with care 11d ago
Dev & Engineering ✓ Anthropic · Official

Claude Code MCP Integration

Configure external MCP services and tools for Claude Code plugins.

★ 151k FS 49 Use with care 11d ago

Related skills