Skip to content

About

Multicode plugin for Claude Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

MultiCode

A Claude Code plugin that runs a panel of N OpenCode reviewer models alongside your session. Each turn, every reviewer decides for itself whether to take over and implement a better version of your work, respond with an opinion, or pass. The first model to take over wins a race, implements its change in an isolated git worktree, and — once you approve — that change is applied to your real working tree, with an iterative verdict/revision loop.

Install

/plugin marketplace add bottomless/multicode-claude
/plugin install multicode@bottomless

Then opt a project in one of two ways:

  • Run /using-multicode in the project — it activates the session and creates a starter multicode.json for you; or
  • Just add a multicode.json with your reviewer models (see below) and start a session.

Either way MultiCode auto-activates (via a SessionStart hook) in any project that has a multicode.json, and Claude runs the review check itself at the end of each turn. Projects without a multicode.json stay dormant, so the plugin never spawns reviewer models where you don't want it.

The two skills appear in the slash menu as /using-multicode and /multicode-check (Claude usually invokes the check itself; you rarely type it).

Prerequisites

  • Node ≥ 18 on your PATH (runs the engine + hooks; the plugin is zero-dependency).
  • OpenCode installed with OpenRouter (or other provider) credentials — this is what actually runs the reviewer models. The SessionStart hook preflights it and tells you if it's missing.
  • The project is a git repo with at least one commit (reviewers work in worktrees off HEAD).

Configure your reviewers

Per project, in multicode.json at the repo root:

{
  "models": [
    { "id": "openrouter/z-ai/glm-5.2",             "slug": "glm-5.2" },
    { "id": "openrouter/deepseek/deepseek-v4-pro", "slug": "deepseek-v4-pro" },
    { "id": "openrouter/google/gemini-3.5-flash",  "slug": "gemini-3.5-flash" }
  ]
}

Behavioral knobs (env): MULTICODE_TAKEOVER_APPROVAL=ask|always|never (default ask), MULTICODE_MAX_REVIEW_ROUNDS (default 3).

How it works

Three parts ship in the plugin and communicate through small files in your project's .multicode/ directory:

Claude Code session opens (plugin enabled)
   │ auto-starts (MCP handshake)
   ▼
[ engine ]  — the plugin's MCP server, ONE process per session
   tools: activate, review_start, review_approve, review_verdict
   owns: the review state machine, the reviewer OpenCode sessions,
         the Phase-1 race, the git worktrees
   polls: .multicode/inbox/     (new-prompt events → background pre-sync)
   writes: .multicode/{turn-state.json, cycle.json, reviewers.json}
                 ▲ read/write (atomic)
   UserPromptSubmit hook ──┤ reset per-turn flag; record session; drop inbox event
   Stop hook ──────────────┘ block the turn unless /multicode-check ran this turn
  1. Activation (automatic). A SessionStart hook fires when the session opens. In a project that has a multicode.json, it marks the session active and injects a standing rule into Claude's context: run the multicode-check skill before ending every turn. No typed command. Projects without a multicode.json stay dormant.

  2. Pre-sync (unbiased reviewers). On every turn, the UserPromptSubmit hook drops the user prompt (and the path to Claude's session transcript) into .multicode/inbox/. The engine drains it and warms each reviewer's OpenCode session with the conversation transcript since they last saw it — the user's prompts and the main agent's work, with MultiCode's own machinery stripped out — before the main agent answers, so reviewers form their own view instead of being primed by Claude's output. The transcript is read incrementally via a per-session cursor (.multicode/transcript.json), so each turn only syncs what's new.

  3. The review pass. Claude auto-invokes the multicode-check skill → review_start: the engine seeds each reviewer's worktree from your current (uncommitted) tree and runs Phase 1 — every reviewer, in parallel, in PLAN mode, ends with DECISION: TAKEOVER or DECISION: PASS. The first TAKEOVER wins the race; the rest are aborted. No winner → any non-empty PASS replies are relayed to you as opinions; all-silent is a clean turn.

  4. Takeover → apply → verdict. On a takeover you approve (Yes / Always / No). The winner implements in its worktree, and the resulting diff is applied to your real working tree. You review it and either approve or request changes (which the reviewer revises — the previous patch is reverted and the new one applied). On approve, Phase 1 restarts against the updated code. The whole cycle is the state machine done → needs_approval → needs_verdict.

  5. Enforcement. The Stop hook blocks a turn from ending unless the multicode-check skill ran that turn (or a takeover is mid-cycle). State is shared with the engine through .multicode/turn-state.json.

Everything Claude relays — reviewer plans, opinions, applied diffs — is printed verbatim with honest attribution (see skills/multicode-check/SKILL.md): a change is only reported as landed if a tool result actually applied it.

Try it (no credentials needed)

A scripted fake reviewer lets you watch the entire lifecycle against a throwaway git repo:

npm run demo      # full takeover lifecycle: race → approve → apply → verdict loop → done
npm test          # deterministic assertions over the FSM
npm run smoke:real    # OPTIONAL: one real OpenCode reviewer (needs opencode + creds)

Layout

.claude-plugin/{plugin.json, marketplace.json}   # plugin + one-plugin marketplace ("bottomless")
.mcp.json                                          # engine: node ${CLAUDE_PLUGIN_ROOT}/src/engine.js
hooks/hooks.json                                   # SessionStart + UserPromptSubmit + Stop
skills/multicode-check/SKILL.md                    # the auto-triggered review skill
src/
  engine.js            # MCP stdio server = the in-process engine
  container.js         # wires deps (git, runner, store, config)
  review/{session,race,charter,prompts}.js   # the review FSM (ported)
  runners/{git,opencode,fakeOpencode}.js     # subprocess wrappers
  state/{paths,store}.js                      # file-backed cross-process state
  hooks/{sessionStart,userPromptSubmit,stop}.js   # thin hooks (SessionStart auto-activates)
  config.js, log.js
test/{drive.js, run-tests.js, real-smoke.js}
docs/superpowers/specs/2026-06-23-multicode-claude-code-plugin-design.md

It runs plain JS directly from src/ (zero dependencies, so no build step). A TypeScript + committed esbuild bundle setup is described in the design spec.

About

Multicode plugin for Claude Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages