What problem does it solve?
Hook-creator helps you create and manage AI Agent lifecycle hooks so you can enforce checks, run commands, and react to events without changing the core agent logic.
Core Features & Use Cases
- Lifecycle event hook management: Add handlers for events like PreToolUse, PostToolUse, PermissionRequest, AgentError, and CronFired to control behavior at specific moments.
- Config-driven 3-layer overrides: Merge hooks from ~/.xbot/hooks.json, <project>/.xbot/hooks.json, and <project>/.xbot/hooks.local.json to support personal, shared, and local settings.
- Multiple handler types: Run command scripts (with optional filtering), trigger HTTP web requests, or call MCP tools with variable interpolation.
- Decision control and guardrails: Apply deny/defer/ask/allow semantics (priority: deny > defer > ask > allow) and enable command hooks safely via enable_command_hooks.
Quick Start
Ask xbot to create a PreToolUse hook that runs a command only when the tool input contains the pattern you specify, writes it to the correct hooks.json layer, and then reloads hooks so the change takes effect immediately.