What problem does it solve?
This Skill provides comprehensive patterns and templates for implementing lifecycle hooks in Claude Code, enabling advanced automation, validation, security, and metrics tracking within AI workflows.
Core Features & Use Cases
- Lifecycle Hooks: Define actions for
PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, Stop, SubagentStop, and Notification events.
- Automation & Validation: Automatically format code, run tests, and validate file writes or commands before execution.
- Security: Implement guardrails against dangerous commands and sensitive file modifications.
- Metrics & Analysis: Track tool usage, analyze prompt complexity, and evaluate session completion.
- Use Case: Automatically format code after every write operation, block attempts to write to
.env files, and run relevant unit tests before a file is saved, ensuring code quality and security.
Quick Start
Configure your .claude/settings.json to automatically format code after every file write operation.