hookify-rules

hookify-rules is a skill for Claude Code, Codex from gongyijie85/dsh-ecc. It costs 47 tokens per session (931 once invoked), scanned C, a copy of hookify-rules, MIT.

A guide for creating Hookify rules: small configuration files that watch for matching commands, file changes, prompts, or other events and display a message or block an operation.

In plain words
What is it for?
It is for writing, enabling, disabling, and configuring Hookify rules with regular-expression patterns or multiple matching conditions.
Why use it?
It lets you add repeatable warnings or safeguards around risky actions without relying on memory each time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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/gongyijie85/dsh-ecc/hookify-rules
Any agent
npx skills add gongyijie85/dsh-ecc --skill hookify-rules
Clone the repo
git clone --depth 1 https://github.com/gongyijie85/dsh-ecc

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hookify-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/hookify-rules.svg)](https://agentmods.dev/skills/gongyijie85/dsh-ecc/hookify-rules)
Your own site
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/hookify-rules"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/hookify-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 931 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin 88% copy Near-identical to another mod 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.1 $0.00047 $0.00931
Opus 5 $0.00023 $0.00465
Sonnet 5 $0.00009 $0.00186
Haiku 4.5 $0.00005 $0.00093

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

Security

Grade C, and why

hookify-rules 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.

- **Too specific**: `rm -rf /tmp` — use `rm\s+-rf`
Origin

This is a copy

88% identical to hookify-rules — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/hookify-rules/SKILL.md · 129 lines

How it starts

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

Writing Hookify Rules

Overview

Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in .claude/hookify.{rule-name}.local.md files.

Rule File Format

Basic Structure

---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---

Message to show Claude when this rule triggers.
Can include markdown formatting, warnings, suggestions, etc.

Frontmatter Fields

Field Required Values Description
name Yes kebab-case string Unique identifier (verb-first: warn-, block-, require-*)
enabled Yes true/false Toggle without deleting
event Yes bash/file/stop/prompt/all Which hook event triggers this
action No warn/block warn (default) shows message; block prevents operation
pattern Yes* regex string Pattern to match (*or use conditions for complex rules)

Advanced Format (Multiple Conditions)

---
name: warn-env-api-keys
enabled: true
event: file
conditions:
  - field: file_path
    operator: regex_match
    pattern: \.env$
  - field: new_text
    operator: contains
    pattern: API_KEY
---

You're adding an API key to a .env file. Ensure this file is in .gitignore!

Condition fields by event:

  • bash: command
  • file: file_path, new_text, old_text, content
  • prompt: user_prompt

Operators: regex_match, contains, equals, not_contains, starts_with, ends_with

All conditions must match for rule to trigger.

Event Type Guide

bash Events

Match Bash command patterns:

  • Dangerous commands: rm\s+-rf, dd\s+if=, mkfs
  • Privilege escalation: sudo\s+, su\s+
  • Permission issues: chmod\s+777

file Events

Match Edit/Write/MultiEdit operations:

  • Debug code: console\.log\(, debugger
  • Security risks: eval\(, innerHTML\s*=
  • Sensitive files: \.env$, credentials, \.pem$

Read the full file on GitHub · 129 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 · 129 lines · 47 tokens per session scan C b604608e30ac

Subscribe to this mod's changes

hookify-rules is a skill published in the GitHub repository gongyijie85/dsh-ecc (6 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 931 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 88% identical to hookify-rules, differing in 18 lines, and is treated as a copy.

Related

Other skills, from other repositories

manage-taskboard

Manage work in the native DeepSeek Harness Taskboard with exact task ids and optimistic versions. Use when an Agent must inspect project work, claim an eligible todo, record progress or blockers, verify an implementation, submit it for human review, or release its own claim; also use when a human asks how to accept…

shengsheng90/DSH-taskboard · 88 tokens

dsh-web-pet-developer

Create a pet for the dsh-pet plugin and integrate it into the dsh web GUI — author a v2 pet.json manifest plus an 8-column x 9-row atlas per the Codex/hatch-pet contract (live2d pets, voice packs and status decorations included), drop it into the pet-center user directory or contribute it as a built-in asset under…

zhu1090093659/dsh-web · 162 tokens

industry-research-method

行业研究方法论:产业链上中下游拆分法、供需分析框架、政策跟踪口径、数据口径纪律(每个数字必须有来源与 asOf)、缺口声明纪律(宁标缺口不编造)。做行业梳理、产业链建图、政策动态跟踪或行业报告撰写时使用;只查单一公司时用 company-research-method。.

PerryLink/dsh-industry-research · 96 tokens

dsh-plugin-guide

Use when developing, reviewing, packaging, debugging, or answering questions about DeepSeek Harness (DSH) plugins — the plugin-based agent harness on vendored Cordis. Applies the official plugin-development constraints (plugin contract, cordis.yml layers, services/events/effects, tool DSL, bundles/profiles) backed by…

PerryLink/dsh-plugin-guide · 76 tokens

code2skill-review-flow

Review representative Code2Skill main flows for closure / 轻量审核 Code2Skill 代表性主流程是否闭环。.

leechen298/Code2Skill · 32 tokens

code2skill-review-source

Review Code2Skill request semantics against authorized source code, including source binding, cross-Tool handoffs, deterministic transformations, invocation chains, authentication, and attachments. 从授权源码独立复核 Code2Skill 请求语义。.

leechen298/Code2Skill · 52 tokens