Skip to content
Development
Command

/hookify

Create behavioral rules to prevent unwanted actions

From plugin
claude-night-market
325163 skills59 agents163 commands1 MCP
Install
$ npx -y skills add athola/claude-night-market --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/hookify

Context preview

What this command does when you run it.

Create behavioral rules to prevent unwanted actions

Command definition

hookify.md
name: hookify
description: Create behavioral rules to prevent unwanted actions
usage: /hookify [instruction]
examples:
  - /hookify Don't use console.log in TypeScript files
  - /hookify Block rm -rf commands

Hookify Command

Creates custom behavioral rules to prevent unwanted actions.

When To Use

Use this command when you need to:

  • Creating rules from explicit instructions
  • Analyzing conversation for unwanted behaviors to block

When NOT To Use

  • Complex multi-step workflows - use agents instead
  • One-time operations that don't need persistent rules

Usage

Create Rule from Instruction

/hookify Don't use console.log in TypeScript files

This will: 1. Parse your instruction 2. Determine appropriate event type (bash, file, etc.) 3. Generate regex pattern 4. Create rule file in `.claude/` 5. Enable rule immediately

Analyze Conversation

/hookify

Without arguments, hookify will: 1. Analyze recent conversation history 2. Identify unwanted behaviors or mistakes 3. Suggest rules to prevent recurrence 4. Ask if you want to create them

Rule Creation Flow

1. **Event Detection**: Determines which tool the rule applies to 2. **Pattern Generation**: Creates regex pattern from your description 3. **Action Selection**: Chooses warn or block based on severity 4. **Message Creation**: Generates helpful message for Claude 5. **File Creation**: Saves to `.claude/hookify.{name}.local.md`

Examples

Block Dangerous Commands

/hookify Block rm -rf and other destructive operations

Creates:

---
name: block-destructive-ops
enabled: true
event: bash
pattern: rm\s+-rf|dd\s+if=|mkfs
action: block
---

๐Ÿ›‘ **Destructive operation detected!**
This command can cause data loss.

Warn About Debug Code

/hookify Warn when I add console.log to files

Creates:

---
name: warn-console-log
enabled: true
event: file
pattern: console\.log\(
action: warn
---

๐Ÿ› **Debug code detected!**
Remove console.log before committing.

Require Tests

/hookify Remind me to run tests before stopping

Creates:

---
name: require-tests
enabled: true
event: stop
action: warn
conditions:
  - field: transcript
    operator: not_contains
    pattern: npm test|pytest
---

โš ๏ธ **Tests not detected!**
Run tests before completing.

See Also

  • `/hookify:list` - View all rules
  • `/hookify:configure` - Enable/disable rules
  • `/hookify:help` - Show help
  • `Skill(hookify:writing-rules)` - Learn rule syntax
Read more
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Get the whole plugin, auto-invoked