Skip to main content
Glama

neighbors

让同一 neighbors 作用域内的多个 Claude Code 会话互相发消息(广播 + 点对点),并在会话进行中自主投递。

安装

/plugin marketplace add <本仓库 URL 或本地路径>
/plugin install neighbors@neighbors-marketplace

零配置:MCP 服务器已打包为自包含单文件 mcp/neighbors-server.bundle.mjs(内联 SDK/zod/lib),运行时无需 npm install、无需 node_modules;钩子脚本本就零依赖。

贡献者:改动 mcp/neighbors-server.mjsscripts/lib/* 后需 npm install && npm run build 重新生成 bundle 并提交(bundle 是随插件分发的运行时产物,需与源码同步)。

Related MCP server: Claude Relay

用法

  • 每会话启动自动获别名(如 amber-fox)。

  • neighbors_list 看在线邻居及任务;neighbors_send 发消息(to="broadcast" 或别名);neighbors_status 更新你在做什么。

  • 收到的消息会在工作过程中自动注入;有未读时会话不会停下,直至对话平静。

手动命令与协作 skill(P1)

  • /neighbors:neighbors <自然语言> —— 手动查看/发消息/更新状态/读历史(如 /neighbors:neighbors send jade-owl 帮我看下 auth)。

  • neighbors-coordination skill —— 多会话协作时自动加载,引导主动报状态、查重、协调;独立任务不触发。

作用域与发现

  • 作用域:在 git 仓库内,从 git 根向当前目录找到的第一个 .claude 即锚点(同 repo 子目录/worktree 共享);非 git 仓库用项目目录。两个会话"互为邻居"当且仅当解析出的 neighbors 目录相同。

  • 在线发现:读取 ~/.claude/sessions/<pid>.json 进程注册表(pid 验活)。该文件为 Claude Code 内部、未文档化、随版本可能变化;本插件不追求强跨版本兼容,平台升级后若发现失效请更新插件。消息收发本身只依赖 .claude/neighbors/ 文件,不受影响。

存储模型

<锚>/.claude/neighbors/:广播 broadcast/<id>.json;私信 maildir inbox/<别名>/{new,cur};另有 status/.self/.cursors/。建议加入 .gitignore

会话启动时惰性 GC(best-effort):广播按"所有活跃会话都已读"的水位线清理(绝不删未读);已读私信 cur/ 按 7 天保留期清理。私信未读(new/)永不被清。

重要约束

  • .claude/neighbors/~/.claude/sessions/ 须位于 Linux 原生文件系统(WSL 勿放 /mnt/c)。

  • 自主续跑无人为上限:两个被指令驱使的会话可能持续互回(ping-pong)。可随时按 Esc 中断。

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/puxu-msft/agent-neighbors'

If you have feedback or need assistance with the MCP directory API, please join our Discord server