hook-development

Create and implement Claude Code plugin hooks for lifecycle events.

5|2|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/OshanKHZ/oshankhz-claude-code --skill hook-development-oshankhz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/OshanKHZ/oshankhz-claude-code/tree/main/.claude/skills/hook-development
Command: npx skills add https://github.com/OshanKHZ/oshankhz-claude-code --skill hook-development-oshankhz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and examples (resource) and scripts (resource) components.

What problem does it solve?

This skill provides guidance to create and implement Claude Code plugin hooks for events such as PreToolUse, PostToolUse, Stop, SessionStart, and more. It covers prompt-based and command hooks, with best practices for lifecycle management.

Core Features & Use Cases

  • Prompt-based hooks for complex validation and decision making
  • Command hooks for deterministic checks and automation
  • Events coverage: PreToolUse, PostToolUse, Stop, SessionStart, SessionEnd, etc.
  • Migration guidance from basic to advanced hooks
  • Wiring with plugin hooks.json and scripts

Quick Start

  1. Define relevant events in hooks.json
  2. Create a prompt-based hook for PreToolUse
  3. Add a command hook with a script in hooks/scripts
  4. Test using claude --debug and reload session