hook-developer

Document Claude Code hooks with schemas, registration, and testing patterns.

3.9k|296|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/parcadei/Continuous-Claude --skill hook-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-developer
Source: https://github.com/parcadei/Continuous-Claude/tree/main/.claude/skills/hook-developer
Command: npx skills add https://github.com/parcadei/Continuous-Claude --skill hook-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a complete reference for developing Claude Code hooks, including input/output schemas, registration, and testing patterns.

Core Features & Use Cases

  • Hook input/output schemas: Understand PreToolUse, PostToolUse, UserPromptSubmit, and more.
  • Registration guidance: Properly register hooks in settings.json and manage hook lifecycle.
  • Testing patterns: Learn how to validate hooks with examples and test stubs.

Quick Start

Review the PreToolUse schema example and register it in your project hooks configuration.

Frequently Asked Questions about hook-developer

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

FAQPage Schema
How do I create and register hooks in Claude Code?

Hooks are event handlers you register in settings.json to intercept Claude Code operations. PreToolUse and PostToolUse hooks validate or modify tool calls; other hooks like UserPromptSubmit, SessionStart, and PermissionRequest handle user input, session lifecycle, and permission flows. Register each hook with its schema and event type in your hooks configuration.

What input and output schemas do Claude Code hooks require?

Each hook type—PreToolUse, PostToolUse, UserPromptSubmit, PermissionRequest, SessionStart, SessionEnd, Stop, SubagentStop, PreCompact, and Notification—has a defined input schema that receives event data and an output schema that returns the hook's result. Schemas standardize how hooks receive context and return decisions or modifications.

How do I debug and test hooks before deploying them?

Test hooks using provided test stubs and validation patterns. Verify input schemas match event data, check output formats conform to the hook's schema, and validate lifecycle—hooks fire at correct stages and don't block critical operations. Testing patterns ensure hooks integrate safely without breaking Claude Code sessions.

Can I use hooks to control tool execution and permissions?

Yes. PreToolUse hooks intercept tools before execution to validate, block, or modify calls. PostToolUse hooks process results after execution. PermissionRequest hooks evaluate permission checks. Together they let you enforce policies, audit tool use, and manage access control across Claude Code operations.

How do hooks manage context and session lifecycle?

SessionStart and SessionEnd hooks fire at session boundaries; PreCompact hooks run before context compaction. These lifecycle hooks let you initialize state, clean up resources, and preserve context across compaction. Stop and SubagentStop hooks handle early termination in main and delegated agents.

What's the difference between PreToolUse and PostToolUse hooks?

PreToolUse intercepts tool calls before execution—use it to validate, block, or transform requests. PostToolUse runs after execution completes—use it to filter, log, or transform results. Together they bracket tool operations for comprehensive audit and control.