czm15053/dsh-peer-link
Let dsh and Claude Code sessions message each other directly; comes with a clickable peer list card (sort/search/send/refresh).
Listed
6
Session
Bundle verified
What it does
Let dsh and Claude Code sessions message each other directly; comes with a clickable peer list card (sort/search/send/refresh).
Best for
- Local workflows where DSH and Claude Code sessions need to exchange messages directly.
- Users coordinating several DSH sessions through one registered peer with per-session routing identifiers.
- Operators who want a searchable, sortable peer list with refresh and click-to-send controls in DSH.
Not ideal for
- Cross-machine or hosted collaboration; the documented transport is a local Unix socket.
- Claude Code setups older than 2.1.224 or without the required cross-session feature configuration.
- Workflows that do not need agent-to-agent messaging gain little from the peer registry and message UI.
README
dsh-peer-link
点对点消息工具:让 DeepSeek Harness(dsh)会话与其他本机 agent 会话(如 Claude Code)通过 unix socket 互发消息。
特性
-
单 peer 注册:dsh 进程注册为一个 peer(
dsh-<pid>),Claude Code 的 ListAgents/SendMessage 可直接发现并回复 -
会话标识 + 内部转发:dsh 的每个会话有独立短 id,消息带
@dsh-<pid>:<session>标识,Claude 回复时带标识,dsh 内部转发到对应会话 - 收消息:收到 peer 消息 → 以用户消息气泡注入对应 dsh 会话(web 可见)
-
发消息:
peer_send工具把消息写回对方 socket -
列 peer:
peer_list工具列出活跃 peer(按目录筛选、按创建时间排序) - 交互式 peer_list:前端 toolview 渲染成可点击卡片(排序/搜索/弹窗发送/刷新)
- 会话上下文:每个 peer 显示首句(会话主题),一眼看懂在做什么
演示
Claude 会话间通信

截图
交互式 peer_list:列出活跃 peer,支持排序/搜索/刷新

点击 peer 弹窗直接发送消息

两个会话轮流报数(连通性测试)

两个会话玩成语接龙

架构
┌──────────────┐ ┌───────────────────────────────┐
│ Claude Code │ │ dsh (单 peer: dsh-<pid>) │
│ │ │ ┌─ 会话 A (短id: abc12345) │
│ ListAgents │ │ └─ 会话 B (短id: def67890) │
│ SendMessage │◀────────▶│ 收到回复 → 按标识转发到对应会话 │
└──────────────┘ └───────────────────────────────┘
安装
# 从 GitHub
dsh plugin --profile web add "github:czm15053/dsh-peer-link"
# 或从本地仓库
dsh plugin --profile web add link:<repo路径>
dsh --profile web
工具
| 工具 | 作用 |
|---|---|
peer_send |
向 peer 发消息。target 传入站消息编号 / peer 名 / socket 路径 |
peer_list |
列出活跃 peer。可选 cwd 按目录筛选 |
配置
dsh 侧(插件配置)
- insert:
- id: peer-link
name: '@deepseek-ai/dsh-peer-link'
config:
targetSessionId: active # 'active'=最近活跃 / 具体sessionId / 'all'
name: my-dsh # 注册名,默认 dsh-<pid>
injectInbound: true # 收消息注入会话
registerTool: true # 注册 peer_send/peer_list
Claude Code 侧(官方跨 session 配置)
Claude Code 2.1.224+ 原生支持跨 session 消息。需在 ~/.claude/settings.json 里配置:
-
升级:
claude update升级到 2.1.224+ -
启用开关:在
env块加"CLAUDE_CODE_HARBOR_KITE": "1"(绕过 feature flag) -
免审批(推荐):加
"crossSessionInbound": "accept"(不加则消息先 hold 等待确认)
{
"env": {
"CLAUDE_CODE_HARBOR_KITE": "1"
},
"crossSessionInbound": "accept"
}
配置后,每个 Claude 会话会在 /tmp/cc-socks/ 生成一个 socket 文件(0600 权限)。
与 dsh 会话通信
-
发现:Claude Code 里用
ListAgents列出所有 peer 会话(含dsh-<pid>) -
回复 dsh:用
SendMessage发给to: "dsh-<pid> [ref]",消息开头带上会话标识@dsh-<pid>:<session短id>,dsh 会转发到对应会话 -
收 dsh 消息:dsh 发来的消息会作为用户消息出现在 Claude 会话(带
📨 [peer]标记)
构建与测试
cd dsh-peer-link
npm install
npm run build # tsc → lib/ + tsdown → lib/client.js
npm test # vitest
目录结构
dsh-peer-link/
├── src/
│ ├── index.ts # host 插件:注册单 peer + 会话转发 + 工具
│ ├── protocol.ts # socket 消息协议(NDJSON 解析/构造)
│ ├── peer-registry.ts # peer 注册表(注册 + 发现 + 存活探测)
│ └── client/ # 前端半区
│ ├── index.ts # toolview slot 注册 + onSend/onRefresh
│ └── PeerListTool.tsx # 交互式 peer_list toolview
└── LICENSE # MIT
通信礼仪
- 收到 peer 消息时,注入格式附带提示:寒暄/确认类消息无需回复,有实际协作需求再回复
- 多 dsh 会话并发向同一 peer 发消息时,醒目的会话标识让 Claude 能区分各会话
友链
- LinuxDo — 一个开放、分享的社区
License
Frequently Asked QuestionsFAQ
Use the verified command dsh plugin --profile default add github:czm15053/dsh-peer-link in a DSH-enabled shell. The command resolves the public package metadata and keeps the plugin attached to the catalog identity shown on this page.
Compatibility follows the bundle and profile status shown above. If a profile is not detected, keep the plugin disabled there and check the repository documentation before enabling it in production.
The GitHub link and activity metadata are the source of truth for releases and maintenance. Revisit this page after a new release to confirm the catalog has observed the latest version.