OpenClawSkills
GitHub
CLI Reference β€’ TutorialHeader.readTime

Hooks

CLI reference for openclaw hooks (agent hooks).

Manage agent hooks (event-driven automation commands like ''/new'', ''/reset'', and gateway startup).

Related:

- Hooks: ''Hooks''

- Plugin hooks: ''Plugins''

Tutorial.step

List all hooks

Bash
openclaw hooks list

Lists all hooks discovered from workspace, hosted directories, and bundled directories.

Options:

- ''--eligible'': Show only eligible hooks (meet requirements)

- ''--json'': Output as JSON

- ''-v, --verbose'': Show details including missing requirements

Output example:

Example (verbose):

Terminal
Hooks (4/4 ready)

Ready:
  πŸš€ boot-md βœ“ - Run BOOT.md on gateway startup
  πŸ“ command-logger βœ“ - Log all command events to a centralized audit file
  πŸ’Ύ session-memory βœ“ - Save session context to memory when /new command is issued
  😈 soul-evil βœ“ - Swap injected SOUL content during a purge window or by random chance

Shows missing requirements for ineligible hooks.

Bash
openclaw hooks list --verbose

Example (JSON):

Returns structured JSON for programmatic use.

Bash
openclaw hooks list --json

ReferenceCliHooksPage step 01: P11

Tutorial.step

Get hook info

Bash
openclaw hooks info <name>

Shows detailed information about a specific hook.

Arguments:

- ''<name>'': Hook name (e.g., ''session-memory'')

Options:

- ''--json'': Output as JSON

Bash
openclaw hooks info session-memory

Example:

Terminal
πŸ’Ύ session-memory βœ“ Ready

Save session context to memory when /new command is issued

Details:
  Source: openclaw-bundled
  Path: /path/to/openclaw/hooks/bundled/session-memory/HOOK.md
  Handler: /path/to/openclaw/hooks/bundled/session-memory/handler.ts
  Homepage: https://docs.openclaw.ai/hooks#session-memory
  Events: command:new

Requirements:
  Config: βœ“ workspace.dir
Tutorial.step

Check hooks eligibility

Bash
openclaw hooks check

Shows a summary of hook eligibility status (ready vs not ready counts).

Options:

- ''--json'': Output as JSON

Terminal
Hooks Status

Total hooks: 4
Ready: 4
Not ready: 0
Tutorial.step

Enable hook

Bash
openclaw hooks enable <name>

Enables a specific hook by adding it to your configuration (''~/.openclaw/config.json'').

''Note:'' Hooks managed by plugins show ''plugin:<id>'' in ''openclaw hooks list'' and

cannot be enabled/disabled here. Instead, enable/disable the plugin.

Arguments:

- ''<name>'': Hook name (e.g., ''session-memory'')

Bash
openclaw hooks enable session-memory

Example:

Terminal
βœ“ Enabled hook: πŸ’Ύ session-memory

Output:

What it does:

- Checks that the hook exists and is eligible

- Updates ''hooks.internal.entries.<name>.enabled = true'' in your configuration

- Saves configuration to disk

After enabling:

Tutorial.step

Disable hook

Bash
openclaw hooks disable <name>

Disables a specific hook by updating your configuration.

Arguments:

- ''<name>'': Hook name (e.g., ''command-logger'')

Bash
openclaw hooks disable command-logger

Example:

Terminal
⏸ Disabled hook: πŸ“ command-logger

Output:

After disabling:

Tutorial.step

Install hook

Bash
openclaw hooks install <path-or-spec>

Installs a hook package from a local folder/archive or npm.

What it does:

- Copies hook package to ''~/.openclaw/hooks/<id>''

- Enables installed hooks in ''hooks.internal.entries.*''

- Records installation under ''hooks.internal.installs''

Options:

- ''-l, --link'': Link local directory instead of copying (adds to ''hooks.internal.load.extraDirs'')

''Supported archives:'' ''.zip'', ''.tgz'', ''.tar.gz'', ''.tar''

Bash
openclaw hooks install ./my-hook-pack


openclaw hooks install ./my-hook-pack.zip


openclaw hooks install @openclaw/my-hook-pack


openclaw hooks install -l ./my-hook-pack
Tutorial.step

Update hook

Bash
openclaw hooks update <id>
openclaw hooks update --all

Updates installed hook packages (npm installs only).

Options:

- ''--all'': Update all tracked hook packages

- ''--dry-run'': Show what would change without writing

Tutorial.step

Bundle hook

#

Tutorial.step

Session memory

Saves session context to memory when you issue ''/new''.

Enable:

Bash
openclaw hooks enable session-memory

Output: ~/.openclaw/workspace/memory/YYYY-MM-DD-slug.md

See: session memory docs

#

Tutorial.step

Command logger

Logs all command events to a centralized audit file.

Enable:

Bash
openclaw hooks enable command-logger

Output: ~/.openclaw/logs/commands.log

View logs:

Bash
tail -n 20 ~/.openclaw/logs/commands.log


cat ~/.openclaw/logs/commands.log | jq .


grep '"action":"new"' ~/.openclaw/logs/commands.log | jq .

See: command logger docs

### Soul evil

Swaps injected ''SOUL.md'' content with ''SOUL_EVIL.md'' during a purge window or by random chance.

Bash
openclaw hooks enable soul-evil

See: soul evil hook docs

#

Tutorial.step

Boot md

Runs ''BOOT.md'' on gateway startup (after channels start).

Event: gateway:startup

Enable:

Bash
openclaw hooks enable boot-md

See: boot-md docs