Create custom hooks to prevent unwanted behaviors
Creates custom hooks to block or warn about specific patterns in code.
/plugin marketplace add thkt/claude-config/plugin install complete-workflow-system@thkt-development-workflowsCreate hooks that block or warn about specific patterns in code.
/hookify Don't use console.log in TypeScript files
Creates a hook rule file at .claude/hookify.{name}.local.md
/hookify
Analyzes recent conversation to detect patterns you've corrected and creates rules.
.claude/hookify.{rule-name}.local.md---
name: rule-name
enabled: true
event: file|bash|stop|prompt
pattern: regex-pattern
action: warn|block
conditions: # optional, for complex rules
- field: file_path|new_text|command
operator: regex_match|contains|not_contains
pattern: pattern
---
Message shown when pattern is detected.
Markdown formatting supported.
| Event | Trigger |
|---|---|
file | Edit/Write/MultiEdit operations |
bash | Bash command execution |
stop | When Claude wants to stop |
prompt | User prompt submission |
| Action | Behavior |
|---|---|
warn | Show warning, continue operation |
block | Block operation, require fix |
/hookify Block rm -rf commands
Creates:
---
name: block-dangerous-rm
enabled: true
event: bash
pattern: rm\s+-rf
action: block
---
Dangerous rm -rf command detected! Use safer alternatives.
/hookify Warn when console.log is added to TypeScript files
Creates:
---
name: warn-console-log
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.tsx?$
- field: new_text
operator: contains
pattern: console\.log
---
Debug code detected! Remember to remove before committing.
/hookify:list - Show all hook rules/hookify:configure - Enable/disable rules interactively/hookifyCreate hooks to prevent unwanted behaviors from conversation analysis or explicit instructions
/hookifyCreate hooks to prevent unwanted behaviors from conversation analysis or explicit instructions
/hookifyCreate a hookify rule from explicit instructions or analyze recent conversation to find unwanted behaviors