Event-driven triggers that fire on specific agent lifecycle events
OpenClaw hooks are custom commands or scripts that execute automatically when specific events occur in the agent lifecycle — before a message is processed, after a tool is called, when a session starts, or when an error occurs. Hooks add custom logic to the agent loop without modifying the core OpenClaw code.
Hooks are defined in the OpenClaw configuration and associated with lifecycle events (PreToolUse, PostToolUse, Stop, Notification, etc.). When the event fires, OpenClaw runs the associated command or script. Hooks can inspect and modify agent behavior, log events to external systems, trigger alerts, or enforce custom safety policies.
Hooks are the extension point for custom operational logic. You can use them to: log every tool call for audit trails, block dangerous operations, sync data to external systems, trigger alerts on errors, or implement approval workflows for sensitive actions. Clawfleet uses hooks internally for monitoring and safety enforcement.
Clawfleet manages your OpenClaw instance — OpenClaw Hooks, backups, restarts, and cost tracking — all included. Start for $1.
Deploy for $1 →