Keyflow

Search Keyflow

Find a shortcut, workflow, MCP server or skill

hook-development

Official · Anthropic

Installation

Terminal

git clone --depth 1 https://github.com/anthropics/claude-plugins-official.git /tmp/hook-development-src
cp -r /tmp/hook-development-src/plugins/plugin-dev/skills/hook-development ~/.claude/skills/hook-development

Or .claude/skills/hook-development to scope it to one repo.

Summary

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDEPLUGINROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced

Hook Development for Claude Code Plugins Overview Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows. Key capabilities: - Validate tool calls before execution (PreToolUse) - React to tool results (PostToolUse) - Enforce completion standards (Stop, SubagentStop) - Load project context (SessionStart) - Automate workflows across the development lifecycle Hook Types Prompt-Based Hooks (Recommended) Use LLM-driven decision making for context-aware validation: json { "type": "prompt", "prompt": "Evaluate if this tool use is appropriate: $TOOLINPUT", "timeout": 30 } Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse Benefits: - Context-aware decisions based on natural language reasoning - Flexible evaluation logic without bash script…

Questions

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDEPLUGINROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced

Claude Code: ~/.claude/skills/hook-development. Codex: ~/.agents/skills/hook-development. Antigravity: ~/.gemini/config/skills/hook-development. Use .claude/skills or .agents/skills inside a repo to scope it to one project.

More from anthropics/claude-plugins-official

Name
  1. access
  2. configure
  3. access
  4. configure
  5. claude-automation-recommender
  6. claude-md-improver
  7. claude-security
  8. cardputer-buddy
Buy me a coffee