这是一项Claude代码技能,用于在一台机器上运行一组会话,并让它们通过SendMessage相互通信。
概览
一个Claude代码技能,用于运行一个并用SendMessage让它们互相通信。 Claude Code 2.1.224 增加了跨会话消息:一个会话可以向另一个会话发送消息,该消息作为接收会话中的 a 到达。这项技能将原始语变成了一个工作循环——生成舰队,发放简报,收集回复,并在请求时拆除。 或者把这个文件夹复制到 ~/.claude/skills/peer-sessions/ 里。 - macOS 或 Linux 上的 Claude Code。旧版本不发布消息套接字,因此会话是活的,但其他会话无法访问。- 生成脚本的 CMUX。消息本身不需要终端复用器——只需舰队布局。 然后给每个同伴发送一份简报,最后以你自己的地址结束,然后停止。同伴回复就是通知——它会在新回合唤醒你,所以轮询循环只会烧掉代币。 ——布局决定布局。脚本会打印匹配的拆解命令,所以你永远不会关闭超过你完成的数量。
概述(AI 翻译)
一个克劳德代码技能,用于在一台机器上运行多组克劳德代码会话并让它们用SendMessage相互通信。
Claude Code 2.1.224 增加了跨会话消息:一个会话可以向另一个会话发送消息,该消息作为接收会话中的用户提示到达。这项技能将原始机制变成了一个工作循环——生成舰队,发放简报,收集回复,并在请求时拆除。
安装
或者把这个文件夹复制到~/.claude/skills/peer-sessions/。
要求
- Claude Code **2.1.224 或更新版本,适用于 macOS 或 Linux。旧版本不发布消息套接字,因此会话是活的,但其他会话无法访问该会话。
cmux用于生成脚本。消息本身不需要终端复用器——只需舰队布局。
循环
然后给每个同伴发送一份简报,最后以你自己的地址结束,然后停止。同伴回复就是通知——它会在新回合唤醒你,所以轮询循环只会烧掉代币。
舰队出现的地方
--placement 决定布局。脚本打印匹配的拆除命令,所以你永远不会关闭超过你赚的钱。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
peer-sessions
A Claude Code skill for running a fleet of Claude Code sessions on one machine and making them talk to each other with SendMessage.
Claude Code 2.1.224 added cross-session messaging: one session can send a message to another, and that message arrives as a user prompt in the receiving session. This skill turns that primitive into a working loop — spawn a fleet, hand out briefs, collect the replies, and tear it down when you ask.
Install
npx skills@latest add ray-amjad/peer-sessions
Or copy this folder into ~/.claude/skills/peer-sessions/.
Requirements
- Claude Code 2.1.224 or newer on macOS or Linux. Older builds publish no messaging socket, so a session is alive but no other session can reach it.
cmuxfor the spawn scripts. The messaging itself needs no terminal multiplexer — only the fleet layout does.
The loop
spawn a fleet → send a brief to each peer → end your turn → replies arrive as new user turns → hand back the teardown
python3 ~/.claude/skills/peer-sessions/scripts/spawn-fleet.py --placement window \
orbits:/tmp/lab/orbits planets:/tmp/lab/planets sun:/tmp/lab/sun
window F8464A83-... (new)
+ orbits uds:/tmp/cc-socks/17466.sock
+ planets uds:/tmp/cc-socks/17398.sock
+ sun uds:/tmp/cc-socks/17585.sock
3 ready in 10s.
Then send each peer a brief that ends with your own address, and stop. A peer reply is the notification — it wakes you as a new turn, so a poll loop only burns tokens.
Where the fleet appears
--placement decides the layout. The script prints the matching teardown commands, so you never close more than you made. Teardown is off by default — the fleet stays alive, with its context, until you ask for it to go.
| Placement | Where the peers land | Pick it when |
|---|---|---|
split |
new panes beside your own pane, in your workspace | 1-3 peers, short work, you want to watch them. Your pane keeps the focus. |
workspace (default) |
new workspaces in your window | 3+ peers, or work that runs for minutes. Your current screen stays clean. |
window |
a new window, with the workspaces inside it | a big fleet, a screen recording, or a second monitor. |
--direction right|left|up|down places each new pane, --focus true|false decides whether the UI moves to the fleet, and --per-workspace 1 gives every session its own workspace. See references/placement.md.
What is in the box
| File | Contents |
|---|---|
SKILL.md |
The happy path: spawn, brief, end turn, hand back the teardown |
references/placement.md |
Every spawn flag, the placement edge cases, teardown syntax |
references/manual-rig.md |
The cmux object model, --id-format, manual layouts, --fork-session |
references/troubleshooting.md |
The four message checkpoints, the version wall, stale sockets, CLI traps |
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add ray-amjad/peer-sessions