Hooks catalogue
WednesdayAI ships five bundled hooks. They are auto-discovered fromdist/hooks/bundled/ and managed via the CLI.
openclaw onboard), the wizard prompts you to enable recommended hooks.
Bundled hooks
The following five hooks ship with WednesdayAI and are managed via the CLI.session-memory
Saves session context to the agent workspace when you issue /new or /reset. Useful for giving the agent a memory of previous sessions.
Enable:
Configuring injected message counts
session-journal
Writes a reflective LLM journal entry to the agent’s journal/ folder when an opted-in agent issues /new or /reset. Unlike most bundled hooks, this hook is enabled per-agent rather than globally — there is no hooks.internal.entries key for it.
Enable: add
sessionJournal.enabled: true to the agent’s entry in openclaw.json:
sessionJournal.enabled: false (or omit the key entirely) to disable for a specific agent. The prompt field is optional; the default targets patient-notes / coaching-journal style entries.
What it does: on /new or /reset, the hook calls the LLM with the current session transcript and the configured prompt, generates a slug from the response, and writes the journal entry to <effectiveWorkspaceDir>/journal/YYYY-MM-DD-HHMMss-<slug>.md. When workspaceLane is in context, effectiveWorkspaceDir is the lane-local directory; otherwise it falls back to the agent’s configured workspace.
Limitations: journal entries are written only when a session explicitly resets via /new or /reset. Sessions that end via process exit, connection drop, or idle timeout do not produce an entry. The /new and /reset commands block until the LLM call completes (up to ~15 s) — disable this hook for an agent if that latency is unacceptable.
bootstrap-extra-files
Injects additional files from configured glob/path patterns into the agent workspace during bootstrap. Used to include extra context roots (for example monorepo AGENTS.md/TOOLS.md files) without changing the workspace root.
Enable:
~/.openclaw/openclaw.json:
command-logger
Logs all command events to a local log file. Provides an audit trail of every /command sent to the gateway.
Enable:
boot-md
Runs BOOT.md from each configured agent’s resolved workspace at gateway startup. Useful for injecting startup instructions or running an initialisation checklist.
Enable:
Standalone hook events
These are runtime events thatHOOK.md handlers can subscribe to. They are emitted by the WednesdayAI runtime and are not bundled hooks.
message:sent
Fires after WednesdayAI delivers a reply to the channel and receives delivery confirmation.
Payload:
Lifecycle plugin hooks
Lifecycle plugin hooks are theapi.on(...) surface defined by the PluginHookName union in src/plugins/types.ts — model resolution, prompt build, LLM input/output, tool calls, message and session lifecycle, subagents, gateway start/stop, and the context.* / compaction.plan context-engine hooks. The full contract with event shapes and mutation semantics lives in the Plugin hooks reference; the hook below is one mutating example from that set.
subagent_spawning
subagent_spawning is a lifecycle plugin hook, not a standalone hook event. It can only be used
inside a plugin via api.on("subagent_spawning", handler). It cannot be subscribed to from a
HOOK.md file.Return shape
The handler must return one of:{ status: "ok" } to allow the spawn, { status: "ok", threadBindingReady: true } if a thread binding is ready, or { status: "error", error: "reason" } to block the spawn.
Hook discovery order
Hooks are discovered in this order (highest precedence first):<workspace>/hooks/- per-agent hooks~/.openclaw/hooks/- user-installed shared hooks<openclaw>/dist/hooks/bundled/- bundled hooks (this catalogue)
name in a lower-precedence directory.
Installing custom hooks
npm install --ignore-scripts. Keep hook dependencies to pure JS/TS packages with no postinstall build steps.
Writing a hook
See Hooks for the full hook authoring guide, including the handler signature, all available events, andHOOK.md frontmatter format.