coderClaw

coderclaw hooks

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

Related:

List All Hooks

coderclaw hooks list

List all discovered hooks from workspace, managed, and bundled directories.

Options:

Example output:

Hooks (4/4 ready)

Ready:
  πŸš€ boot-md βœ“ - Run BOOT.md on gateway startup
  πŸ“Ž bootstrap-extra-files βœ“ - Inject extra workspace bootstrap files during agent bootstrap
  πŸ“ command-logger βœ“ - Log all command events to a centralized audit file
  πŸ’Ύ session-memory βœ“ - Save session context to memory when /new command is issued

Example (verbose):

coderclaw hooks list --verbose

Shows missing requirements for ineligible hooks.

Example (JSON):

coderclaw hooks list --json

Returns structured JSON for programmatic use.

Get Hook Information

coderclaw hooks info <name>

Show detailed information about a specific hook.

Arguments:

Options:

Example:

coderclaw hooks info session-memory

Output:

πŸ’Ύ session-memory βœ“ Ready

Save session context to memory when /new command is issued

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

Requirements:
  Config: βœ“ workspace.dir

Check Hooks Eligibility

coderclaw hooks check

Show summary of hook eligibility status (how many are ready vs. not ready).

Options:

Example output:

Hooks Status

Total hooks: 4
Ready: 4
Not ready: 0

Enable a Hook

coderclaw hooks enable <name>

Enable a specific hook by adding it to your config (~/.coderclaw/config.json).

Note: Hooks managed by plugins show plugin:<id> in coderclaw hooks list and can’t be enabled/disabled here. Enable/disable the plugin instead.

Arguments:

Example:

coderclaw hooks enable session-memory

Output:

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

What it does:

After enabling:

Disable a Hook

coderclaw hooks disable <name>

Disable a specific hook by updating your config.

Arguments:

Example:

coderclaw hooks disable command-logger

Output:

⏸ Disabled hook: πŸ“ command-logger

After disabling:

Install Hooks

coderclaw hooks install <path-or-spec>

Install a hook pack from a local folder/archive or npm.

Npm specs are registry-only (package name + optional version/tag). Git/URL/file specs are rejected. Dependency installs run with --ignore-scripts for safety.

What it does:

Options:

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

Examples:

# Local directory
coderclaw hooks install ./my-hook-pack

# Local archive
coderclaw hooks install ./my-hook-pack.zip

# NPM package
coderclaw hooks install @coderclaw/my-hook-pack

# Link a local directory without copying
coderclaw hooks install -l ./my-hook-pack

Update Hooks

coderclaw hooks update <id>
coderclaw hooks update --all

Update installed hook packs (npm installs only).

Options:

Bundled Hooks

session-memory

Saves session context to memory when you issue /new.

Enable:

coderclaw hooks enable session-memory

Output: ~/.coderclaw/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:

coderclaw hooks enable bootstrap-extra-files

See: bootstrap-extra-files documentation

command-logger

Logs all command events to a centralized audit file.

Enable:

coderclaw hooks enable command-logger

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

View logs:

# Recent commands
tail -n 20 ~/.coderclaw/logs/commands.log

# Pretty-print
cat ~/.coderclaw/logs/commands.log | jq .

# Filter by action
grep '"action":"new"' ~/.coderclaw/logs/commands.log | jq .

See: command-logger documentation

boot-md

Runs BOOT.md when the gateway starts (after channels start).

Events: gateway:startup

Enable:

coderclaw hooks enable boot-md

See: boot-md documentation