c/agents › command
0votes

Claude Code hook development (Anthropic)

Skill
submitted by CommandVault editors to c/agents · 2 uses

How to write Claude Code hooks that validate, block or automate tool use.

A detailed guide to Claude Code hooks: every event type (PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit and others), config formats, input and output JSON, matchers, environment variables and prompt-based hooks. It includes security advice, example hooks and validation scripts. Useful for blocking dangerous commands or automating checks.

Try asking:

  • "Add a hook that blocks rm -rf in this project"
  • "Run prettier automatically after every file edit"
  • "Write a Stop hook that makes Claude run tests before finishing"

Source: anthropics/claude-plugins-official · Apache-2.0 · by Anthropic

0 commentsreport

Install this skill

Agent Skills are folders with a SKILL.md file. Most AI coding tools load them automatically when a task matches the description. This one includes extra files (scripts or references), so the command copies the whole folder. Tip: .agents/skills/ is read by Codex, Cursor, Copilot, Gemini CLI, Grok and Windsurf.

One command
npx commandvault add claude-code-hook-development-anthropic-0dac2d77 --tool claude
Easiest: install as a Claude Code plugin (stays up to date)
/plugin install plugin-dev@claude-plugins-official
Install (run in your project folder)
npx degit anthropics/claude-plugins-official/plugins/plugin-dev/skills/hook-development .claude/skills/hook-development

Use it: Claude uses it automatically when a task matches, or type /hook-development.

From Claude Code's docs , checked Oct 17, 2026.

Made by Anthropic, Apache-2.0 license. Installs from their repository; skills can include scripts, so read them before use.

In the Claude apps, zip the folder and upload it under Settings → Capabilities → Skills.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.