hook-development

Implement Claude Code plugin hooks for PreToolUse, PostToolUse, and SessionStart events.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/angrybeagles/weather-dashboard --skill hook-development-angrybeagles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/angrybeagles/weather-dashboard/tree/main/.claude/plugins/marketplaces/claude-plugins-official/plugins/plugin-dev/skills/hook-development
Command: npx skills add https://github.com/angrybeagles/weather-dashboard --skill hook-development-angrybeagles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hooks are essential to enforce policy, automate workflows, and extend Claude Code with event-driven actions. They provide a structured way to validate tool usage, block unsafe commands, and automate responses.

Core Features & Use Cases

  • Comprehensive guidance for creating and implementing Claude Code plugin hooks, with emphasis on prompt-based hooks for flexibility.
  • Covers PreToolUse, PostToolUse, Stop, SessionStart, and other hook events, including examples and best practices.
  • Real-world use cases include validating tool calls, loading project context, and automating workflows across development lifecycles.

Quick Start

Create a prompt-based hook that validates a tool call and blocks unsafe actions.

Frequently Asked Questions about hook-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Claude Code plugin hooks for workflow automation?

Claude Code plugin hooks enable workflow automation by executing prompt-based or command actions during development lifecycle events. They provide a structured way to validate tool usage, block unsafe commands, and automate responses.

What is a PreToolUse hook and when do I need it for security validation?

A PreToolUse hook is an event-driven plugin mechanism for Claude Code that validates tool calls before execution. You need it for security validation to block unsafe commands and enforce policy prior to tool usage.

Can I use prompt-based hooks to load project context on SessionStart?

Yes, prompt-based hooks support loading project context during the SessionStart event in Claude Code. They offer flexibility for automating context initialization and event-driven integrations across sessions.

Does Claude Code support both prompt-based and command hooks for PostToolUse events?

Yes, Claude Code supports both prompt-based and command hooks for PostToolUse events. Prompt-based hooks offer flexibility for automating workflows, while command hooks execute specific actions after tool completion.

What is the best way to ensure portability when implementing Claude Code hooks?

The best way to ensure portability when implementing Claude Code hooks is to enforce safety using ${CLAUDE_PLUGIN_ROOT} references. This approach maintains consistent path resolution across different environments.

Why are my Claude Code plugin hooks not triggering on Stop events?

Claude Code plugin hooks may not trigger on Stop events if the hook configuration lacks proper event registration or uses invalid syntax. Ensure hooks are correctly mapped to the Stop event and enforce ${CLAUDE_PLUGIN_ROOT} for portability.