What it is
Hookify is a Claude Code plugin, version 0.1.0 by Daisy Hollman. It makes it simple to create hooks that prevent unwanted behaviors without editing complex hooks.json files. Each rule is a lightweight markdown configuration file with YAML frontmatter. The file defines patterns to watch for and the message to show when a pattern matches. Rules are stored in the project's .claude/ directory with names like .claude/hookify.warn-rm.local.md. They take effect on the very next tool use, with no restart needed.
The main command is /hookify. Given arguments, it creates a rule from your explicit instructions. Run without arguments, it analyzes the recent conversation to find behaviors you've corrected or been frustrated by. Three helper commands support it: /hookify:list shows all rules, /hookify:configure enables or disables existing rules through an interactive interface, and /hookify:help gets help.
Each rule targets an event type:
- bash triggers on Bash tool commands.
- file triggers on the Edit, Write and MultiEdit tools.
- stop triggers when Claude wants to stop, which is useful for completion checks.
- prompt triggers on user prompt submission.
- all triggers on all events.
Patterns use Python regex syntax. Each rule also has an action:
- warn (the default) shows a message but allows the operation.
- block prevents the operation from executing for PreToolUse, or stops the session for Stop events.
Advanced rules can define multiple conditions, and all of them must match for the rule to trigger. Each condition checks one field, such as command, file_path, new_text, old_text, content, user_prompt or transcript. Available operators are regex_match, contains, equals, not_contains, starts_with and ends_with.
Hookify requires Python 3.7+ and has no external dependencies; it uses the standard library only. It is part of the Claude Code Marketplace and is released under the MIT License.
Who it's for
- Claude Code users who want to warn about or block dangerous commands such as rm -rf
- Developers who want reminders about debug code or hardcoded credentials in edited files
- Users who want to enforce completion checks, such as requiring tests to be run before Claude stops
- Anyone who wants custom hooks without editing hooks.json or writing code
Requirements
Requirements
- Python 3.7+
- No external dependencies (uses stdlib only)
- Claude Code (the plugin is part of the Claude Code Marketplace)
Setup
Install via the Claude Code Marketplace
This plugin 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 بتحذّرك أو بتمنع تصرفات ما بدك ياها، إما من تعليمات بتكتبها أو من تحليل محادثتك الأخيرة. وكل قاعدة بتنحفظ بملف markdown بسيط بدل ما تعدّل ملفات hooks.json المعقدة.
Examples
Create a rule from explicit instructions
Prompt/hookify Warn me when I use rm -rf commandsExpected output: Analyzes the request and creates .claude/hookify.warn-rm.local.md. The rule takes effect on the next tool use with no restart.
Analyze the recent conversation for unwanted behaviors
Prompt/hookifyExpected output: Run without arguments, it analyzes the recent conversation to find behaviors you've corrected or been frustrated by.
Simple rule that blocks dangerous rm commands
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: A single-pattern rule stored as .claude/hookify.dangerous-rm.local.md. It matches Bash commands against the regex and blocks them, showing the markdown body as the message.
Require tests before stopping
markdown---
name: require-tests-run
enabled: false
event: stop
action: block
conditions:
- field: transcript
operator: not_contains
pattern: npm test|pytest|cargo test
---
**Tests not detected in transcript!**
Before stopping, please run tests to verify your changes work correctly.What it does: Blocks Claude from stopping if no test commands appear in the session transcript. It ships with enabled: false; enable it only when you want strict enforcement.