Documentation Index
Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
Use this file to discover all available pages before exploring further.
Hooks
Hooks are small TypeScript handlers that run inside the gateway when events fire —/new, /reset, /stop, agent lifecycle events, and more.
When to use hooks vs plugins
- Hooks: react to gateway events, run lightweight automation, no new tools or commands
- Plugins: add new tools, commands, providers, or channel integrations
Bundled hooks
WednesdayAI ships with four bundled hooks:| Hook | Event | Effect |
|---|---|---|
session-memory | command:new | Saves session context to the agent workspace |
bootstrap-extra-files | agent:bootstrap | Injects extra files into the workspace at startup |
command-logger | all commands | Logs all commands to ~/.openclaw/logs/commands.log |
boot-md | gateway start | Runs BOOT.md when the gateway starts |
Hook structure
Each hook is a directory:HOOK.md frontmatter:
handler.ts:
Hook discovery
Hooks are auto-discovered from three directories (highest precedence first):<workspace>/hooks/— per-agent hooks~/.openclaw/hooks/— user-installed shared hooks<openclaw>/dist/hooks/bundled/— bundled hooks
Installing hook packs
Hook packs are npm packages that export multiple hooks:openclaw hooks install runs npm install --ignore-scripts — keep dependencies to pure JS/TS with no postinstall build steps.
Available events
| Event | Trigger |
|---|---|
command:new | User sends /new or /reset |
command:stop | User sends /stop |
command:compact | User sends /compact |
agent:bootstrap | Agent workspace is initialised |
agent:start | Agent session starts |
agent:end | Agent session ends |
gateway:start | Gateway process starts |