writing-hookify-rules

Create custom Hookify rules defining patterns and actions for Claude tool usage.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/DMT123/claude-skills-collection --skill writing-hookify-rules-dmt123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/DMT123/claude-skills-collection/tree/main/plugins/hookify/writing-rules
Command: npx skills add https://github.com/DMT123/claude-skills-collection --skill writing-hookify-rules-dmt123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for creating custom Hookify rules, enabling users to define specific patterns and actions for Claude's tool usage and file operations.

Core Features & Use Cases

  • Rule Syntax Definition: Explains the YAML frontmatter and markdown body structure for Hookify rules.
  • Event Types: Details how to trigger rules on bash, file, stop, and prompt events.
  • Pattern Matching: Covers simple regex patterns and advanced multi-condition logic.
  • Use Case: A developer wants to prevent accidental deletion of important configuration files. They can use this Skill to learn how to write a Hookify rule that blocks rm -rf commands targeting specific file patterns.

Quick Start

Use the writing-hookify-rules skill to learn how to write a hookify rule that blocks dangerous rm commands.

Frequently Asked Questions about writing-hookify-rules

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

FAQPage Schema
How do I write custom Hookify rules to block dangerous bash commands in Claude?

To write custom Hookify rules, you define YAML frontmatter and a markdown body to specify bash event triggers, regex patterns for command matching, and the actions to take when a dangerous command like rm -rf is detected. The syntax supports multi-condition logic for precise tool usage control.

What event types can I target when creating Hookify rules for Claude tool usage?

Hookify rules can target four event types: bash for shell commands, file for file operations, stop for session termination, and prompt for input processing. You define these in the YAML frontmatter to intercept and validate Claude's specific tool actions.

Do I need to know regular expressions to create pattern matching rules for Claude?

Yes, you need a solid understanding of regular expressions to define effective pattern matching rules in Hookify. The rule syntax relies on regex to match specific command strings and file operation patterns, and supports advanced multi-condition logic for complex filtering scenarios.

What is the best way to organize Hookify rules for file operations?

The best way to organize Hookify rules for file operations is to use the markdown body structure with clear YAML frontmatter definitions. Grouping rules by event type and following rule creation best practices ensures maintainable configurations for intercepting file modifications.

Can I use multi-condition logic in Hookify rules to prevent accidental file deletion?

Yes, you can use multi-condition logic in Hookify rules to prevent accidental file deletion. By defining regex patterns within the file event type, you can specify exact file paths and operation types to block, ensuring important configuration files remain protected during automated tasks.

Why are my Hookify rules not triggering on prompt events in Claude?

Hookify rules may not trigger on prompt events if the YAML frontmatter syntax is incorrect or the regex pattern fails to match the input. Properly structuring the markdown body and verifying multi-condition logic are essential for successfully intercepting prompt events.