Hook Development

Create Claude Code hooks for event-driven validation and workflow automation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JupitLunar/website --skill hook-development-jupitlunar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Hook Development
Source: https://github.com/JupitLunar/website/tree/main/.agent/skills/hook-development
Command: npx skills add https://github.com/JupitLunar/website --skill hook-development-jupitlunar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

Hook Development provides a structured approach for building reliable Claude Code hooks that validate tool usage, enforce safety policies, and orchestrate event-driven automation within plugins.

Core Features & Use Cases

  • Supports a spectrum of hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd) to perform validation, context loading, and workflow automation.
  • Provides guidance on hook types (prompt-based and command) and flexible configuration formats for robust plugin integration.
  • Enables secure, scalable automation by enforcing policies, standardizing outputs, and simplifying testing and debugging across plugin lifecycles.

Quick Start

To begin, define your hooks in hooks/hooks.json, implement supporting scripts under scripts/, validate the configuration with the provided tooling, and run Claude Code in debug mode to observe loading and execution.

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 to validate tool use?

Claude Code hooks are automated triggers that validate tool use by intercepting events like PreToolUse and PostToolUse. You create them by defining JSON configurations and supporting scripts to enforce safety policies and orchestrate event-driven workflows.

What is the difference between PreToolUse and PostToolUse hook events?

PreToolUse and PostToolUse are Claude Code hook events for validating tool use. PreToolUse intercepts actions before execution to enforce safety policies, while PostToolUse handles responses and loads context after the tool completes its operation.

How do I configure timeout controls for Claude Code hooks?

Claude Code hooks support timeout controls through JSON definitions in hooks/hooks.json. You configure timeout parameters alongside prompt and command hook types to ensure automated workflows execute reliably without hanging during event processing.

Does Claude Code hook development require jq?

Yes, jq is a required dependency for hook development. The Skill uses jq to parse structured JSON outputs from hook commands, enabling reliable event-driven automation and policy validation within the Claude Code plugin ecosystem.

Can I use prompt-based hooks and command hooks together in one plugin?

Yes, Claude Code supports combining prompt-based and command hook types within a single plugin configuration. This flexible format allows you to mix hook types to automate context loading, validate tool use, and handle responses across events.

How do I debug Claude Code hooks that are not working?

To debug Claude Code hooks not working, run Claude Code in debug mode to observe hook loading and execution. Validate your hooks/hooks.json configuration with provided tooling to ensure JSON definitions, script paths, and structured outputs are correct.

Related Skills