create-hook

Generate shell scripts and register custom Claude Code hooks in hooks.json.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/LayerDynamics/Lore --skill create-hook-layerdynamics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/LayerDynamics/Lore/tree/main/lore/skills/create-hook
Command: npx skills add https://github.com/LayerDynamics/Lore --skill create-hook-layerdynamics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of creating, managing, and authoring custom Claude Code hooks, ensuring consistency and reducing manual configuration errors.

Core Features & Use Cases

  • Guided Hook Creation: Walks users through selecting hook events, configuring tool matchers, and defining hook behavior.
  • Script Generation: Automatically creates the basic shell script structure for the hook.
  • Registration: Updates hooks.json to register the new hook.
  • Use Case: You need to create a new hook that prevents users from running Bash commands that contain sensitive keywords. This skill will guide you through defining the event (PreToolUse), the matcher (Bash), and the script logic to detect and block the command.

Quick Start

Use the create-hook skill to make a new hook named 'block-sensitive-commands'.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I create Claude Code hooks for workflow automation?

Claude Code hooks are created by defining event triggers, tool matchers, and shell scripts. This Skill automates hook creation by guiding event selection, configuring matchers, generating scripts, and updating hooks.json for deterministic workflow automation.

What events can I use to trigger custom Claude Code hooks?

Claude Code hooks support PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, and Stop events. Optional tool matching allows hooks to execute deterministically when specific tools are invoked during automation workflows.

How do I block sensitive Bash commands using PreToolUse hooks?

Blocking sensitive Bash commands requires a PreToolUse hook with a Bash matcher and a script to detect restricted keywords. This Skill guides event selection, matcher configuration, and script generation to prevent execution of unauthorized commands.

Do I need to manually edit hooks.json to register new hooks?

Manual hooks.json edits are unnecessary. This Skill automatically generates the shell script structure and updates hooks.json to register the new hook, ensuring configuration consistency and reducing manual errors during workflow setup.

Can I match specific tools like Bash when configuring Claude Code hooks?

Tool matching is fully supported during hook configuration. You can specify matchers like Bash to ensure your PreToolUse or PostToolUse hooks only execute when the targeted tool is called, enabling precise workflow automation control.

What's the best way to automate hook registration for Claude Code events?

Automating hook registration involves selecting events, configuring matchers, and generating scripts. This Skill streamlines the process by walking through event selection and automatically updating hooks.json, eliminating manual configuration errors.