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:
| Hook | Trigger |
|---|---|
PreToolUse | Before a tool is executed |
PostToolUse | After a tool completes |
PreBash | Before a bash command runs |
PostPrompt | After a prompt is processed |
PreAcceptEdit | Before a file edit is applied |
Plugin Commands
| Command | Description |
|---|---|
/plugin install <name> | Install a plugin from the marketplace |
/plugin list | List installed plugins |
/plugin remove <name> | Remove a plugin |
/plugin marketplace | Browse the plugin marketplace |
/hooks | View 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.