Skip to content

Claude Code Plugin

The waggle plugin gives Claude Code agents access to ACP coordination primitives. It’s how Claude Code instances participate in multi-agent workflows.

One MCP tool called waggle with 5 ACP operations + wait:

OperationDescription
publishPublish an event to the coordination server
claimAtomically claim a resource (mutex)
releaseRelease a claimed resource
get_stateRead shared state
set_stateWrite shared state
waitSleep until an event arrives
{
"dance": [
{ "do": "claim", "resource": "file:src/api.ts" },
{ "do": "read_file", "path": "src/api.ts" },
{ "do": "publish", "type": "file.claimed", "data": { "file": "src/api.ts" } }
],
"wait": "review.complete"
}

The plugin lives in plugins/acp/ and is loaded automatically by the claude() shell function if configured:

Terminal window
# Manual load
claude --plugin-dir ~/projects/honeybee/plugins/acp

The plugin auto-detects a running incubator by checking .honeyb/brood.state.json. If no incubator is found, it can auto-spawn one.

  1. Claude Code starts with the waggle plugin loaded
  2. The plugin discovers the local incubator (via .honeyb/brood.state.json)
  3. When Claude calls the waggle tool, the plugin makes HTTP requests to the incubator
  4. Events, state changes, and claims are processed server-side
  5. Results return to Claude as tool output

The plugin handles session tokens automatically — the incubator assigns a session on first connect, and the plugin includes it in subsequent requests for anti-spoofing.

Multiple Claude Code instances can coordinate through the waggle plugin:

Claude A (frontend) Claude B (backend)
│ │
├─ waggle: set_state │
│ key: "api_spec_ready" │
│ value: "true" │
│ ├─ waggle: wait
│ │ types: ["state.changed"]
│ │
│ │ ← (wakes up)
│ ├─ waggle: get_state
│ │ key: "api_spec_ready"
│ │ → "true"
│ ├─ waggle: claim
│ │ resource: "file:src/api.ts"

This has been verified end-to-end: Opus sets state → spawns Haiku Task agent → Haiku reads state, publishes event, writes response → Opus reads response. Two Claudes coordinating through a live incubator.

The plugin.json configures MCP server startup:

{
"name": "waggle",
"description": "ACP coordination for Claude Code",
"mcpServers": {
"waggle": {
"command": "node",
"args": ["server.js"]
}
}
}

Note: Only stdio-based MCP ("command" + "args") works in Claude Code plugins. URL-based MCP causes hangs.