Shell-Out Plugins as Agent Tool Compatibility Layer
shell-out wrapper pattern maps to joelclaw Pi extensions when CLIs are already the source of truth
Clawdbot didn’t get a whole new orchestration brain here. It got an adapter. This swarm-tools commit adds packages/swarm-tools as a plugin that exposes 25 tools across Hive, Hivemind, Swarm Mail, and Swarm orchestration.
The clever bit is the plugin doesn’t own the state. The index.ts implementation shells out to the swarm CLI with swarm tool <name> --json, which keeps the CLI as the source of truth and avoids native dependency bundling bullshit inside the host plugin runtime.
There’s also a fallback MCP server in bin/mcp-server.ts, plus a session-to-hivemind hook that queries memory on command:new and stores a session summary on session:end. That’s the useful shape for joelclaw: keep durable behavior in boring CLIs, then expose those CLIs through whatever agent surface needs them.
Key Ideas
ClawdbotgetsSwarmcapabilities through a thin plugin instead of a second implementation.swarm tool <name> --jsonis the compatibility seam: one command shape can feed plugins, hooks, andMCPtools.Hivehandles task cells,Hivemindhandles semantic memory, andSwarm Mailhandles agent coordination and file reservations.- The
session-to-hivemindhook makes context survival explicit instead of hoping the model remembers after compaction. - The
MCPfallback convertsJSON Schematool definitions intoZodschemas, which keeps the same tool surface available to MCP-capable clients. - The
swarm-coordinationskill writes down the coordinator/worker split: decompose, create an epic, spawn workers, reserve files, report progress, review, close.
Links
- Source commit
joelhooks/swarm-toolspackages/swarm-toolsREADME at the commitclawdbot.plugin.jsonindex.tsplugin entrypointbin/mcp-server.tssession-to-hivemindhookswarm-coordinationskillswarmtools.aidocsopencode-swarm-pluginon npmModel Context ProtocolMCP Agent MailElectric SQLSuperpowers