hook-development

Create and govern Claude Code hooks for plugin development.

10|2|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/mahmoud20138/Tradecraft --skill hook-development-mahmoud20138
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-development
Source: https://github.com/mahmoud20138/Tradecraft/tree/main/plugins/tradecraft/skills/hook-development
Command: npx skills add https://github.com/mahmoud20138/Tradecraft --skill hook-development-mahmoud20138

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hook development provides a structured approach to designing, validating, and deploying event-driven Claude Code hooks for plugins, ensuring automated governance and safe tool usage.

Core Features & Use Cases

  • Supports both Prompt-Based and Command-based hooks for flexible automation and deterministic checks.
  • Documents standard hook events (PreToolUse, PostToolUse, SessionStart, SessionEnd, Stop, SubagentStop, UserPromptSubmit, PreCompact, Notification) and how to configure them in plugin hooks.json or user settings.
  • Guides on organizing hook scripts and references, testing, debugging, and best practices for robust plugin development.

Quick Start

Create a new hook by editing hooks/hooks.json and adding a script in scripts/ to implement it, then restart Claude Code to load the change.

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 hooks for plugin development?

To create Claude Code hooks, edit the hooks/hooks.json file and add a corresponding script in the scripts/ directory to implement it, then restart Claude Code to load the changes.

What is the difference between prompt-based and command-based hooks?

Prompt-based hooks provide flexible automation, while command-based hooks execute deterministic checks for safe tool usage. Both configurations are supported within the hooks.json structure for robust plugin development.

Which hook events can I configure for Claude Code automation?

You can configure standard hook events including PreToolUse, PostToolUse, SessionStart, SessionEnd, Stop, SubagentStop, UserPromptSubmit, PreCompact, and Notification within plugin or user settings.

Can I apply Claude Code hooks at both plugin and user levels?

Yes, hook configurations support both plugin-level and user-level settings. You define them in plugin hooks.json or user settings to apply automated governance and validation across different scopes.

What is the best way to debug and validate Claude Code hooks?

The best way to debug hooks is to follow documented best practices for organizing hook scripts and references, ensuring proper script placement in scripts/ and validating configurations in hooks.json.

Do I need a specific directory structure for Claude Code hook scripts?

Yes, you need to place hook scripts in the scripts/ directory and reference them properly in hooks.json. This structure ensures scripts are loaded correctly when Claude Code restarts.