Claude Code hook development (Anthropic)
SkillHow 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

Log in to join the discussion.