CLICommands
ox hooks
Manage event hooks triggered by daemon events such as session uploads, murmurs, and sync completions. Event hooks let you run custom commands when things happen in SageOx.
Usage
terminal
# List registered event hooks
$
# Register a new event hook
$
# Fire a synthetic event to test hooks
$
# Show how to view hook execution logs
$
Subcommands
ox hooks list
List all event hooks registered in hooks.yaml. Add --json for JSON output.
terminal
$
ox hooks add
Register a hook command to run when a daemon event fires.
terminal
$
Events:
| Source | Events |
|---|---|
| Agent | agent.idle, agent.registered |
| Daemon | daemon.started, daemon.stopped |
| Murmur | murmur.critical, murmur.received |
| Session | session.available, session.started, session.stopped, session.uploaded |
| Sync | sync.completed, sync.failed |
| All | * matches every event |
Example:
terminal
# Desktop notification when a murmur arrives
$
# Post each uploaded session event to a webhook
$
# Log every event
$
ox hooks test
Fire a synthetic event through the hook runner to verify your hooks. The event goes to all matching hooks with a test payload, and results print after about 700ms.
terminal
$
$
ox hooks log
Show how to view daemon hook execution logs.
terminal
$
Git hooks
SageOx also installs git hooks. These are managed separately from event hooks, and they run these ox hooks commands:
| Command | Purpose |
|---|---|
ox hooks commit-msg | Append configured commit trailers |
ox hooks post-commit | Run post-commit actions |
ox hooks post-rewrite | Keep recorded commit SHAs current after a rebase |
ox hooks pre-push | Record PR/issue linkage on push |
Git hooks are installed automatically by ox integrate install and ox init.
To check git hook status:
terminal
$
Hook execution
- Hooks run asynchronously; they don't block the daemon
- Each hook receives the event as JSON on stdin
- Each hook has a 500ms timeout
- Hook execution is logged to the daemon log
- Failed hooks don't affect other hooks or daemon operation
What's next
- ox integrate: Install AI agent hooks
- ox daemon: Manage the background daemon

