Community-maintained fork of the hookify plugin for Claude Code.
The upstream hookify plugin has bugs and missing features that Anthropic hasn't addressed. This fork integrates community fixes so you don't have to wait.
| Feature | What it does |
|---|---|
not_regex_match |
Exclude patterns (e.g., skip test files from rules) |
value key |
Clearer syntax for non-regex operators |
read event |
Separate event for Read/Glob/Grep/LS (no false triggers) |
| Global rules | Rules in ~/.claude/ apply to ALL projects |
Update tool |
File events now fire for the Update tool |
| Bug | Issue |
|---|---|
Read tools incorrectly fired file rules |
#14588 |
Write tool new_text field was broken |
#16081 |
| Python 3.8 type hints incompatible | #14588 |
| Claude couldn't see why rules blocked | #12446 |
| Windows paths with spaces failed | #16152 |
| Example file used wrong operator | #13464 |
11 total improvements. No waiting for Anthropic to merge PRs.
# 1. Clone
git clone https://github.com/adrozdenko/hookify-plus ~/hookify-plus
# 2. Backup & link
mv ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0{,.bak}
ln -s ~/hookify-plus ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0
# 3. Create your first rule
mkdir -p .claude
cat > .claude/hookify.warn-rm.local.md << 'EOF'
---
name: warn-dangerous-rm
enabled: true
event: bash
pattern: rm\s+-rf
---
⚠️ **Dangerous rm command!** Double-check the path before proceeding.
EOF
# Done! Rules are active immediately.Rules are markdown files with YAML frontmatter:
---
name: rule-identifier
enabled: true
event: bash|file|read|stop|prompt|all
action: warn|block
pattern: regex-pattern
---
Message shown to Claude when rule triggers.
Supports **markdown** formatting.---
name: warn-env-changes
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: file_path
operator: not_regex_match
pattern: \.example$
---
You're editing a .env file. Make sure it's in .gitignore!| Event | Triggers On |
|---|---|
bash |
Bash tool |
file |
Edit, Write, MultiEdit, Update |
read |
Read, Glob, Grep, LS |
stop |
Agent completion |
prompt |
User prompt submit |
all |
All of the above |
| Operator | Description |
|---|---|
regex_match |
Pattern matches (regex) |
not_regex_match |
Pattern does NOT match |
contains |
Substring present |
not_contains |
Substring NOT present |
equals |
Exact match |
starts_with |
Prefix match |
ends_with |
Suffix match |
| Event | Available Fields |
|---|---|
bash |
command |
file |
file_path, new_text, old_text, content |
read |
file_path |
stop |
reason, transcript |
prompt |
user_prompt |
| Location | Scope |
|---|---|
.claude/hookify.*.local.md |
Current project only |
~/.claude/hookify.*.local.md |
All projects (global) |
git clone https://github.com/adrozdenko/hookify-plus ~/hookify-plus
mv ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0 \
~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0.bak
ln -s ~/hookify-plus \
~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0cd ~/hookify-plus && git pullChanges take effect immediately—no restart needed.
rm ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0
mv ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0.bak \
~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0Format: 0.1.0-plus.N
0.1.0= upstream hookify versionplus.N= patch number
When upstream releases a new version, we rebase (e.g., 0.2.0-plus.1).
See CHANGELOG.md for full history.
| Contributor | Contribution |
|---|---|
| @adrozdenko | Fork maintainer, not_regex_match, value key, read event |
| @kp222x | Global rules (#13916) |
| @heathdutton | Write fix + Update tool (#16081) |
- Fork this repo
- Make changes
- Add entry to CHANGELOG.md
- Submit PR
All community contributions welcome!
MIT