Writing Hookify Rules

Create YAML frontmatter hookify rules for Claude events.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/Takeaki0817/hibioru --skill writing-hookify-rules-takeaki0817
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/Takeaki0817/hibioru/tree/main/.claude/skills/rule-identifier
Command: npx skills add https://github.com/Takeaki0817/hibioru --skill writing-hookify-rules-takeaki0817

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hookify rules provide a structured, frontmatter-driven way to shape Claude's behavior by watching for specific patterns and emitting contextual messages. This skill enables teams to create local, reusable rule definitions that govern interactions without hard-coding behavior in prompts.

Core Features & Use Cases

  • Define YAML-frontmatter based hook rules that map patterns to responses and warnings.
  • Support single-condition and multi-condition rule definitions across events such as bash, file, stop, and prompt.
  • Store rules locally as .claude/hookify.{rule-name}.local.md to enable project-specific customization without affecting core models.

Quick Start

Create a new local rule file at the project root, e.g. .claude/hookify.example.local.md, with a frontmatter block specifying name, enabled, event, and pattern, followed by a message body describing what Claude should display when the rule triggers. Then test by triggering the corresponding event to see the rule in action.

Frequently Asked Questions about Writing Hookify Rules

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

FAQPage Schema
How do I create custom rules to govern Claude's behavior using YAML frontmatter?

You can create custom rules for Claude by defining YAML frontmatter with name, enabled, event, and pattern fields in a .claude/hookify.{rule-name}.local.md file, followed by a message body for Claude to display when the rule triggers.

What events can I target when defining hook rules for Claude responses?

Hook rules for Claude responses can target bash, file, stop, and prompt events, allowing you to define single-condition or multi-condition patterns that watch for specific triggers and emit contextual messages.

How do I set up a local hookify rule file for project-specific Claude customization?

To set up a local hookify rule file, create a markdown file at your project root named .claude/hookify.{rule-name}.local.md, add the required YAML frontmatter schema, write your message body, then trigger the corresponding event to test it.

Can I apply multiple conditions to a single Claude hook rule?

Yes, hookify rules support both single-condition and multi-condition pattern definitions, allowing you to map multiple pattern triggers to a single response or warning message within your local rule file.

Why use frontmatter-based hook rules instead of hard-coding behavior in prompts?

Using frontmatter-based hook rules provides a structured, reusable way to shape Claude's behavior without hard-coding it in prompts, enabling local project-specific customization that does not affect the core model.

What limitations exist when using local hookify rule definition files?

Local hookify rule definition files are limited to project-specific customization stored under .claude/hookify.{rule-name}.local.md, enforcing a strict frontmatter schema and relying on pattern matching across bash, file, stop, and prompt events to trigger messages.

Related Skills