hookify

A natural-language tool for creating Claude Code hook rules that warn about or block matching commands, file changes, prompts, or session endings. Hook rules are automatic checks triggered by those events.

In plain words
What is it for?
Use it to create rules such as warning on destructive shell commands, blocking edits to sensitive files, flagging unwanted code, or requiring tests before stopping.
Why use it?
It avoids requiring manual editing of hook configuration when you want to prevent or flag a risky action.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/luiseiman/dotforge/hookify
Any agent
npx skills add luiseiman/dotforge --skill hookify
Clone the repo
git clone --depth 1 https://github.com/luiseiman/dotforge

Made for: Claude Code, Codex.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 825 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.00825
Opus 5 $0.00029 $0.00413
Sonnet 5 $0.00012 $0.00165
Haiku 4.5 $0.00006 $0.00082

Measured 2d ago against content hash de02c68b3293, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

hookify scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- "Warn me when I use rm -rf" → event: bash, action: warn, pattern: `rm\s+-rf`
stacks/hookify/skills/hookify/SKILL.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hookify — Dynamic Hook Rules

Create hook rules from natural language without editing hooks.json.

Step 1: Understand Intent

Parse the user's description to determine:

  • Event type: bash (commands), file (edits/writes), stop (session end), prompt (user input)
  • Action: warn (show message, allow) or block (deny operation)
  • Pattern: regex to match against the relevant field
  • Field: what to match (command, file_path, new_text, user_prompt, etc.)

Examples:

  • "Warn me when I use rm -rf" → event: bash, action: warn, pattern: rm\s+-rf
  • "Don't let me edit .env files" → event: file, action: block, field: file_path, pattern: \.env$
  • "Block console.log in TypeScript" → event: file, action: warn, field: new_text, conditions on file_path AND new_text
  • "Don't stop without running tests" → event: stop, action: block, field: transcript, operator: not_contains, pattern: pytest|npm test

Step 2: Generate Rule File

Create .claude/hookify.<short-name>.local.md:

---
name: <descriptive-kebab-case-name>
enabled: true
event: <bash|file|stop|prompt>
action: <warn|block>
pattern: <regex>  # for single-condition rules
---

<Warning/block message in markdown. Be helpful — explain WHY and suggest alternatives.>

For multi-condition rules:

---
name: <name>
enabled: true
event: <event>
action: <action>
conditions:
  - field: <field>
    operator: <regex_match|contains|not_contains|equals|starts_with|ends_with>
    pattern: <value>
  - field: <field>
    operator: <operator>
    pattern: <value>
---

<Message>

Step 3: Confirm

Show the user:

  1. The generated file path and content
  2. What it will catch (with example triggers)
  3. What it will NOT catch (edge cases)

Step 4: Test Suggestion

Suggest a way to test the rule immediately:

  • For bash rules: "Try running <command that triggers>"
  • For file rules: "Try editing a file matching the pattern"
  • For stop rules: "The rule will trigger next time the session ends"

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 98 lines · 58 tokens per session scan C de02c68b3293

Subscribe to this mod's changes

hookify is a skill published in the GitHub repository luiseiman/dotforge (8 stars, last pushed 2mo ago), licensed MIT. It adds 58 tokens to every session and 825 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

hook-gen

Generate Claude Code hook configurations from natural language descriptions. Use when: "create hook", "add hook", "hook for", "when X happens do Y", "hook-gen".

claude-hangar/claude-hangar · 39 tokens

agentmail

Email infrastructure for AI agents. Create accounts, send/receive emails, manage webhooks, and check karma balance via the AgentMail API.

sickn33/agentic-awesome-skills · 31 tokens

agent-creator

Create and configure AiderDesk agent profiles by defining tool groups, approval rules, system prompts, subagent settings, subagent filtering, and provider/model selection. Use when setting up a new agent, creating a profile, or configuring agent tools, permissions, and subagent behavior.

hotovo/aider-desk · 60 tokens

agent-protocols

Shared protocols for all agents in the multi-agent pipeline: recursive nesting, pre-implementation restatement, agent spawn protocol, parallel dispatch format, completion reporting, and sovereign subagent awareness. Load this skill instead of inlining these protocols in every agent file.

irahardianto/awesome-agv · 56 tokens

delegating-work

Use when you have a task and must decide WHO does it — yourself, a spawned subagent, or another agent in the topology that already holds the context. The rule: how much would a blank slate have to read in to do this correctly? A lot → route to a context-holding agent; a little → subagent; unsure → a real agent or…

mvschwarz/openrig · 120 tokens

hook-template

Generate hook script from template. Use when adding a new hook, wiring a PreToolUse/PostToolUse/Stop/Notification hook, or scaffolding hook config for settings.json.

claude-world/director-mode-lite · 39 tokens