| Hook | `scripts/route-to-opencode.sh`, `scripts/guard-main-thread-mcp.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 `claudelegate: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`. Second PreToolUse entry (`guard-main-thread-mcp.sh`) denies this plugin's MCP `delegate`/`delegate_async` when the input has no `agent_id` (main thread); calls from `opencode-worker` pass |
0 commit comments