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
Install via the Claude Code Marketplace
Hookify is part of the Claude Code Marketplace. It should be auto-discovered when the marketplace is installed.
Manual testing
To test the plugin manually, point Claude Code at the plugin directory.
bashcc --plugin-dir /path/to/hookify
Hookify بيخليك تعمل hooks خاصة فيك لتمنع تصرفات ما بدك ياها بـ Claude Code، يا إما من تحليل المحادثة أو من تعليمات واضحة بتعطيها. وبدل ما تعدّل ملفات hooks.json المعقدة، بتكتب ملفات markdown خفيفة وبس.
Examples
Create your first rule
Prompt/hookify Warn me when I use rm -rf commandsExpected 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/hookify Don't use console.log in TypeScript filesExpected output: Creates a rule from your explicit instructions.
Generate rules from conversation analysis
Prompt/hookifyExpected output: Without arguments, analyzes recent conversation to find behaviors you've corrected or been frustrated by.
Simple rule file blocking dangerous rm
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 backupsWhat 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.