Skill Development Limited info

hookify

Hookify lets you create custom hooks that prevent unwanted behaviors in Claude Code, either by analyzing conversation patterns or from explicit instructions. You write lightweight markdown rule files instead of editing complex hooks.json files.

  • 37.6k GitHub stars
hookify preview image

What it is

Hookify is a Claude Code plugin from Anthropic. It replaces hand-editing complex hooks.json files with lightweight markdown configuration files that use YAML frontmatter. Each file defines a pattern to watch for and a message to show when that pattern matches. You create rules with the /hookify command. Given arguments, it builds a rule from your explicit instructions. Without arguments, it analyzes the recent conversation to find behaviors you've corrected or been frustrated by. Rules are saved as files such as .claude/hookify.warn-rm.local.md in the project's .claude/ directory. They take effect on the very next tool use, with no restart needed. Each rule has a name, an enabled flag, an event type, and either a single regex pattern or a list of conditions. The event types are: - bash for Bash tool commands - file for the Edit, Write and MultiEdit tools - stop for when Claude wants to stop, which is useful for completion checks - prompt for user prompt submission - all for every event The action field is either warn or block. warn is the default and shows a warning but allows the operation. block prevents the operation from executing on PreToolUse, or stops the session on Stop events. Advanced rules can combine multiple conditions, and all conditions must match for the rule to trigger. Each condition specifies a field, an operator and a pattern. The operators are regex_match, contains, equals, not_contains, starts_with and ends_with. The available fields depend on the event: - Bash events: command - File events: file_path, new_text, old_text and content - Prompt events: user_prompt - Stop events: general matching on session state, including checks against the transcript Patterns use Python regex syntax. Helper commands are available for managing rules. /hookify:list lists all rules, /hookify:configure enables or disables rules through an interactive interface, and /hookify:help shows help. You can also disable a rule by setting enabled: false in its .local.md file, or delete the rule by deleting the file. The plugin requires Python 3.7+ and uses only the standard library. It is released under the MIT License.

Who it's for

  • Claude Code users who want to prevent unwanted behaviors without editing complex hooks.json files
  • Developers who want to block dangerous commands such as rm -rf before they execute
  • Teams that want warnings about debug code or hardcoded credentials in edited files
  • Users who want to enforce completion checks, such as requiring tests to run before Claude stops

Requirements

Requirements

  • Python 3.7+
  • No external dependencies (uses stdlib only)
  • Claude Code with the Claude Code Marketplace installed

Setup

  1. Install via the Claude Code Marketplace

    Hookify is part of the Claude Code Marketplace. It should be auto-discovered when the marketplace is installed.

  2. Manual testing

    To test the plugin manually, point Claude Code at the plugin directory.

    bash
    cc --plugin-dir /path/to/hookify

Hookify بيخليك تعمل hooks خاصة فيك لتمنع تصرفات ما بدك ياها بـ Claude Code، يا إما من تحليل المحادثة أو من تعليمات واضحة بتعطيها. وبدل ما تعدّل ملفات hooks.json المعقدة، بتكتب ملفات markdown خفيفة وبس.

Examples

Create your first rule

Prompt
prompt
/hookify Warn me when I use rm -rf commands

Expected output: Analyzes your request and creates .claude/hookify.warn-rm.local.md. The rule takes effect on the next tool use.

Create a rule from explicit instructions

Prompt
prompt
/hookify Don't use console.log in TypeScript files

Expected output: Creates a rule from your explicit instructions.

Generate rules from conversation analysis

Prompt
prompt
/hookify

Expected output: Without arguments, analyzes recent conversation to find behaviors you've corrected or been frustrated by.

Simple rule file blocking dangerous rm

markdown
markdown
---
name: block-dangerous-rm
enabled: true
event: bash
pattern: rm\s+-rf
action: block
---

⚠️ **Dangerous rm command detected!**

This command could delete important files. Please:
- Verify the path is correct
- Consider using a safer approach
- Make sure you have backups

What it does: Saved as .claude/hookify.dangerous-rm.local.md. On Bash commands matching rm\s+-rf, it blocks the operation and shows the message.