hook-creator

Create and validate Claude Code hooks with correct JSON and shell practices.

1|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/hjemmesidekongen/ai --skill hook-creator-hjemmesidekongen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/hjemmesidekongen/ai/tree/main/plugins/kronen/skills/hook-creator
Command: npx skills add https://github.com/hjemmesidekongen/ai --skill hook-creator-hjemmesidekongen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation and debugging of Claude Code hooks, ensuring they are correctly implemented, registered, and function as expected, preventing silent failures and improving automation reliability.

Core Features & Use Cases

  • Hook Creation: Generate new hooks for various event types (PreToolUse, SessionStart, etc.) and hook types (command, prompt, http, agent).
  • Debugging & Validation: Identify and fix issues with existing hooks, ensuring correct event triggering, JSON output, and registration in plugin.json.
  • Use Case: You need to add a PreToolUse hook to block the Write tool if a specific file pattern is detected. This Skill will help you create the bash script, define the JSON structure, and register it correctly in your plugin.json.

Quick Start

Use the hook-creator skill to create a new command hook for the SessionStart event.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I create a Claude Code hook for the PreToolUse event?

Claude Code hook creation involves generating a bash script for your target event, defining the correct JSON output structure, and registering the hook correctly in your plugin.json file to ensure proper event triggering.

Why does my Claude Code hook fail silently without triggering?

Claude Code hooks fail silently due to incorrect event type registration, invalid JSON output formats, or improper exit codes in the shell script, requiring detailed validation checks to identify and fix.

What are the supported event types for Claude Code plugin hooks?

Claude Code plugin hooks support 18 event types including PreToolUse and SessionStart, accommodating command, prompt, HTTP, and agent hook types to intercept and extend automation workflows.

How do I validate JSON schema compliance for Claude Code hooks?

Validating JSON schema compliance for Claude Code hooks requires running detailed validation checks on script registration, JSON output formats, and execution behavior to ensure they meet shell best practices.

Can I use an HTTP hook type to block the Write tool in Claude Code?

You can use command, prompt, HTTP, or agent hook types to block the Write tool by creating a PreToolUse hook that detects specific file patterns and outputs the correct JSON to halt execution.