Hookify by anthropics
Easily create hooks to prevent unwanted behaviors by analyzing conversation patterns
- Type
- Plugin
- Repository
- anthropics/claude-plugins-official
- GitHub stars
- 37.1k
- License
- Apache-2.0
- Repo last updated
- Sep 25, 2026
- Source file
- plugins/hookify/.claude-plugin/plugin.json
- Author
- Anthropic
What Hookify by anthropics is
Hookify by anthropics is a plugin published in the anthropics/claude-plugins-official repository on GitHub, which has about 37.1k stars. The repository describes itself as: “Official, Anthropic-managed directory of high quality Claude Code Plugins.”
A plugin is a package that bundles skills, slash commands, subagents, hooks, and MCP connectors so they install together. Plugins are plain files with a manifest at .claude-plugin/plugin.json, and they work in both Claude Code and Claude Cowork.
Installing Hookify adds everything it ships in one step. Connectors inside a plugin still need to be connected separately, and hooks and subagents only run in Cowork and Claude Code, not in regular chat.
How to install Hookify by anthropics
Claude Code
- Add the repository as a plugin marketplace: claude plugin marketplace add anthropics/claude-plugins-official
- Install the plugin: claude plugin install hookify@<marketplace-name>, using the marketplace name from the repository's .claude-plugin/marketplace.json.
- Restart the session if the new skills or commands don't appear straight away.
Claude Cowork
- Open Customize → Plugins and choose Add marketplace.
- Enter anthropics/claude-plugins-official (the owner/repo shorthand works for GitHub).
- Find Hookify in the list, click Install, then connect any connectors it needs from its Connectors tab.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/hookify/.claude-plugin/plugin.json, shared under the repository's Apache-2.0 license. Read the full file on GitHub.
Easily create custom hooks to prevent unwanted behaviors by analyzing conversation patterns or from explicit instructions.
Overview
The hookify plugin makes it simple to create hooks without editing complex hooks.json files. Instead, you create lightweight markdown configuration files that define patterns to watch for and messages to show when those patterns match.
Key features:
- 🎯 Analyze conversations to find unwanted behaviors automatically
- 📝 Simple markdown configuration files with YAML frontmatter
- 🔍 Regex pattern matching for powerful rules
- 🚀 No coding required - just describe the behavior
- 🔄 Easy enable/disable without restarting
Quick Start
1. Create Your First Rule
/hookify Warn me when I use rm -rf commandsThis analyzes your request and creates .claude/hookify.warn-rm.local.md.
2. Test It Immediately
No restart needed! Rules take effect on the very next tool use.
Ask Claude to run a command that should trigger the rule:
Run rm -rf /tmp/testYou should see the warning message immediately!
Usage
Main Command: /hookify
With arguments:
/hookify Don't use console.log in TypeScript filesCreates a rule from your explicit instructions.
Without arguments:
/hookifyAnalyzes recent conversation to find behaviors you've corrected or been frustrated by.
Helper Commands
List all rules:
/hookify:listConfigure rules interactively:
/hookify:configureEnable/disable existing rules through an interactive interface.
Get help:
/hookify:helpRule Configuration Format
Simple Rule (Single Pattern)
.claude/hookify.dangerous-rm.local.md:
---
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 backupsAction field:
- warn: Shows warning but allows operation (default)
- block: Prevents operation from executing (PreToolUse) or stops session (Stop events)
Advanced Rule (Multiple Conditions)
.claude/hookify.sensitive-files.local.md:
---
name: warn-sensitive-files
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.env$|credentials|secrets
- field: new_text
operator: contains
pattern: KEY
---
🔐 **Sensitive file edit detected!**
Ensure credentials are not hardcoded and file is in .gitignore.All conditions must match for the rule to trigger.
Event Types
- bash: Triggers on Bash tool commands
- file: Triggers on Edit, Write, MultiEdit tools
- stop: Triggers when Claude wants to stop (for completion checks)
- prompt: Triggers on user prompt submission
- all: Triggers on all events
Pattern Syntax
Use Python regex syntax:
Tips:
- Use \s for whitespace
- Escape special chars: \. for literal dot
- Use | for OR: (foo|bar)
- Use .* to match anything
- Set action: block for dangerous operations
- Set action: warn (or omit) for informational warnings
Examples
Example 1: Block Dangerous Commands
---
name: block-destructive-ops
enabled: true
event: bash
pattern: rm\s+-rf|dd\s+if=|mkfs|format
action: block
---
🛑 **Destructive operation detected!**
This command can cause data loss. Operation blocked for safety.
Please verify the exact path and use a safer approach.This rule blocks the operation - Claude will not be allowed to execute these commands.
Example 2: Warn About Debug Code
---
name: warn-debug-code
enabled: true
event: file
pattern: console\.log\(|debugger;|print\(
action: warn
---
🐛 **Debug code detected**
Remember to remove debugging statements before committing.This rule warns but allows - Claude sees the message but can still proceed.
Example 3: Require Tests Before Stopping
---
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. Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Hookify by anthropics?
Hookify by anthropics is a plugin for Claude Code and Claude Cowork from the anthropics/claude-plugins-official repository on GitHub. Easily create hooks to prevent unwanted behaviors by analyzing conversation patterns
How do I install Hookify by anthropics in Claude Code?
Add the repository as a plugin marketplace: claude plugin marketplace add anthropics/claude-plugins-official Install the plugin: claude plugin install hookify@<marketplace-name>, using the marketplace name from the repository's .claude-plugin/marketplace.json. Restart the session if the new skills or commands don't appear straight away.
Can I use Hookify by anthropics in Claude Cowork?
Open Customize → Plugins and choose Add marketplace. Enter anthropics/claude-plugins-official (the owner/repo shorthand works for GitHub). Find Hookify in the list, click Install, then connect any connectors it needs from its Connectors tab.
Is Hookify by anthropics safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Test Engineer Writes characterization, contract, and equivalence tests that pin down legacy behavior so transformation can be proven correct. Use before any rewrite. Subagent · anthropics/claude-plugins-official
- Telegram Telegram channel for Claude Code — messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /telegram:access. Plugin · anthropics/claude-plugins-official
- Type Design Analyzer Use this agent when you need expert analysis of type design in your codebase. Specifically use it (1) when introducing a new type to ensure it follows best practices for encapsulation and invariant expression, (2) during pull request creation to review all types being added, and (3) when refactoring existing types to improve their design quality. The agent will provide both qualitative feedback… Subagent · anthropics/claude-plugins-official
- Terraform The Terraform MCP Server provides seamless integration with Terraform ecosystem, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development. Plugin · anthropics/claude-plugins-official
- Imessage iMessage channel for Claude Code — reads chat.db directly, sends via AppleScript. Built-in access control; manage pairing, allowlists, and policy via /imessage:access. Plugin · anthropics/claude-plugins-official
- Greptile AI code review agent for GitHub and GitLab. View and resolve Greptile's PR review comments directly from Claude Code. Plugin · anthropics/claude-plugins-official
- Laravel Boost Laravel development toolkit MCP server. Provides intelligent assistance for Laravel applications including Artisan commands, Eloquent queries, routing, migrations, and framework-specific code generation. Plugin · anthropics/claude-plugins-official
- Gitlab GitLab DevOps platform integration. Manage repositories, merge requests, CI/CD pipelines, issues, and wikis. Full access to GitLab's comprehensive DevOps lifecycle tools. Plugin · anthropics/claude-plugins-official