You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 36b1800
Browse filesBrowse the repository at this point in the historyBrowse files
Claude Code plugin with a bundled MCP server (`.mcp.json` → `dist/index.js`, built from `src/index.ts` with `bun run build`; commit the bundle, CI checks it is current). Core modules:
28
+
Claude Code plugin with a bundled MCP server (`.claude-plugin/plugin.json``mcpServers` → `dist/index.js`, built from `src/index.ts` with `bun run build`; commit the bundle, CI checks it is current). Core modules:
| Hook |`scripts/route-to-opencode.sh`, `plugin-hooks/hooks.json`| PreToolUse `Agent\|Task`: rewrites only built-in subagent calls (general-purpose, claude, Explore, Plan, claude-code-guide, statusline-setup) to `opencode-worker` on Haiku (Explore/Plan/claude-code-guide forced read-only); custom, plugin, reviewer and SDD agents never routed; pass-through guards: `OPENCODE_DELEGATE_ROUTE=off`, missing opencode, `[no-opencode]`, no `jq`|
24
-
| MCP |`.mcp.json`, `src/index.ts`, `dist/index.js`|`opencode` MCP server (stdio, `bun ${CLAUDE_PLUGIN_ROOT}/dist/index.js`) exposing `delegate`, `delegate_async`, `task_result`, `task_list`, `task_cancel`, `list_models`, `list_sessions` to the main thread; its `instructions` (always in the system prompt) make delegation the default for implementation |
25
-
| Manifests |`.claude-plugin/plugin.json`, `marketplace.json`| Plugin identity; `plugin.json` carries homepage/repository shown by Claude Code |
| Hook |`scripts/route-to-opencode.sh`, `plugin-hooks/hooks.json`| PreToolUse `Agent\|Task`: rewrites only built-in subagent calls (general-purpose, claude, Explore, Plan, claude-code-guide, statusline-setup) to `opencode-worker` on Haiku (Explore/Plan/claude-code-guide forced read-only); custom, plugin, reviewer and SDD agents never routed; pass-through guards: `OPENCODE_DELEGATE_ROUTE=off`, missing opencode, `[no-opencode]`, no `jq`|
24
+
| MCP |`plugin.json``mcpServers`, `src/index.ts`, `dist/index.js`|`opencode` MCP server (stdio, `bun ${CLAUDE_PLUGIN_ROOT}/dist/index.js`) exposing `delegate`, `delegate_async`, `task_result`, `task_list`, `task_cancel`, `list_models`, `list_sessions` to the main thread; its `instructions` (always in the system prompt) make delegation the default for implementation |
25
+
| Manifests |`.claude-plugin/plugin.json`, `marketplace.json`| Plugin identity; `plugin.json` carries homepage/repository shown by Claude Code |
26
26
27
27
`src/` backs the MCP server (`src/index.ts`). The installed plugin cache has no `node_modules`, so what runs is the committed bundle `dist/index.js`: changing `src/` changes plugin behaviour only after `bun run build`, and CI fails if `dist/` is stale. Its exports (`delegate`, `resolveModel`, `buildArgs`, `EventCollector`) are also the reference for how `opencode run` must be invoked and how its JSON stream is parsed; `opencode-worker` shells out to `opencode run` itself, so keep its command consistent with `buildArgs`.
| MCP |`plugin.json``mcpServers`, `dist/index.js`|`opencode` MCP server (bundled from `src/index.ts`): `delegate` and friends as main-thread tools |
21
21
22
22
The MCP server exposes seven tools: `delegate` (run and wait), `delegate_async` (background run, returns a task id), `task_result`, `task_list`, `task_cancel`, `list_models` and `list_sessions`. Claude can call `delegate` directly for implementation work without launching an agent. `dist/index.js` is a committed bundle (the installed plugin cache has no `node_modules`); rebuild it with `bun run build` after changing `src/`, CI fails if it is stale. Claude Desktop is not supported.
0 commit comments