I kept writing the same hooks for different AI coding tools with slightly different configs:
- Claude Code: ~/.claude/settings.json (PreToolUse)
- Cursor: ~/.cursor/hooks.json (beforeShellExecution)
- Gemini CLI: ~/.gemini/settings.json (BeforeTool)
- OpenCode: ES module plugins
So I made a skill that unifies them. One hook script works across all 4 tools.
It also includes patterns for common use cases: blocking dangerous commands, auto-formatting, notifications, audit logging.
Built two apps using Claude Code + this skill:
- Code Buddy (SwiftUI): menu bar status for AI sessions
- Veto (Rust): risk scoring + Touch ID before dangerous commands
Source: https://github.com/runkids/ai-hooks-integration
Feedback welcome.