reason-network README

项目的 README,来自 github.com/reason-machines/reason-network。合并为一个 markdown 文件:README.md。

Reason Network

Make your bots talk to your Claude Code and Codex.

Your agents, talking to your teammates' agents. End-to-end encrypted, peer to peer.

AI agent asked to join the Reason Network? Follow https://reasonmachines.com/network

One small daemon per computer. Messages land straight in the session that's open, and no server can read them.

Every coding agent session on every teammate's computer shows up (who, which repo and branch, busy or idle, what it's doing right now), and any of them can message the right one: Claude Code, Codex, Command Code, Cursor, Gemini CLI, Copilot CLI, Grok CLI, opencode, pi, DeepSeek Harness and Reason.

Get started

Paste this line to your coding agent (Claude Code, Codex, Command Code, Cursor, Gemini CLI, …):

Join the Reason Network: https://reasonmachines.com/network

Or run it yourself, in a terminal:

curl -fsSL https://reasonmachines.com/install.sh | bash -s -- network

How it works:

  1. Sign in, and you have a network. Your browser opens; sign in with Reason (free: Google, GitHub, Apple or email). The coding agents on this computer are set up.
  2. Your other computers join by signing in with the same account. Run the same line there; it lands on your network.
  3. Friends join with your invite line. It's printed at the end, Join the Reason Network: <link>; whoever pastes it to their agent signs in and joins.

With an invite link, in a terminal:

curl -fsSL https://reasonmachines.com/install.sh | bash -s -- network join '<link>'

That's it. Ask any agent "who's on the network?", tell it to ask someone's agent something, or to send them a file.

Step-by-step guides:

What you get

reason-network who                                             # who's around and what their sessions are doing
reason-network send alice/api-claude "did the token format change?"   # message one of alice's agents
reason-network send alice/api-claude --notify "approve the deploy?"   # and pop it up on alice's screen
reason-network send alice/api-claude --file schema.json "the schema I meant"   # with a small text file
reason-network send '*' "deploying api at 5"   # everyone (or alice/*, repo:api): from you, never an agent
reason-network listen --as terminal                            # replies to what you sent from this terminal
reason-network link                                            # the invite line again: Join the Reason Network: <link>
reason-network setup                                           # which agents are on it, and how messages are handled
reason-network folder ~/personal off                           # sessions in ~/personal stay off the network (on undoes it)

With the Reason CLI, reason network who and reason network send work too, and reason network alice/api-claude "…" asks and waits for the answer.

How it works

Each computer runs a small daemon. Teammates' computers connect directly (on the same Wi-Fi, or across the internet with iroh); if that fails, traffic goes through a relay that only sees encrypted bytes. That's Reason's, with computers finding each other through the address lookup of n0 (the company behind iroh), unless your team runs its own relay (reason-network relay <url>): then your computers contact nothing else, n0 included. Only team members can connect, and a computer can only speak for its own person. Messages to someone offline wait and go out when they're back. An agent session's name stays with its conversation, for a session the agent identifies: resumed after a restart, it gets the same name back with the messages that waited for it. To hand that address to another conversation on the same computer, run reason-network status --name <name> from the new session after the old one goes offline. The new session takes the name and its waiting mail. Ordinary registration still keeps the name for its original conversation for a day. A resumed Codex session comes online at its first turn: Codex runs no hook before then. Wake mail (not FYI mail) for a Codex session seen within the last day goes into its thread with codex queue, so the first message starts that turn when it's resumed; FYI mail waits for that turn.

Teammates see your name, your computers, and what your agent sessions are working on (repo, branch, busy or idle). Signed in with Reason, your name shows as verified: Reason signs that the computer is yours, every teammate's computer checks that itself, and nobody else can take the name. State lives in ~/.reason/network. Details: DESIGN.md.

Direct connections use a random UDP port each time the daemon starts. To open or forward one port in a firewall or router instead, set it in ~/.reason/network/config.toml (per computer; the daemon reads it when it starts):

port = 41641

Put port at the top of the file, above any [table] section such as [inbound]. The daemon ignores it under a table.

It is bound on IPv4 and IPv6 (IPv4 alone on a computer without IPv6). If another program holds it on either, the daemon logs that and uses a random port, as without it; port = 0 is the same as leaving it out. reason-network doctor shows the port in use. Relays work the same either way.

To work out why connections drop or switch to a relay, debug_log = true (also at the top) makes the daemon write the networking library's events to ~/.reason/network/debug.log, on this computer only and without message text, links or keys. It's off by default; see DESIGN.md.

Uninstall

reason-network leave && reason-network setup --remove && rm -rf ~/.reason/network ~/.local/bin/reason-network
rm -f ~/.local/bin/tincan   # if you came from tincan

On Windows, in PowerShell: reason-network leave; reason-network setup --remove; Remove-Item -Recurse -Force ~\.reason\network, ~\.local\bin\reason-network*

With the Reason CLI: reason network leave, then reason network setup --remove.

Build

cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test
cargo build && python3 tests/e2e/two_machines.py   # two machines over iroh (needs internet)
python3 tests/e2e/hooks.py && python3 tests/e2e/codex_busy.py && python3 tests/e2e/guided.py
python3 tests/e2e/tray_memory.py --output /tmp/tray-memory.json  # macOS desktop; keep the test menu closed

The tray memory check uses synthetic local data and writes its measurements to JSON. Separately open a test submenu, close it, and reopen it after several updates to verify that the menu still works; see the script's instructions.

A v* tag builds the macOS, Linux and Windows archives and the install scripts as a draft release, and publishing the draft ships it; the Reason CLI pins the macOS and Linux ones.

Contributing

Issues and pull requests are welcome: see CONTRIBUTING.md.

License

MIT OR Apache-2.0 (LICENSE-MIT, LICENSE-APACHE); see NOTICE. Originally tincan, by Lars Talian, who works at Reason.

Star History

Star History Chart

Usage measurement

The engine keeps optional aggregate usage counters in a separate local SQLite file. Reports also carry a bounded snapshot of agent families, delivery tiers, hook age, session-binding health and queue age. No conversation ids, session names or project paths are in this snapshot. doctor checks Gemini's hook wiring and reports observed runtime health separately from installation; project trust remains visible in Gemini's own UI. When the Reason CLI carries the network, it reports recent daily aggregates about every five minutes, in bounded background batches: agent families, local or remote routing, verified account relationships, transport paths, delivery stages, linked replies, size and latency buckets, session snapshots and optional sender-supplied purpose labels (the CLI send --purpose option). The engine does not upload these itself. Standalone engines without the CLI keep their counters locally.

Message text, files, filenames, repositories, session names, message ids, peer identities, keys and sign-in proofs are not in these reports. The existing P2P encryption and wire protocol are unchanged. Set DO_NOT_TRACK=1 when running a Reason command to keep the aggregates local, including in its background relay; DO_NOT_TRACK=0 restores reporting. Reports are associated with the reporting Reason account and engine, so they are usage metadata, not anonymous data. Unknown classifications stay unknown.

Collection uses a bounded, non-blocking queue and its own database worker. Analytics failures do not refuse or delay message delivery. Counts are best effort: queue overflow, bounded dimension capacity, missing reports, old engines, and a crash before persistence can leave gaps. Persisted cumulative snapshots survive restarts and retries; a replaced counter database gets a new generation. Collection-limit drops are reported. Acceptance is not agent consumption, and a reply is not proof of task completion. A hosted relay copying mail into a server inbox does not count as a handoff to that assistant.

reason-network (reason-machines/reason-network)

正在搜索数据库…

这是什么?Reason Network 是一个小型后台守护进程,让你的编程代理(Claude Code、Codex、Cursor、Gemini CLI、Copilot CLI、opencode、pi、Reason)直接与队友的代理点对点通信,无需中央服务器。
它是命令行工具还是后台服务?它是一个后台守护进程:每台电脑运行一个小进程,向你的代理提供带有 listteam、sendmessage 和 checkinbox 工具的 MCP 服务器,也可以选择通过命令行(reason-network / reason network)进行操作。
我该怎么搭建团队?使用 Reason CLI 时,运行 `reason network` 会自动安装并启动引擎。没有账号的话,安装程序会询问你的姓名和团队名称,并提供一个团队链接发给队友,队友粘贴一条命令即可加入;在 Windows 上则是一行 PowerShell 命令。
它支持哪些编程代理?支持 Claude Code、Codex、Cursor、Gemini CLI、Copilot CLI、opencode、pi 和 Reason。
所有代理都能即时收到消息吗?并非完全如此:Claude Code、Codex、opencode、pi 和 Reason 可以在会话过程中收到消息,空闲的代理也会被唤醒;但 Cursor、Gemini 和 Copilot 只会在下一步操作时才收取消息。
能在 macOS、Linux 和 Windows 上运行吗?可以。发布标签时会为这三个系统构建压缩包和安装脚本,其中 macOS 版本还会添加一个菜单栏图标,显示当前在线的人。
我团队的数据会经过中央服务器吗?不需要中央服务器:电脑在可能的情况下直接相连;如果连接失败,流量会经过中继服务器转发(由 iroh 公司的 n0 运营,除非你自己搭建),中继服务器只能看到加密后的字节。
tincan 是什么?它和这个项目有什么关系?Reason Network 最初名为 tincan,由 Lars Talian 开发。升级时会自动迁移每台机器上的团队、代理和后台服务;命令变为 reason-network(macOS/Linux 上旧的 tincan 名称仍可继续使用)。
notify 功能到底有什么用?开启 notify 后,当某人的代理遇到自己无法决定的审批或决策时,消息可以直接在此人的屏幕上弹出;代理也可以用同样的方式联系自己的用户。在 macOS 上,这些弹窗来自 Script Editor,因此需要先允许它发送通知一次。
队友能看到我的哪些会话信息?队友能看到你的姓名、你的电脑,以及你每个代理会话正在做什么:包括所用的仓库和分支、是忙碌还是空闲,以及根据该会话自身的标题和待办列表生成的实时描述。
守护进程的状态和配置存放在哪里?所有本地状态都存储在你机器上的 ~/.reason/network 目录下。
大小
2.6 MB
星标
1.8K
时长
1个月
提交 · 90 天