New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Behavioral rules engine that blocks unsafe commands through markdown rule files, with no code required.

version
1.10.3
GitHub stars
350
View on GitHub

What it does

  • Adds /hookify:from-hook, /hookify:install, /hookify:list, and /hookify:configure commands plus a rule_guard.py hook for Bash, Write, Edit, prompt, and stop events
  • Ships default-on Git Safety rules that block force pushes to main/master and warn on risky operations like reset --hard or clean -fd
  • Enforces user overrides from .claude/ on top of bundled rules, with a stdlib parser fallback when PyYAML is missing
  • Designed for teams that want guardrails on destructive commands without writing hook code

Behavioral rules engine: create safety hooks through markdown configuration with pattern matching and zero-code rule authoring

Add marketplace

/plugin marketplace add athola/claude-night-market

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install hookify@claude-night-market

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

When To Use

  • Browsing available hookify rules by category
  • Installing standard pre-built rules into a project
  • Looking for ready-made rules before writing custom ones

When NOT To Use

  • Writing custom rules from scratch: use hookify:writing-rules instead
  • Debugging or modifying existing installed rules
  • Converting Python SDK hooks: use hookify:from-hook instead

Hookify Rule Catalog

Pre-built rules for common scenarios. Install directly or use as templates.

Quick Install

# Install a specific rule
Skill(hookify:rule-catalog) then install git:block-force-push

# Or use the Python installer for bulk operations
python3 plugins/hookify/scripts/install_rule.py git:block-force-push
python3 plugins/hookify/scripts/install_rule.py --category git
python3 plugins/hookify/scripts/install_rule.py --all

Verification: Run python --version to verify Python environment.

Available Rules

git/ - Git Safety

RuleActionDefaultDescription
block-force-pushblockenabledPrevent force push to main/master
block-destructive-gitblockenabledBlock reset --hard, checkout -- ., clean -fd, etc.
warn-risky-gitwarnenabledWarn about rebase -i, soft reset, etc.
warn-large-commitswarnenabledWarn about large binary files

python/ - Python Quality

RuleActionDefaultDescription
block-dynamic-codeblockenabledBlock dangerous dynamic code execution
warn-print-statementswarnenabledEncourage logging over print()

security/ - Security Gates

RuleActionDefaultDescription
require-security-reviewwarnenabledRequire review for auth code
destructive-command-guardwarnenabledWarn on destructive commands targeting prod-shaped paths

workflow/ - Workflow Enforcement

RuleActionDefaultDescription
enforce-scope-guardwarnenabledAnti-overengineering (imbue)
require-spec-before-codeblockdisabledSpec-first development

performance/ - Resource Management

RuleActionDefaultDescription
warn-large-file-opswarnenabledWatch large file writes

Installation Instructions

Method 1: Claude-Assisted (Recommended)

When you invoke this skill, tell Claude which rule(s) to install:

**Verification:** Run `git status` to confirm working tree state.
Install git:block-force-push

Verification: Run the command with --help flag to verify availability.

Claude will:

  1. Read the rule from skills/rule-catalog/rules/git/block-force-push.md
  2. Write it to .claude/hookify.block-force-push.local.md
  3. Confirm installation

Method 2: Python Script

For bulk operations or automation:

# Install single rule
python3 plugins/hookify/scripts/install_rule.py git:block-force-push

# Install all rules in category
python3 plugins/hookify/scripts/install_rule.py --category python

# Install all rules
python3 plugins/hookify/scripts/install_rule.py --all

# List available rules
python3 plugins/hookify/scripts/install_rule.py --list

# Install to custom directory
python3 plugins/hookify/scripts/install_rule.py git:block-force-push --target /path/to/.claude

Verification: Run the command with --help flag to verify availability.

Method 3: Manual Copy

  1. Find rule in plugins/hookify/skills/rule-catalog/rules/<category>/<rule>.md
  2. Copy to .claude/hookify.<rule-name>.local.md
  3. Edit enabled: true/false as needed

Rule File Locations

Rules are stored relative to this skill:

**Verification:** Run the command with `--help` flag to verify availability.
skills/rule-catalog/
├── SKILL.md (this file)
└── rules/
    ├── git/
    │   ├── block-force-push.md
    │   ├── block-destructive-git.md
    │   ├── warn-risky-git.md
    │   └── warn-large-commits.md
    ├── python/
    │   ├── block-dynamic-code.md
    │   └── warn-print-statements.md
    ├── security/
    │   ├── require-security-review.md
    │   └── destructive-command-guard.md
    ├── workflow/
    │   ├── enforce-scope-guard.md
    │   └── require-spec-before-code.md
    └── performance/
        └── warn-large-file-ops.md

Verification: Run the command with --help flag to verify availability.

Customizing Rules

After installation, edit the rule in .claude/:

# Change action from warn to block
action: block

# Disable temporarily
enabled: false

# Modify pattern
pattern: your-custom-pattern

Verification: Run the command with --help flag to verify availability.

Creating Pull Requests for New Rules

To add rules to the catalog:

  1. Create rule file in appropriate category
  2. Follow naming convention: kebab-case.md
  3. Include detailed message with alternatives
  4. Test thoroughly before submitting
  5. Update this SKILL.md catalog table

Related

  • Skill(hookify:writing-rules) - Create custom rules
  • /hookify:list - Show installed rules
  • /hookify:configure - Manage installed rules

Exit Criteria

  • Installed rule file exists at .claude/hookify.<rule-name>.local.md with enabled: true in its frontmatter
  • Rule activates without requiring a session restart; verified by triggering a matching pattern and observing the warn or block response
  • When installing via Python script, exit code 0 is returned and the rule file is present at the target path
  • Rule file structure matches the catalog source at skills/rule-catalog/rules/<category>/<rule>.md; no fields silently dropped during installation

Readme

Hookify

Behavioral rules and safety hooks for Claude Code.

Overview

Hookify provides a suite of pre-configured rules that are active immediately upon installation. These rules protect critical git branches, prevent destructive operations, and enforce security and workflow standards without requiring manual configuration.

Active Rules

The following rules are enabled by default:

  • Git Safety: Blocks force pushes to main/master and destructive operations like reset --hard or clean -fd. Warnings are issued for risky actions such as interactive rebases or soft resets.
  • File Management: Monitors for large binary files or large file operations that could bloat the repository or context.
  • Code Standards: Blocks dangerous dynamic code execution and warns about print statements in Python. Authentication changes require a security review, and new features must comply with scope-guard policies.

Architecture

Hookify uses a ConfigLoader to manage behavioral rules. It automatically searches for user-defined rules in the .claude/ directory, which can override any of the default bundled rules. These configurations are processed by the RuleEngine to evaluate tool usage against the active rule set during execution. The hooks/rule_guard.py hook runs that evaluation on every Bash, Write, Edit, prompt, and stop event and denies or warns as the rule says. The hook runs under the operator's python3. When that interpreter cannot import PyYAML, the loader reads rule frontmatter with a stdlib parser that accepts plain and quoted scalars plus the conditions: list, so block rules still block. A rule outside that subset fails to load and is named in the hook's systemMessage. Bundled rules resolve their locations relative to the plugin's installation path to ensure portability across different environments.

Installation

claude install hookify@claude-night-market

Or from source:

git clone https://github.com/athola/claude-night-market
cd claude-night-market
claude install ./plugins/hookify

Commands

CommandDescription
/hookify:from-hookConvert Python SDK hooks to declarative hookify rules
/hookify:installInstall a rule, category, or bundle (e.g. --bundle safe-defaults)
/hookify:listList installed and available rules
/hookify:configureConfigure rule settings

Bundles

Per the inclusive-defaults policy, hookify ships a curated safe-defaults bundle of warn-only rules. Block-action rules are intentionally excluded so a default-on bundle install cannot interrupt legitimate commands.

python3 plugins/hookify/scripts/install_rule.py --bundle safe-defaults

Contents (all action: warn):

  • documentation:require-slop-scan-for-docs
  • git:warn-large-commits, git:warn-risky-git
  • performance:warn-large-file-ops
  • python:warn-print-statements
  • workflow:plan-before-large-dispatch

Scripts

Rule Suggester

Analyze project context and suggest relevant rules:

python plugins/hookify/scripts/rule_suggester.py --project-dir .

Detects languages, frameworks, and tooling to recommend appropriate rules.

Documentation

  • Rule Catalog: Skill(hookify:rule-catalog)
  • Rule Writing: Skill(hookify:writing-rules)
  • Hook Scope: Skill(abstract:hook-scope-guide) (requires abstract plugin)

Optional Dependencies

DependencyPurposeFallback
abstract pluginhook-scope-guide skill for advanced hook patternsHookify works fully without it, minus the skill

Hookify is fully functional without optional dependencies. The abstract plugin provides additional guidance for advanced hook development patterns.

Stewardship

Ways to leave this plugin better than you found it:

  • Bundled rule descriptions are an opportunity to add "why" annotations explaining the risk each rule guards
  • The rule suggester output could include confidence scores so users know which suggestions are strongest
  • User override examples in .claude/ would benefit from a minimal template showing the override format
  • /hookify:from-hook conversion could document edge cases where Python hooks do not map cleanly to rules

See STEWARDSHIP.md for the full stewardship principles guiding this project.

Credits

Inspired by the original hookify plugin by Daisy Hollman at Anthropic.

Enhanced for claude-night-market with:

  • Zero-config bundled rules
  • Portable path resolution via __file__
  • User override support
  • Night-market plugin integration

Details

Marketplace
athola/claude-night-market
Source
plugins/hookify
Category
Community
Keywords
hooks, safety, behavioral-rules, configuration
Listed since
Apr 7, 2026

More from athola/claude-night-market

All 23