hook-management
npx machina-cli add skill a5c-ai/babysitter/hook-management --openclawHook Management
Overview
Session-scoped hook lifecycle management for ClaudeKit's event-driven hook system. Provides enable/disable/status controls with execution profiling and performance alerts.
Hook Types
PreToolUse Hooks
- file-guard: Blocks sensitive file access (195+ patterns)
PostToolUse Hooks
- typecheck-changed: Type checking on modified files
- lint-changed: Linting on modified files
- test-changed: Testing related to modified files
- check-comment-replacement: Detects code replaced with comments
- check-unused-parameters: Detects unused function parameters
UserPromptSubmit Hooks
- codebase-map: Invisible project context injection
- thinking-level: Reasoning enhancement (4 levels)
Stop/SubagentStop Hooks
- create-checkpoint: Git-backed state snapshot
- typecheck-project: Full project type checking
- lint-project: Full project linting
- test-project: Full test suite execution
- self-review: Comprehensive change review
Session Isolation
All hook changes are session-scoped. Disabling a hook only affects the current session and does not persist.
Profiling
- Red alert: execution time > 5s
- Yellow warning: execution time > 3s
- Green: execution time < 3s
- Output size monitoring: flag > 10KB
Commands
/hook:enable [hookName]-- Enable a disabled hook/hook:disable [hookName]-- Disable a hook for this session/hook:status-- Show all hook states and profiling data
When to Use
- When a hook is causing issues during a session
- To check performance of hook executions
- To temporarily bypass a hook for a specific operation
Processes Used By
claudekit-orchestrator(hook pipeline setup)claudekit-safety-pipeline(hook profiling)
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/claudekit/skills/hook-management/SKILL.mdView on GitHub Overview
Hook Management provides session-scoped controls for ClaudeKit's event-driven hooks, including enable/disable/status and per-hook profiling. It also surfaces color-coded performance alerts to help diagnose slow or oversized hook executions. All hook changes are isolated to the current session and do not persist.
How This Skill Works
Hooks are categorized by type (PreToolUse, PostToolUse, UserPromptSubmit, Stop/SubagentStop). Manage them with /hook:enable, /hook:disable, and /hook:status. Profiling surfaces Red (>5s), Yellow (>3s), and Green (<3s) alongside an output size flag if >10KB. The system relies on claudekit-orchestrator for hook pipeline setup and claudekit-safety-pipeline for profiling.
When to Use It
- Debug a hook that's causing issues in the current session
- Survey performance of hook executions and identify bottlenecks
- Temporarily bypass a hook for a specific operation
- Block sensitive file access with file-guard during a session
- Create or leverage a checkpoint before risky changes using create-checkpoint
Quick Start
- Step 1: Run /hook:status to view current hook states and profiling data
- Step 2: Disable a problematic hook with /hook:disable [hookName]
- Step 3: Re-run operations and, if needed, re-enable with /hook:enable [hookName]
Best Practices
- Keep changes session-scoped; avoid persistent state across sessions
- Check /hook:status first to establish baseline before enabling/disabling
- Rely on color-coded profiling to prioritize fixes (Red/Yellow/Green thresholds)
- Avoid overloading a session with too many enabled hooks at once
- Use create-checkpoint before major changes to capture state
Example Use Cases
- Disable a problematic lint-changed hook during a debugging session to reduce noise
- Enable file-guard temporarily when reviewing sensitive files in a codebase
- Run /hook:status to compare hook states before and after tuning
- Take a Git-backed checkpoint with create-checkpoint before a risky refactor
- Execute typecheck-project and lint-project sequentially to validate full project health