PluginInstalls cleanly

Set your own safety rules in plain words

Hookify

Anthropic's plugin turns a plain request such as 'warn me before rm -rf' into a rule that warns or blocks Claude before it runs a command or edits a file.

Works with
Claude Code
Good for
Everyone, Build an app

What it does

A hook is a small rule that Claude Code checks automatically, for example before it runs a terminal command or edits a file. Writing hooks by hand means editing a settings file in JSON, which is hard for beginners. Hookify is Anthropic's plugin that lets you describe the rule in normal words instead.

You type something like "warn me when I use rm -rf commands" (rm -rf deletes files without asking). Hookify writes a small rule file in your project's .claude folder. It does this straight away, without asking you first. From the next action on, Claude Code checks each command or file edit against your rules.

  • A warn rule shows a message but lets the action happen.
  • A block rule stops a command or file edit before it runs. The same rule also checks the action after it runs, but at that point it cannot undo anything.
  • A block rule on the stop event does not end the session. It makes Claude keep working, and Claude reads your rule's message.

If you type /hookify with no words, it reads your recent conversation and suggests rules for things you had to correct. You can switch rules on and off with /hookify:configure.

Read this first. Hookify is a helper, not a safety wall:

  • It fails open. If Python, the plugin or a rule file breaks, hookify only prints a message and lets the action through. A broken rule file is skipped with a warning.
  • It never approves anything. It can only warn or block, so your normal permission prompts stay.
  • It needs Python 3. It runs a Python script before and after every tool use, on every prompt and at every stop.
  • Treat it as macOS and Linux only. On a normal Windows computer, the python3 command often opens a Microsoft Store stub instead of Python. Then no rule runs, and you see no error (issue 81448).
  • Prompt rules probably never fire. In our reading of the code (we did not run it), hookify looks for the prompt text in a field called user_prompt. Claude Code sends that text as prompt. So rules for the prompt event see empty text. Use rules for commands and file edits instead.
  • Rules come from the folder you work in. Hookify reads .claude/hookify.*.local.md files from the current folder. A project you download can bring its own rules, and a stop rule's text goes to Claude. Look in the .claude folder of a project before you work in it. If Claude's shell moves into a sub-folder, your rules may not load (our reading).
  • Patterns are only text. A command written another way can slip past a rule.

Hookify has no network code and needs no account. Rules that check the session transcript read the local transcript file on your computer.

Who it is for

People who use Claude Code on macOS or Linux and want a reminder or a stop before risky commands or edits to important files.

Example prompts

  • "/hookify Warn me when I use rm -rf commands"
  • "/hookify Block any edit to .env files"
  • "/hookify Don't use console.log in TypeScript files"
  • "/hookify" (with no words, to get rule ideas from this conversation)
  • "/hookify:list"

How to install

claude plugin install hookify@claude-plugins-official

How to use it

Type /hookify Warn me when I use rm -rf commands. It writes a rule file in the .claude folder of your project, and the rule works from the next tool use. Type /hookify:list to see your rules.

Check it works

  1. In Claude Code, run /plugin and look for hookify in the installed list.
  2. Type /hookify Warn me when I use rm -rf commands.
  3. Open the new .claude/hookify.*.local.md file. The pattern should be like rm\s+-rf, with no ^ at the start.
  4. Ask Claude to run echo rm -rf test. This command only prints text, so it deletes nothing.
  5. You should see your warning message straight away. No restart is needed (README).

Common problems

  • Every tool call shows "Hookify import error: No module named 'hookify'" — you installed the copy from the anthropics/claude-code marketplace (hookify@claude-code-plugins) — uninstall it and install hookify@claude-plugins-official, which has the fixed imports (issue 81448, commit 5f2db35).
  • No rule ever fires on Windows — no error text — the python3 command opens the Microsoft Store stub instead of Python (issue 81448). There is no fix in the plugin; use it on macOS or Linux.
  • A copied example rule never fires — no error text — the example files lack the hookify. prefix in their names. Rename the copy to .claude/hookify.<name>.local.md (issue 79143).
  • Long PowerShell commands show "Hookify error: Expecting ',' delimiter" on Windows — open bug report, no fix yet (issue 99221).
  • A prompt rule never fires — no error text — see "Prompt rules probably never fire" above. Write the rule for commands or file edits instead.

What to watch out for

  • Runs a Python script before and after every tool use, on every prompt and at every stop, so Python 3 must be installed (hooks.json, README)
  • It fails open: if Python, the plugin or a rule file breaks, hookify only prints a message and lets the action through (hooks/pretooluse.py, core/config_loader.py)
  • On Windows the hook command python3 often opens the Microsoft Store stub instead of Python, so no rule runs and you see no error (issue 81448)
  • A block rule can stop a command or file edit before it happens; on a stop rule it makes Claude keep working instead of ending (core/rule_engine.py, hooks docs)
  • Rules for the prompt event probably never fire: in our reading of the code (not run), hookify reads a field called user_prompt, but Claude Code sends the text as prompt (core/rule_engine.py, hooks docs)
  • It reads rule files from the .claude folder of the project you are in, so a downloaded project can bring its own rules (core/config_loader.py)
  • /hookify can write a new rule file in your project without asking you first (Write is in its allowed-tools in commands/hookify.md)
  • Rules are text patterns, so a command written another way can slip past them; treat it as a reminder, not a security wall
  • It never approves anything by itself; it can only warn or block (core/rule_engine.py)

Licence and author

Licence
Apache-2.0
Author
Anthropic
Source code
github.com/anthropics/claude-plugins-official

How we tested it

We installed it on an empty test computer on 18 Oct 2026. Installed and started in a clean test system. Not yet used in a real AI session.

Test level

Install only. Rule firing not tested. Not tested on Windows, where python3 often does not run (issue 81448). Not yet used on real work.

Technical details of the test
Date
18 Oct 2026
Method
Intake sandbox run on 2026-10-18 in a clean container with no account: cloned the repository and checked its skill, agent and plugin files; installed hookify@claude-plugins-official with the Claude Code command line.

Checked again on 18 Oct 2026

Alternatives

  • cc-safety-net — a ready-made guard that blocks destructive Git and file commands, with no rules to write.
  • Claude Code permission settings — built-in allow and deny lists, with no plugin needed.
  • Claude Code Setup — recommends settings and automations for your project.

FAQ

Does it need an account or API key? No. It reads rule files on your computer and has no network code.

Can it stop every dangerous command? No. It matches text patterns and fails open on errors, so keep your permission settings too. It does not work on a normal Windows computer.

Where are my rules saved? In your project's .claude folder, as hookify.<name>.local.md files (README).

How do I delete a rule? Delete its .local.md file, or set enabled: false in it.

Is it in Anthropic's directory? Yes, as hookify@claude-plugins-official. Do not use hookify@claude-code-plugins, which has broken imports (issue 81448).

Sources