moltbot hooks
Manage agent hooks (event-driven automations for commands like /new, /reset, and gateway startup). Related:
List All Hooks
moltbot hooks listList 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:
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 chanceExample (verbose):
moltbot hooks list --verboseShows missing requirements for ineligible hooks.Example (JSON):
moltbot hooks list --jsonReturns structured JSON for programmatic use.
Get Hook Information
moltbot hooks info <name>Show detailed information about a specific hook.Arguments:
<name>: Hook name (e.g.,session-memory)
Options:
--json: Output as JSON
Example:
moltbot hooks info session-memoryOutput:
💾 session-memory ✓ Ready
Save session context to memory when /new command is issued
Details:
Source: moltbot-bundled
Path: /path/to/moltbot/hooks/bundled/session-memory/HOOK.md
Handler: /path/to/moltbot/hooks/bundled/session-memory/handler.ts
Homepage: /hooks#session-memory
Events: command:new
Requirements:
Config: ✓ workspace.dirCheck Hooks Eligibility
moltbot hooks checkShow summary of hook eligibility status (how many are ready vs. not ready).Options:
--json: Output as JSON
Example output:
Hooks Status
Total hooks: 4
Ready: 4
Not ready: 0Enable a Hook
moltbot hooks enable <name>Enable a specific hook by adding it to your config (~/.clawdbot/config.json).Note: Hooks managed by plugins show plugin:<id> in moltbot hooks list and
can’t be enabled/disabled here. Enable/disable the plugin instead.Arguments:
<name>: Hook name (e.g.,session-memory)
Example:
moltbot hooks enable session-memoryOutput:
✓ Enabled hook: 💾 session-memoryWhat it does:
- Checks if hook exists and is eligible
- Updates
hooks.internal.entries.<name>.enabled = truein 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
moltbot hooks disable <name>Disable a specific hook by updating your config.Arguments:
<name>: Hook name (e.g.,command-logger)
Example:
moltbot hooks disable command-loggerOutput:
⏸ Disabled hook: 📝 command-loggerAfter disabling:
- Restart the gateway so hooks reload
Install Hooks
moltbot hooks install <path-or-spec>Install a hook pack from a local folder/archive or npm.What it does:
- Copies the hook pack into
~/.clawdbot/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 tohooks.internal.load.extraDirs)
Supported archives:.zip, .tgz, .tar.gz, .tarExamples:
# Local directory
moltbot hooks install ./my-hook-pack
# Local archive
moltbot hooks install ./my-hook-pack.zip
# NPM package
moltbot hooks install @moltbot/my-hook-pack
# Link a local directory without copying
moltbot hooks install -l ./my-hook-packUpdate Hooks
moltbot hooks update <id>
moltbot hooks update --allUpdate installed hook packs (npm installs only).Options:
--all: Update all tracked hook packs--dry-run: Show what would change without writing
Bundled Hooks
session-memory
Saves session context to memory when you issue /new.Enable:
moltbot hooks enable session-memoryOutput:~/clawd/memory/YYYY-MM-DD-slug.mdSee: session-memory documentation
command-logger
Logs all command events to a centralized audit file.Enable:
moltbot hooks enable command-loggerOutput:~/.clawdbot/logs/commands.logView logs:
# Recent commands
tail -n 20 ~/.clawdbot/logs/commands.log
# Pretty-print
cat ~/.clawdbot/logs/commands.log | jq .
# Filter by action
grep '"action":"new"' ~/.clawdbot/logs/commands.log | jq .See: command-logger documentation
soul-evil
Swaps injected SOUL.md content with SOUL_EVIL.md during a purge window or by random chance.Enable:
moltbot hooks enable soul-evilSee: SOUL Evil Hook
boot-md
Runs BOOT.md when the gateway starts (after channels start).Events: gateway:startupEnable:
moltbot hooks enable boot-md