Skip to content
anthropics avatar

Writing Hookify Rules

Guide to writing hookify rule files, covering frontmatter fields, event types, and regex pattern tips.

CCM score
76 of 100
skills.sh installs
8.2K
GitHub stars
48.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers rule file structure: YAML frontmatter fields (name, enabled, event, action, pattern, conditions) and the markdown message body
  • Explains four event types (bash, file, stop, prompt) with example patterns for dangerous commands, debug code, and sensitive files
  • Documents condition operators (regex_match, contains, equals, not_contains, starts_with, ends_with) that must all match for a rule to trigger
  • Designed for developers who need to create, refine, or disable .claude/hookify.*.local.md rules

Install

$ npx -y skills add anthropics/claude-plugins-official --skill writing-hookify-rules -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Writing Hookify Rules

Overview

Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in .claude/hookify.{rule-name}.local.md files.

Rule File Format

Basic Structure

---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---

Message to show Claude when this rule triggers.
Can include markdown formatting, warnings, suggestions, etc.

Frontmatter Fields

name (required): Unique identifier for the rule

  • Use kebab-case: warn-dangerous-rm, block-console-log
  • Be descriptive and action-oriented
  • Start with verb: warn, prevent, block, require, check

enabled (required): Boolean to activate/deactivate

  • true: Rule is active
  • false: Rule is disabled (won't trigger)
  • Can toggle without deleting rule

event (required): Which hook event to trigger on

  • bash: Bash tool commands
  • file: Edit, Write, MultiEdit tools
  • stop: When agent wants to stop
  • prompt: When user submits a prompt
  • all: All events

Details

Repository
github.com/anthropics/claude-plugins-official
Categories
Skill & Plugin Building, Code Review & Quality
First seen
May 16, 2026

Questions

What does the writing-hookify-rules skill do?

It guides you in writing hookify rules, which are markdown files with YAML frontmatter stored in .claude/hookify.{rule-name}.local.md. Each rule defines a pattern to watch for and a message shown to Claude when the pattern matches.

How do I install the writing-hookify-rules skill?

Run npx -y skills add anthropics/claude-plugins-official --skill writing-hookify-rules -y in a project. After that, the agent can help you create a hookify rule when you ask it to write one or configure hookify.

Where does writing-hookify-rules rank in its category?

It is in the Skill & Plugin Building category and ranks in the top 100 there. It helps with hookify rule syntax, event types, and pattern writing for rules that warn about or block agent actions.

Which events can a hookify rule trigger on?

The skill covers bash, file, stop, prompt and all events. Rules can match Bash commands, Edit, Write and MultiEdit operations, agent stop requests, or user prompts, and can set action to warn or block.

More from anthropics/claude-plugins-official

All 23

Similar to Writing Hookify Rules

More Skill & Plugin Building