Skip to main content

openclaw hooks

Manage agent hooks (event-driven automations for commands like /new, /reset, and gateway startup). Related:

List All Hooks

List all discovered hooks from workspace, managed, and bundled directories. Options:
  • --eligible: Show only eligible hooks (requirements met)
  • --json: Output as JSON
  • -v, --verbose: Show detailed information including missing requirements
Example output:
Example (verbose):
Shows missing requirements for ineligible hooks. Example (JSON):
Returns structured JSON for programmatic use.

Get Hook Information

Show detailed information about a specific hook. Arguments:
  • <name>: Hook name (e.g., session-memory)
Options:
  • --json: Output as JSON
Example:
Output:

Check Hooks Eligibility

Show summary of hook eligibility status (how many are ready vs. not ready). Options:
  • --json: Output as JSON
Example output:

Enable a Hook

Enable a specific hook by adding it to your config (~/.openclaw/config.json). Note: Hooks managed by plugins show plugin:<id> in openclaw hooks list and canโ€™t be enabled/disabled here. Enable/disable the plugin instead. Arguments:
  • <name>: Hook name (e.g., session-memory)
Example:
Output:
What it does:
  • Checks if hook exists and is eligible
  • Updates hooks.internal.entries.<name>.enabled = true in your config
  • Saves config to disk
After enabling:
  • Restart the gateway so hooks reload (menu bar app restart on macOS, or restart your gateway process in dev).

Disable a Hook

Disable a specific hook by updating your config. Arguments:
  • <name>: Hook name (e.g., command-logger)
Example:
Output:
After disabling:
  • Restart the gateway so hooks reload

Install Hooks

Install a hook pack from a local folder/archive or npm. Npm specs are registry-only (package name + optional exact version or dist-tag). Git/URL/file specs and semver ranges are rejected. Dependency installs run with --ignore-scripts for safety. Bare specs and @latest stay on the stable track. If npm resolves either of those to a prerelease, OpenClaw stops and asks you to opt in explicitly with a prerelease tag such as @beta/@rc or an exact prerelease version. What it does:
  • Copies the hook pack into ~/.openclaw/hooks/<id>
  • Enables the installed hooks in hooks.internal.entries.*
  • Records the install under hooks.internal.installs
Options:
  • -l, --link: Link a local directory instead of copying (adds it to hooks.internal.load.extraDirs)
  • --pin: Record npm installs as exact resolved name@version in hooks.internal.installs
Supported archives: .zip, .tgz, .tar.gz, .tar Examples:

Update Hooks

Update installed hook packs (npm installs only). Options:
  • --all: Update all tracked hook packs
  • --dry-run: Show what would change without writing
When a stored integrity hash exists and the fetched artifact hash changes, OpenClaw prints a warning and asks for confirmation before proceeding. Use global --yes to bypass prompts in CI/non-interactive runs.

Bundled Hooks

session-memory

Saves session context to memory when you issue /new. Enable:
Output: ~/.openclaw/workspace/memory/YYYY-MM-DD-slug.md See: session-memory documentation

bootstrap-extra-files

Injects additional bootstrap files (for example monorepo-local AGENTS.md / TOOLS.md) during agent:bootstrap. Enable:
See: bootstrap-extra-files documentation

command-logger

Logs all command events to a centralized audit file. Enable:
Output: ~/.openclaw/logs/commands.log View logs:
See: command-logger documentation

boot-md

Runs BOOT.md when the gateway starts (after channels start). Events: gateway:startup Enable:
See: boot-md documentation