By Soein
Run multi-AI roundtable discussions (Codex, Claude, Gemini) in tmux with @-mention chat, then promote consensus to an execute-mode swarm where a supervisor dispatches tasks to role-based agents (engineers, reviewers). Includes isolated LLM voting with multi-round debate and file injection for independent judgments.
在运行中的 discuss 圆桌加入新的 CLI 参与者
列出当前 discuss 会话的所有参与者(可 @点名的名字)
向 discuss 圆桌发一条消息,用 @name 点名触发对方接话
查看 discuss session 最近 N 轮对话(从 jsonl 读取)
启动 discuss 模式:与某个 CLI(Codex/Claude/Gemini)在一个会话内圆桌讨论
Dynamically add a role to the running swarm (execute mode). Use when user says "add a role", "加个角色", "加 database engineer", "bring backend online", "need another engineer".
Remove a role from the running swarm. Use when user says "remove role", "移除 X", "kick out backend", "少一个角色", "leave role".
Run isolated multi-AI voting with LLM consensus analysis—independent judgment, no groupthink. Dispatcher for ask/list/report/next-round/cancel subcommands. Use when user asks to "vote on X", "get independent opinions", "consensus from 3 AIs", "投票决定 / 独立判断 / 三家意见 / 避免羊群效应", supports multi-round debate and file context injection.
Add a new AI CLI participant to an ongoing discuss-mode roundtable. Use when user asks to "add another AI", "bring in claude/gemini/codex", "add participant to discussion", or mentions "加入讨论" / "加参与者".
List current participants of the discuss-mode roundtable (show who can be @-mentioned). Use when user asks "who's in the discussion", "list participants", "who can I @", "看下有谁", "列出参与者".
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
English | 中文 | 🔌 Claude Code 插件安装
Swarmesh 现在可作为 Claude Code 插件使用,提供两种协作模式:
| 模式 | 何时用 | 启动命令 |
|---|---|---|
| discuss | 想和多个 CLI(Codex / Claude / Gemini)圆桌讨论、碰方案。v0.2 起 CLI 回答自动流转 | /swarm-chat <项目> <cli> |
| vote | 多 CLI 隔离投票 + LLM 综合(对标 pal consensus,v0.6 起多轮辩论 + 文件注入 + 自动闭环) | /swarm-vote "<问题>" |
| execute | 方案已定,要由 supervisor 拆任务派发给全角色团队 | /swarm-start <项目> [profile] |
/plugin marketplace add Soein/swarmesh
/plugin install swarmesh
本地测试:claude --plugin-dir ~/项目/tmux并行
需要 Codex ≥ 0.110.0(codex --version 确认)。
# 1. 启用 plugin features
cat >> ~/.codex/config.toml <<EOF
[features]
plugins = true
EOF
# 2. 装 marketplace(本地 / GitHub / git URL 均可)
codex marketplace add Soein/swarmesh
# 或本地: codex marketplace add /path/to/swarmesh
# 3. 装插件
codex plugin install swarmesh
# 4. 验证
codex # 进入 REPL 后输入 /skills 应看到 13 个 swarm-* skills
启动后 Codex 会根据用户意图自动激活 skill(LLM 匹配 description),也可用 $swarm-chat 等显式调用。
/swarm-chat ~/my-app codex cx # 首发 Codex
/swarm-chat-add claude "claude" # 再加 Claude
/swarm-chat-msg "@cx @claude 讨论 Redis vs Dynamo 做会话缓存"
/swarm-chat-msg "@cx 基于上面对比,结论是?"
/swarm-promote --profile minimal # 讨论成熟后转 execute 落地
关键规则:
@点名 才触发对方接话(防刷屏)SWARM_DISCUSS_MAX_TURNS 调整)SWARM_DISCUSS_CONTEXT_TURNS 调整)SWARM_DISCUSS_AUTO_WATCH=0DISCUSS_CODEX_TRUST_AUTO=1)@ 自己 自动跳过/swarm-chat ~/app codex cx
/swarm-chat-add cl "claude"
/swarm-chat-add gm "gemini"
/swarm-vote "Redis vs DynamoDB 做会话缓存?"
# 30-60 秒后自动出报告(含 LLM 综合的共识/分歧/各方立场/建议决策四段)
三个 CLI 收到同一个问题独立作答、互不可见,避免讨论模式的羊群效应。
| 能力 | 引入版本 | 用法 |
|---|---|---|
| 稳定性判定(hash + prompt 防抖,避免半截答案) | v0.3-A | 自动 |
| LLM 综合分析(共识/分歧/各方立场/建议决策) | v0.3-B | 自动;VOTE_LLM_DISABLE=1 关闭 |
| Quorum / 法定人数 | v0.4 | --min-responses N |
| Vote → discuss session.jsonl 回写 | v0.4 | 自动(在 discuss 内发起时) |
| LLM-assisted extract(删启发式黑名单) | v0.5 | 自动;status ∈ {answer,abstain,incomplete,no_answer} |
| Stance 分组(pro/con/neutral/other) | v0.5.1 | 自动;report 按立场聚段 |
| 多轮辩论(看完别人答案再修正立场) | v0.5.2 | --rounds N + next-round 子命令 |
| UUID + list/cancel | v0.5.3 | discuss-vote.sh list / cancel --id |
| pane 无限 capture + LLM 压缩兜底 | v0.6.0 | 自动;超 150K 字符触发 |
--files 文件上下文注入(glob + 行号) | v0.6.1 | --files 'src/**/*.go:L1-L50,README.md' |
--auto-promote 自动闭环 | v0.6.2 | --auto-promote <profile>;最终轮综合后自动 promote |
# 1. 代码评审型投票(v0.6.1 文件注入)
discuss-vote.sh ask \
--question "这个重构合理吗?" \
--participants cx,cl,gm \
--files 'src/lib/*.sh:L1-L100,docs/ARCHITECTURE.md' \
--min-responses 2
# 2. 多轮辩论(v0.5.2,3 轮,每轮看上轮立场)
ID=$(discuss-vote.sh ask --rounds 3 --question "方案 A vs B vs C?" | tail -1)
discuss-vote.sh collect --id $ID
discuss-vote.sh report --id $ID
discuss-vote.sh next-round --id $ID # paste 上轮立场 + 重置 expect
discuss-vote.sh collect --id $ID
# 重复直到最终轮
# 3. 全自动闭环(v0.6.2):投票 → 综合 → 自动起 execute
discuss-vote.sh ask \
--question "下一步做什么?" \
--participants cx,cl \
--auto-promote full-stack
# 最终轮 LLM 综合给出"## 建议决策"段后,自动:
# - 生成 brief-for-promote.md
# - 调 discuss-relay.sh promote --brief-file ... --profile full-stack
# - tmux 切到 execute session,supervisor 拿到 brief 开工
| 维度 | pal | swarm |
|---|---|---|
| 多模型投票 / 综合 / stance / confidence / abstain / quorum / relevant-files | ✅ | ✅ |
| 多轮辩论(参与者看到对方立场再修正) | ❌ | ✅ |
| 参与者自带 skills / MCP / plugins / 文件读写工具 | ❌ | ✅ |
| 投票 → execute 自动闭环 | ❌ | ✅ |
| MCP 调用 / 秒级延迟 / 无状态 | ✅ | ❌(CLI + tmux) |
/swarm-start ~/my-app minimal # 起 4 角色团队
/swarm-task "实现用户注册系统" # 派发给 supervisor,自动拆解
/swarm-status # 观察进度
/swarm-stop # 结束
| 命令 | 模式 | 作用 |
|---|---|---|
/swarm-start | execute | 启动蜂群 |
/swarm-task | execute | 派发任务 |
/swarm-join / /swarm-leave | execute | 动态增删角色 |
/swarm-chat | discuss | 启动圆桌 |
/swarm-chat-add | discuss | 加参与者 |
/swarm-chat-list | discuss | 列出当前参与者(可 @点名的名字) |
/swarm-chat-msg | discuss | 发消息(@点名,v0.2 自动流转) |
/swarm-chat-tail | discuss | 查看最近 N 轮对话历史 |
/swarm-vote | discuss | 隔离投票(v0.6:LLM-first + 多轮辩论 + 文件注入 + 自动闭环) |
/swarm-promote | discuss→execute | 结案转落地 |
/swarm-status | 通用 | 查看状态 |
/swarm-stop | 通用 | 停止 |
${CLAUDE_PLUGIN_ROOT}/scripts/check-deps.sh
SessionStart hook 会自动检测;缺依赖时打印安装建议但不阻塞会话。
npx claudepluginhub soein/swarmesh --plugin swarmeshMulti-agent deliberation for AI coding assistants
Launch agent teams for any kind of work — coding, writing, diagnosis, and more
Haiku-agent bridge — Claude Code spawns Haiku subagents that run OpenCode via CLI (opencode run). No tmux required. Workers stream colored logs to /tmp/swarm-code-logs/. Saves 70-80% tokens.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Consult multiple AI coding agents (Gemini, OpenAI, Grok, Perplexity, plus codex and gemini CLIs when installed) to get diverse perspectives on coding problems
Multi-agent orchestration for Claude Code. 12 specialized agents working in parallel — planning, building, reviewing, debugging. Plus a Hub for always-alive multi-project sessions controllable from Telegram or Slack.