Plugins

Extend Clew Code without touching source code. Plugins can add tools, hook into lifecycle events, and integrate with external systems.

Overview

Plugins are self-contained packages with a manifest file that declare hooks, tools, and configurations. They are hot-reloadable — no restart needed.

Lifecycle Hooks

Plugins can hook into every stage of the agent lifecycle:

HookTrigger
PreToolUseBefore a tool is executed
PostToolUseAfter a tool completes
PreBashBefore a bash command runs
PostPromptAfter a prompt is processed
PreAcceptEditBefore a file edit is applied

Plugin Commands

CommandDescription
/plugin install <name>Install a plugin from the marketplace
/plugin listList installed plugins
/plugin remove <name>Remove a plugin
/plugin marketplaceBrowse the plugin marketplace
/hooksView active hooks

Plugin Manifest

Plugins declare themselves via a manifest:

{
  "name": "my-plugin",
  "version": "1.0.0",
  "hooks": {
    "PreToolUse": "./pre-tool.js",
    "PostToolUse": "./post-tool.js"
  },
  "tools": [
    {
      "name": "my_custom_tool",
      "description": "A custom tool",
      "schema": { ... }
    }
  ]
}

Plugin Marketplace

Discover and install community plugins via the built-in marketplace browser. Use /plugin marketplace to explore available plugins.