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
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.mdrules
Install
$ npx -y skills add anthropics/claude-plugins-official --skill writing-hookify-rules -yInstalls 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 activefalse: Rule is disabled (won't trigger)- Can toggle without deleting rule
event (required): Which hook event to trigger on
bash: Bash tool commandsfile: Edit, Write, MultiEdit toolsstop: When agent wants to stopprompt: When user submits a promptall: 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- Plugin Structure8.2K
- Plugin Settings8.1K
- Build Mcp Server8.1K
- Build Mcp App7.8K
- Build Mcpb7.6K
- Math Olympiad5.4K
- Configure5.2K
- Access5.1K
- Session Report5K
- M5 Onboard4.2K
- Cardputer Buddy4.2K
- Example Skill215
- Frontend Design20.4K
- Claude Md Improver16.3K
- Claude Automation Recommender12.8K
- Playground9.3K
- Skill Creator9.1K
- Agent Development8.8K
- Skill Development8.7K
- Hook Development8.4K
- Mcp Integration8.3K
- Command Development8.3K
Similar to Writing Hookify Rules
More Skill & Plugin Buildinghookify-rulesSkillaffaan-m/ecc10.7K installsMarkdown-file rules with regex and conditions that warn or block agent events before risky actions run.
hook-developmentSkillanthropics/claude-plugins-official8.4K installsGuide for writing Claude Code plugin hooks, covering prompt-based and command hook types across lifecycle events.
claude-hook-writerSkillsecondsky/claude-skills418 installsSecurity-first guide for writing, reviewing, and debugging Claude Code hooks, covering event choice, matchers, and exit codes.
hookifyPluginanthropics/claude-plugins-official48.8K starsEasily create custom hooks to prevent unwanted behaviors by analyzing conversation patterns or from explicit instructions. Define rules via simple markdown file
hooksSkillparcadei/continuous-claude-v3511 installsShell-to-TypeScript hook pattern with templates, six lifecycle events, and settings registration for Claude Code.
claude-code-guideSkillsickn33/agentic-awesome-skills301 installsReference guide for configuring Claude Code project instructions, debugging, and verified workflows.