Repository navigation
Releases
v0.8.0
Added
- A relay now runs as a service of the same two levels as the Broker.
peers service install --relaywrites the relay configuration file and its users and keys file and registers the relay service, andstart,stop,restart,removeandstatustake--relay;--admin-groupwith--relayis a usage error. The relay listens on:17444unlessrelay.listensays otherwise and starts only whenrelay.tls_cert_fileandrelay.tls_key_filename a certificate and its key; without them the install registers the definition, leaves it disabled and says so.peers service run --relayruns the relay in the foreground, every key of its configuration file applies while it runs exceptrelay.listen, which applies at the next start, and a key it does not know makes the file invalid.peers updaterestarts a running relay service and rolls it back with the Broker, andpeers uninstallremoves the relay service, with--purgealso removing its configuration file, users and keys file and data directory. peers relay user add,list,disable,enableandremove, andpeers relay key issue,listandrevoke, manage the relay users and API keys in the users and keys file of the caller's level. They edit the file and talk to no process, the running relay picks a change up, andkey issueprints the new API key once, alone on its line; this is the only relay output that contains a key.- A Broker's configuration file now carries
relays.<name>.address,.api_key,.fingerprintand.register(true by default), andlink.direct_probe_interval(default5m,0turns it off). At most four entries may be set to register, the API key can be set only by editing the file, and the template carries a commented example entry. A Broker advertises its relay addresses after its direct addresses, and a card holding more than four relay items is invalid. - A Broker registers at the relays whose entry is set to register and keeps one of four states for each:
registered,registering,registration failedorregistration off, with the latest failure's reason as its detail.peers service status --relayshows the running relay's version, listen address, certificate, users, registrations and relayed connections, and whether a newer release is available. - Pairing and linking now go through a relay when the two hosts cannot reach each other directly.
connect_brokerandpeers broker connectaccept a relay address writtenrelay://<host:port>/<rendezvous id>, andpeers key createshows a relay address when the Broker holds a relay registration even if it does not listen. A relayed link's traffic stays encrypted end to end between the two Brokers. The dialer of a relayed link tries the peer's direct addresses everylink.direct_probe_intervaland returns the link to a direct connection when one succeeds, recordinglink_downwith detailmoved_to_directand thenlink_up; a failed probe changes nothing. - A pairing through a relay that fails at the relay returns the error code
relay_failedwith a reason:relay unreachable,relay certificate could not be verified,relay rejected the API key,no API key for the relay named in the address,target not registered at the relay, an endpoint that is not the Broker the address names,relay refused: this relay user exceeded a limitorrelay cannot join the connection at this time. When the Broker has stopped using a relay, the pairing fails without contacting it and says whether the key was rejected or the registration superseded, and what resumes it. list_brokersaddslink_path,relay_addressandrelays:link_pathisdirectorrelayedfor an established link,relay_addressis the relay'shost:portfor a relayed link, andrelayslists every configured relay with itsname,address,stateanddetail, never its API key.- The website has guides for running a relay and for pairing through a relay, and its security page has a Relays section that states what a relay can and cannot see.
Changed
peers broker listgains aPATHcolumn betweenLINKandADDRESSES, namingdirect,relay <host:port>or-, andpeers service statuswrites a Relays table after the Agents table, orRelays: none, a breaking change: output parsed by position changes, so read columns by their header name or shift every column afterLINKby one, and read the Agents table only up to the empty line that follows it.connect_brokernow waits up to 50 seconds instead of 30, the longer limit covering a pairing that goes through a relay.peers relay key issuenow returns only after the running relay of the same level has adopted the key. The relay records the digest of the users and keys file it adopted in its status record, and the command waits up to 10 seconds for that digest to match the file it wrote. On success it prints a fourth line naming the relay and its process id, saying whether the key is in effect now or takes effect when a disabled user is enabled, or that no relay is running and the key takes effect when one starts. When the adoption is not confirmed within the bound, the command is interrupted, or the status record cannot be read, it still prints the three lines with the key and exits 1, saying why the adoption was not confirmed. This removes the window in which a Broker that set the key before the relay had read the file was refusedKEY_REJECTEDand stopped using the relay until its configuration changed or it restarted.make lintnow runsscripts/check-test-privilege, which fails on a test, harness helper, compose file, Dockerfile or CI step that changes network configuration, captures packets, or uses root or sudo for behaviour no requirement says runs as root. The end-to-end containers drop their network capabilities andNET_RAW, and the e2e image no longer installsiptablesortcpdump.
Removed
- The
test-rootmake target, itsROOT_TEST_*variables and the Linux CI step that ran it under sudo. The two broker helper tests it ran now run as root inside the plain system end-to-end container, and the macOS test job no longer runs a root test round either.CLAUDE.md's description ofcover-checkno longer mentions the target's coverage data.
Fixed
- The version checker now records its timer under a generation number, so a check that schedules the next one while starting cannot leave a newer timer untracked, and shutting down stops every pending check. The old window was not reachable at production intervals; the fix keeps the shutdown guarantee at any interval.
- A topic or card revoked while a request for the same identifier was in flight could stay listed on a Broker two hops away until the next full reconciliation, longer than the replacement interval the design promises. A newer record announced during an in-flight request is now requested again when that request ends.
- An agent that renamed itself could have its new name sent to clients while the topic table still served the old one, because the rename event was queued before the table was updated. The table now updates before the event is sent.
- A default topic whose join was still pending when the agent's registration completion arrived could be lost until the agent reconnected. The completion and the attach now join from the same pending list, and a topic stays pending until a join succeeds or the Broker drops it.
- A pending default-topic join could undo a leave the user had just issued, or repeat a join a completion had already made, by adding the topic back after the pending check. The check and the join are now one ordered step under the adapter's topic-operation lock, and a leave removes the topic from the pending defaults before it reaches the adapter.
- A registration completion's restoring round could join a default topic that the completion's own auto-join had just joined, producing a duplicate join. The round now restores exactly the topics remembered when the completion arrived.
- A default join could rejoin a topic the user had joined or left through the tools, undoing the leave or replacing the public declaration and description the user had given. The MCP server now remembers every topic the user settled and keeps the default paths away from it for the life of the process.
- An established link could be observed with no connected address recorded for a moment, because the dial round recorded the address after the link was published. The dial round and the pair dial now record the address before the link is published; the direct probe added in 0.8.0 does the same.
v0.7.0
Added
peers chatcreates, resumes, renames, deletes and lists chat sessions, each of which runs as one agent and keeps its messages in a record under the account's data directory. A session can run interactively on a terminal or in line mode, which reads and writes one JSON object per line.peers chat deleteis the way to remove a chat session and its record.- The local interface carries a
RegisterAgentstream, so a program other than a Claude Code session can register agents and receive their messages, and an adapter runtime keeps those registrations, restores their topic membership, reconnects after a closed stream and dispatches deliveries within their time limits. The MCP adapter uses this path, andpeers chatis the first command-line client built on it. - A Broker now checks the expected identity inside the TLS handshake when it redials a paired peer and when it dials to pair: when it holds a card for the address, it checks the fingerprints of the cards it holds before sending any pairing material, and it presents its certificate only to a host that presents the expected fingerprint. A paired peer's fingerprint is always known, while a pair dial with no held card checks no identity. A host that fails the check receives neither the certificate nor any pairing frame.
- The commands that change a Broker's state name the Broker's level,
userorsystem, in the line they print, andpeers service onlineandpeers service offlinealso say whether the state changed or was already in that state. broker.max_agents_per_accountis a new configuration key, an integer from 1 to 16384 that defaults to 256. It caps the number of agents one account may hold on a Broker at one time; a registration that would create a further agent fails and states the limit, while a registration that joins an agent the account already holds does not count.list_agentsgives every agent aunique_addressand gives the calling session its ownself_unique_address, each writtenname [ref]@<fingerprint prefix>. A message names its sender by the sender field, the display address followed by#and the sending Broker's 12-digit fingerprint prefix, for examplenv@hashdata#6e604bee53a1.peers uninstallnow asks a non-root account whether to remove its chat sessions and their message records together with the rest of its data, and removes them with the data directory.--purgewithout--yesasks a separate confirmation before reading or removing anything for a non-root account's data, while root is not asked separately, and an account with no user-level installation can remove its own data withpeers uninstall --purgebefore anysudostep.
Changed
- Every
peerscommand loses the--systemand--useroptions,peers service runincluded, a breaking change: a command acts on the level of the account that runs it, so run it withsudoto act on the system level and without it to act on your own user level. A script or a command line that passes either option now fails with a usage error, and the exit code 7 thatpeers service runused for a level mismatch no longer exists. A service definition written by 0.6.3 starts the Broker with a level option and fails to start with this release, so when upgrading from 0.6.x run the install script again, withsudofor a system installation, instead of runningpeers updateorupdate_broker: the script installs this release and rewrites the definitions, while a system-level update run by 0.6.x calls the new binary's post-update step with a level option it rejects and rolls back. Replacing the binary by hand does not.peers service status, thepeers servicestart, stop, restart, online and offline commands,peers uninstalland the commands that change the Broker's state name the level, and--admin-groupis a usage error when the command does not run as root. peers mcpnow requires--agent-type claude-code, a breaking change: without the option, or with any other value, it prints an error naming the supported values and exits with code 2. Every registration written before this release lacks the option, so every one of them fails after the upgrade, and the install script leaves such a registration unchanged even on a rerun. Nothing else rewrites it either:peers updateleaves every account's registration alone, andpeers mcpdoes not repair one. Remove the registration withclaude mcp remove -s user peerand rerun the install script, or add--agent-type claude-codeto it by hand, then reconnect the server with/mcpin each open session. On a system installation, every other account that registered the server against the system Broker must do the same for its own registration.peers service statusnow describes this Broker only, a breaking change: its header names the level, version, alias, fingerprint and advertised addresses, followed by the degraded and offline lines, the agents table and the update hint, and it no longer has a Peers table.peers broker listnow lists the other Brokers withLINKandDETAILcolumns and no state line, lists peers first, reads no local state, and in a diagnostics-only degraded run writes nothing and points atpeers service status. With no running Broker,peers service statusnow writes the state of the installed Broker services on standard output and exits with code 1 instead of printingNo Broker Available; with no service installed, it gives the install command, and a socket this account may not connect to is reported as that denial rather than as a stopped service. A script that parsed either output must be updated.- An advertised address list with more than 8 direct items is now refused as a whole instead of being truncated, a breaking change: no item of it is used, the previous list stays, and the pairing or link it arrived on is unaffected. The refusal appears in the peer's status detail, in
peers broker list'sDETAILcolumn and in the audit log, and a Broker card with more than 8 direct items is treated as invalid and is neither stored, forwarded nor listed. connect_brokerno longer returns awarningsfield andpeers broker connectwrites nowarning:lines, a breaking change: a pairing that contradicts a held card for an address that identifies one host now fails before any pairing material is sent, naming the publishers of the cards held for that address. Pair through an address no held card lists, wait until the cards expire, or hold the target Broker's own card instead.- The sender field and the two addresses replace local aliases, a breaking change:
connect_brokerno longer takeslocal_alias,peers broker connectno longer takes--alias, and theneeds_local_aliaserror is gone. A pairing never asks for a local alias.- Every Broker shows another Broker under that Broker's own alias. Aliases are no longer unique, and
broker.aliasmay equal a peer's alias. Local aliases kept in apeers.jsonwritten by 0.6.x stay there but are not used. - A message's sender ends in
#and 12 hexadecimal digits of the sending Broker's fingerprint, andlist_agentsaddsunique_addressandself_unique_address. Copy the sender, or a listed unique address, verbatim when replying. - A display address
name@aliasthat resolved before can now fail asambiguousonce two Brokers report one alias; the error lists the unique addresses to choose from. An address whose part after@is one Broker's alias and another's fingerprint prefix also fails asambiguous. disconnect_brokerandpeers broker disconnectrefuse an alias that several peers report, and accept a fingerprint prefix of 8 or more digits.- Downgrading to 0.6.x is not clean: 0.6.x refuses a
peers.jsonwhen two peers have the same alias, or when a peer's alias equals an alias it used before and 0.6.x recorded as retired, so unpair those peers before downgrading. A downgrade also needs the MCP server registered again, because 0.6.x does not accept--agent-type: remove the registration withclaude mcp remove -s user peerand rerun the older release's install script, or register the server by hand. Brokers of 0.6.x keep interoperating with this version, because the link protocol does not change.
- The
update_brokerMCP tool and the Broker's update path are removed, a breaking change: no tool starts an update any more, and a system-level installation is updated only by root withsudo peers updatein a terminal.peers updatenow performs the lookup, download, verification and replacement in its own process, rewrites the level's service definitions, restarts the services that were running, waits up to 60 seconds for each to report the new version and exits with code 3 when a restarted Broker runs degraded. It refuses a caller other than root whose running binary is the one the system-level service definition starts, and refuses an update that this session cannot restart before downloading anything. A failed update restores the previous definitions and binary; updating no longer writes an audit record, and theupdate_appliedandupdate_failedevents remain readable in existing logs. list_agentsnow has a 10-second tool time limit, the same as the other tools that answer from memory or from one small file, instead of a 20-second limit of its own.peers service runno longer exits with code 6 when it starts inside a Claude Code session: a Broker may now start inside a session's process tree, and exit code 6 is unassigned.- A host made entirely of numeric parts, each all decimal digits or starting with
0x, that is not a canonical IPv4 or IPv6 address is now refused as an invalid address before dialing, because the system resolver may read it as another address. - The MCP server's instructions now state only where content from other agents comes from and what a successful send confirms, a change to text sessions read: they no longer call that content "not th...
v0.6.3
Fixed
- A system installation now writes the shell completions and man pages whatever the owner and the group or other write permission of their directories and of the directories above them, so on a Mac whose
/usr/local/shareis writable by theadmingroup it no longer skips every completion and man page. A directory on their path that is a symbolic link still makes the installation skip that kind of file, and a symbolic link at a file's place is replaced rather than followed. A skipped or unwritten kind of file now produces one warning, one for each shell's completion and one for all man pages, instead of one per file, and the man-page warning says to copy the pages from theman/directory of the release archive instead of naming a file in the installer's temporary directory, which the online installer deletes when it exits.
v0.6.2
Changed
- The MCP server's instructions now direct the model to start a conversation with an agent whose session appears in Claude Code's built-in session list through the built-in session tools, even when that agent is registered with peers.
send_messagestarts the conversation when the user names the agent by its agent address, asks to send with peers, or names an agent whose session is not in that list. A reply to a message whose sender is an agent address still goes throughsend_message, to that address verbatim.
Fixed
- A system installation no longer checks the owner or write permission of the binary or of its directories: it accepts a binary directory, or a directory above it, that an ordinary account owns or that group or others can write, and
peers service install --systemaccepts a binary owned by another account or writable by group or others, which the system service then runs as root. So the default system installation succeeds on a Mac whose/usr/local/binbelongs to an ordinary account. The install script creates a missing binary directory as root with mode 0755 instead of failing, and still installs the binary owned by root with mode 0755;peers service install --systemstill refuses a binary inside the temporary directory. When the installer fails undersudo, the script now says to fix the error above, and says thatsudodid not run the installer only when it did not, instead of reporting thatsudois not usable. - Running
install.shagain without--prefixon a host where peers was installed with--prefixnow installs the binary into the directory the installed service runs it from, for the system and the user installation on Linux and macOS. It used to install into the default directory,/usr/local/binor~/.local/bin, so the service switched to the new copy while the Claude Code MCP registration still named the old binary, which stayed behind. When the service definition cannot be read, names a directory that no longer exists or, for a user installation, names a binary another account owns, the script prints a warning naming the definition file and uses the default directory.
v0.6.1
Fixed
- The Broker now closes both ends of an account helper's standard-input pipe when it cannot create the helper's standard-output pipe, and every end of both pipes when the helper fails to start. Such a failed start used to leave the input pipe open until the garbage collector ran, holding two descriptors on exactly the path that file-descriptor exhaustion makes fail, so the shortage outlasted the failure.
- A session registry or configuration directory whose watch cannot be installed no longer leaves a session unaware of changes there. A directory that failed to watch at startup was skipped by every later reconciliation, so the watcher stayed on the configuration directory and a session that appeared or changed in the registry went unreported until an unrelated event scanned it; every event now retries that directory. A reconciliation that meets several unwatchable directories in a row now falls back level by level to the deepest directory it can watch within one pass instead of alternating between them, which at startup could fail with
there is no directory to watch. The callback with process id 0 is sent once per distinct set of failing directories and their errors rather than once per event, is sent again when that set changes, and a fallback found while starting up now reaches the callbacks in the initial notification. - On macOS, a session could stop seeing registry changes after the watch moved to the registry directory: re-registering a kqueue watch for a directory used the flags read earlier, and a concurrent watch of the same path could replace
NOTE_WRITEwith a smaller set, so changes inside the directory produced no further events. A re-registration now keeps the flags already recorded and adds its own, a user watch and an internal watch of the same path are serialized so the kernel filter and the recorded flags agree, and a userAddthat loses every retry to a concurrentRemovereturns an error naming the path instead of reporting success for a path that receives no events.
v0.6.0
Added
create_pairing_keyandpeers key createappend a paste-ready connect prompt that already names this Broker's addresses and the one-time pairing key: one sentence to paste into a session on the other host, and the equivalentpeers broker connectcommand. It lists every shown address and says to choose one the other host can reach, while the command uses the first address and offers the rest as replacements. The tool returns the same text asconnect_prompt, and leaves the field out when no address can be shown.
Changed
- Upgrade every paired host to this version. The link protocol is now 2, so a Broker of this version can neither establish a link nor pair with a v0.5.0 or earlier Broker. When only one side of a paired link is upgraded, the link between the two breaks until the other side is upgraded too: the versions are incompatible, so each attempt is refused and retried with a backoff. Once both hosts run this version, no re-pairing is needed and the link recovers on its own.
- The descriptions of
send.request_timeoutandlink.dial_timeoutnow say that a call made from a Claude Code session is also bounded by the fixed limit of the tool that makes it, 30 seconds forsend_messageandconnect_broker, so any part of either value above that limit does not apply to session calls. They also say thatpeers broker connecthas no limit of its own and useslink.dial_timeoutin full. list_brokersandpeers service statusnow explain a peer whose link was closed because it sent more state frames than this Broker's inbound limit allows on one connection, instead of leaving the status detail empty. The detail says the peer ran past the state-frame limit, that the link reconnects after a backoff, and to check the audit log'slink_downrecord. Other link failures that had no explanation keep none.pairing.max_attempts_per_minutenow limits the unmatched pairing requests from each source per minute rather than from all sources together, a breaking change: one IPv4 address or one IPv6 /64 may make that many, and all sources together may make ten times that. Existing configurations keep their value; each source now gets its own allowance under the shared global ceiling.- The link protocol version is now 2, a breaking change: a Broker of this version cannot establish a link or pair with a v0.5.0 or earlier Broker, and a link attempt is reported as version-incompatible; for a link, the accepting side names the peer's version, while the dialing side only reports the incompatibility. The digest fields of
TopicDigests,RosterandRosterDeltachanged meaning because each digest now binds the sender's fingerprint; see the Security entry below. - On a system Broker, an agent whose name belongs to another account now shows a full 12-character disambiguator instead of the shortest distinguishing prefix, a breaking change: a client that compares the disambiguator with the one Claude Code shows for the same session, or that expects the shortest prefix, sees a different value. A by-name address reaches only the agent of the account that owns the name, so the later account's same-named agent is reached only by its full address. Member entries gained the publisher's account and a ref-required flag, so every peer must run this version, matching link protocol version 2.
list_agentsgained anaccountfield for display. - The configuration file no longer accepts YAML anchors and aliases, a breaking change: an existing file that uses anchors fails to load until they are removed. Mappings or sequences nested deeper than 32 levels are now parse errors, and a file larger than 1 MiB is refused before it is parsed.
broker.advertiseandbroker.advertise_extranow check each host as an IP address or a domain name this system can dial, a breaking change: a configuration that loaded before may fail to load until the host is corrected, for example one with a space or a slash, an IPv6 address without brackets, a wildcard address, or a domain label over 63 bytes. A fully qualified name may keep one trailing dot.- A Broker now decides whether it runs inside a Claude Code session from the parent process chain as well as from its own environment: an ancestor that carries the session's inbox-socket variable, or whose process id has a record in this account's session registry, also counts. So running
peers service runby hand from a session's terminal after clearing the variable is refused with exit code 6 instead of starting a second Broker beside the session's. A Broker the service manager starts is unaffected, because its parent chain holds no session process. An ancestor whose environment cannot be read is skipped and the walk continues, and a chain that cannot be followed or runs past 256 levels stops the walk and counts as outside a session.
Fixed
- A peer's stored local alias is now held to the alias rules when
peers.jsonis loaded: a value that is not a valid alias rejects the file asErrStorethrough the same record error an invalid retired alias uses, instead of loading. Every write path already validated the value, so only a hand-edited file reaches this check; it is defense in depth. - A session now classifies a failed attempt to reach its Broker by what the socket probe found, instead of treating every non-missing socket as a running Broker. Only a system Broker socket answered by root, with a failed handshake or registration stream, is reported as running but not answering, with the original error, the same Broker retried in the background, and a request to the administrator if it persists. A socket served by another account reports the same peer mismatch as selection, naming the path and the answering uid, for user and system targets alike, instead of claiming the Broker is running. A system socket this account may not connect to, or that failed the probe another way, is reported as
cannot reach the system Broker at <path>: <error>with the background retry, without claiming the Broker is running; only a socket that is missing or refuses connections still reports that the system Broker is unavailable. A user Broker that cannot be connected to now reports that it is unavailable once instead of repeating the phrase with its socket path. - A system Broker socket that refuses connections during selection and is then answered by another account during the up-to-ten-second retry now reports the peer mismatch, naming the socket and the answering uid, instead of running out the retry and saying the system Broker is unavailable for the administrator to start. A session with no user Broker whose system socket is answered by another account from the first probe reports the same mismatch and enters
PhaseUnavailableinstead ofPhaseNoBroker. A peer mismatch reported during selection also drops the extrathe Broker is unavailable: …wrapper, so one condition reads the same whichever phase met it; when the system socket is the one taken, the status is followed by the text that explains how to start a Broker, which the reconnect phase does not add. - A session now tells the model why a running local Broker refused it instead of reporting that no Broker is available. A registration stream the Broker ended with an error code passes the Broker's sentence and code through, so an account at its registration limit sees
quota_exceededwith the Broker's explanation rather thanthe system Broker is unavailable; ask the administrator to start it. A socket that answered but closed the handshake is reported as a running Broker that refused the connection and may be at the account's or the host's local connection limit, and only a missing or refusing socket keeps the wording about starting a Broker. - A system Broker's permission check that cannot take a slot within its budget is now refused with
quota_exceededandToo many configuration access checks are running; try again shortly.instead ofinternal, so a caller knows to retry rather than treating the Broker as broken. list_topicsnow returns a tool error when the Broker does not answer within the topic RPC timeout, the same ten-second boundjoin_topicandleave_topicapply, instead of leaving the call open until the connection or the process ends. A session polling the topic list could otherwise wait without bound on a Broker that stopped responding.get_config,set_config,set_broker_online,list_brokers,disconnect_broker,create_pairing_key,list_agents,connect_broker,send_messageandupdate_brokernow return a tool error when the Broker does not answer within a fixed bound, instead of leaving the call open until Claude Code's own timeout. The bounds are ten seconds for the tools that answer from a local file or from memory, twenty forlist_agents, thirty forconnect_brokerandsend_message, and four minutes forupdate_broker. They do not followsend.request_timeoutorlink.dial_timeout, so raising either past its bound makes the tool reportDelivery unknownor aNot connectedresult before the Broker finishes; that is expected. Anupdate_brokertimeout says the upgrade was either abandoned, leaving the running version unchanged (a replacement that had started is rolled back), or completed, leaving the Broker restarting with the new version, and how to check.- A session that remembered more topics than the Broker's topic rate limit allows in one burst no longer loses the rest when it re-registers. After a Broker restart the account's sessions restore their topics at once, and a join past the rate limit was refused with
quota_exceededand dropped from memory, so the topic could not be restored again unless the user rejoined it. A quota refusal no longer holds up the topics behind it: the refused topic is deferred and the pass continues, so a topic stuck at the account's count limit cannot keep the topics that fit from being restored. The deferred topics are retried as ...
v0.5.0
Changed
-
The command line has been rebuilt on cobra with a noun-and-verb command tree, a breaking change; the old command names have been removed with no aliases. The commands map as follows:
v0.4.0 v0.5.0 peers brokerpeers service runpeers statuspeers service statuspeers auditpeers service auditpeers offlineandpeers onlinepeers service offlineandpeers service onlinepeers config getwith no keypeers config listpeers pairing-key createpeers key createpeers peer list,peers peer connectandpeers peer disconnectpeers broker list,peers broker connectandpeers broker disconnectpeers service uninstallpeers service removeHelp groups the commands as Pairing, Local Broker and Installation. A usage error, including an unknown command, an unknown option and the wrong number of arguments, exits with code 2. Updating a v0.4.0 installation to v0.5.0 rewrites the service definition in the new command's format before the Broker restarts, so users do not need to reinstall it.
-
Every
servicesubcommand accepts the mutually exclusive--systemand--userflags. With neither, root acts on the system service and every other account on its user service, which is the rule the install script uses;service install --admin-grouprequires--system.service start,stopandrestartnow accept--systeminstead of rejecting it, and every command that selects a level honors it and names the level when the service is unavailable. -
peers updateandpeers uninstallask for confirmation only when standard input is a terminal, and fail with a message telling the user to pass--yeswhen it is not.--yesskips the questions and keeps the data;--purgeremoves the data without asking about the data, and still needs--yeswhen standard input is not a terminal. A non-root account whose host has only the system installation is shown the completesudo peers uninstall [--purge] --yescommand when it cannot be prompted, and at a terminal it is still asked whether to rerun the command through sudo. -
The install script reports how the installed version relates to the binary it replaced, before the service summary:
Upgraded from <version>.,Downgraded from <version>.,Reinstalled peers <version>.orReplaced peers <version>.. DecliningUpgrade the system installation? [Y/n]leaves the system installation unchanged, exits 0 and no longer suggests a user install. -
Tool errors from the MCP server end with
(code: <name>; reported by Broker <fingerprint>)when the Broker reported them; an error without a reporting Broker keeps(code: <name>).
Added
- Shell completion for bash, zsh, fish and powershell:
peers completion <shell>prints a script, and the commands complete Broker aliases and fingerprints, configuration keys and shell names dynamically. The install script installs the bash and fish completions, and the zsh completion in a system install; a system install writes them under/usr/local/share, and a user install writes the bash and fish completions under$HOMEand prints how to enable the zsh completion manually. The fish completion is installed only when fish is present. If a completion cannot be written, the script prints a warning and continues, andpeers uninstallremoves the completions the install script wrote. - Man pages. Every release archive contains them under
man/, a system install copies them into/usr/local/share/man/man1, andpeers uninstallremoves thepeers.1andpeers-*.1pages it wrote.
Fixed
- On macOS, the account-helper for an account in more than 16 groups failed to start, because Darwin caps
setgroupsat 16 groups, and every session of that account sawnot_registered. The helper now starts as root and switches to the account's identity in the child withsetgid,initgroupsandsetuid, as the access check already does, and the session registry watch recovers with it. A helper that fails to start or stops responding now reports its own reason,the Broker's helper for this account failed to start or stopped responding; ask the administrator to check the Broker log, instead of the message that no Claude Code session record matches the session's inbox socket.
v0.4.0
Changed
- The project is renamed to
peers, a breaking change. The binary, the release archives and the entry inside them, the Go module path, the installation paths, the configuration, data, log and runtime directories, the service unit names, the launchd label, the administration group, the project configuration file name, the environment variables and the pairing protocol labels all use the new name. See ADR-rename-peers. The MCP server namepeerand the tool names are unchanged. peers is incompatible with agent-peer 0.3.0, and no migration is provided. - When the user asks to send a message to every agent or to broadcast and does not mention peers, the session sends it to this host's sessions through Claude Code's built-in session messaging and then gives one short hint that peers can notify agents on other hosts. The session sends to every agent that
list_agentsreturns, once per agent, only when the user explicitly asks for a peers broadcast, and a session without the built-in tool reports that a local broadcast is unavailable instead of sending through peers. - After a self-update, the installed binary rewrites the service definition in the new version's format before the Broker restarts, so an update still leaves a working service when the service unit format changes between releases. If the rewrite fails or times out, the update restores the previous binary and the service definition and leaves the Broker running.
v0.3.0
Added
--userfor the install script: it installs the binary and the user-level service for the account that runs the script without asking for the installation level.--systemand--userboth skip the question; the script refuses--userwhen it runs as root.agent-peer uninstallremoves the service, the binary, the runtime directory and the account's MCP registration, and asks once before also removing the configuration, identity, audit and service logs;--purgeskips the question. Root removes the system-level installation, and another account with only that installation is asked once before the command re-runs itself through sudo. When the data is removed at the system level, the administration group is removed too, but only when the installation recorded creating it, or when an older installation's configuration file uses the defaultagent-peergroup; the binary is removed only when it is the running executable.join_topicandleave_topicaccept an omittednameand then act on the session's default topics: the topics named by the project configuration file, or the one named by the workspace's git origin. These calls ignore the automatic-joining switches, so a session whose Broker or project file turns automatic joining off can still join its default topics on request. A session with no default topic gets aninvalid_argumenterror that says to pass a name. Leaving the default topics only affects the current session; a new session joins them again when automatic joining is on.- An
--allow-degradedoption foragent-peer broker. A Broker started with it does not exit when, after taking the account lock, the data directory or audit log is unusable or thebroker.listenbind fails: the first keeps the process running with a diagnostics-only local interface, the second keeps every local call except creating a pairing key, and both retry and recover without a restart. Other startup failures still exit. Service definitions written byagent-peer service installpass the option. agent-peer service start,stopandrestartstart, stop and restart the Broker service for the account that runs the command: root acts on the system-level service, any other account on its user-level service. A level without an installed service fails and names that level; an account that only has the system-level installation is told to run the command withsudo.startandrestartwait for the local socket and exit with code 3 when the Broker runs degraded, printing the failure and the fix.agent-peer statusandagent-peer peer listprint the Broker's state before the sections. A degraded Broker shows its level, the reason and the repair command; an offline Broker says that messages from other hosts are refused and gives the command that accepts them. A Broker that serves diagnostics only prints just the degraded lines, andagent-peer statusexits with code 1 without repeating the reason on standard error.- The
list_brokersresult carries alocalobject with the connected Broker'sofflinestate and, while it runs degraded, its level, reason and repair command. An older Broker leaveslocalout, which reads as online and not degraded. - Session tool errors carry fixed text for
broker_degradedandbroker_offline. A degraded Broker's reason says the call cannot run until the startup failure is fixed; an offline peer Broker says the message was not sent, resending will not deliver it, and the other user can be reached another way. - Broker offline mode. The
broker.offlinesetting, theagent-peer offlineandagent-peer onlinecommands, and theset_broker_onlinetool switch a running Broker between accepting and refusing messages from other hosts. While offline, a delivery from another host is refused withbroker_offlineand nothing is written to a session; links, topic exchange, local deliveries and messages this Broker sends continue. The state is kept in the configuration file, survives a restart, and a configuration-file edit applies without one.
Changed
- The install script now chooses the installation level when neither
--systemnor--useris given. It asksInstall system-wide (all accounts)? [y/N]on the controlling terminal, orUpgrade the system-wide installation? [Y/n]when a system-level service is already installed; answering no to the upgrade leaves the host unchanged and exits 0 with a hint to pass--userfor a user-level install. Root installs system-wide without asking, an account without a controlling terminal gets a user-level install, and a system-level choice from a non-root account reruns the script through sudo. Passing both flags is a usage error, and a host without sudo fails with a message that says to install sudo or use--user. - A Broker that refuses a
broker.listenport below 1024 now fails at the listen step and exits with code 4 (listen address unavailable) instead of 5 (invalid configuration), a breaking change for scripts that match the old exit code. - Without
--allow-degraded, a startup failure caused by the data directory or the audit log now readsthe configuration is invalid: config: data directory or audit log unavailable: ..., which names the failure class between the existing prefix and the file error. The failure class, exit code and behavior are unchanged. agent-peer service installnow prints a summary after a successful or degraded installation: the install level and when the service starts, the binary, configuration file, run log and audit log paths, and the start, stop, restart and uninstall commands. When the installed service answers but its Broker is degraded, the command keeps the service installed and running, prints the reason and the repair command on standard error, and exits with code 3; other installation failures still exit 1.
Fixed
- Runtime log records no longer carry the
eventkey twice. A caller-supplied event name replaces the message, which moves to themessagefield, and audit failures name their kind underaudit_eventinstead of a secondevent. - Runtime log event values that were free text now use their snake-case names, so a value can be matched:
accountdb: account database lookup failed; falling back to os/user→accountdb_lookup_fallback,access check for an account outside the account database; denying→access_check_unknown_account,access check process reported an error→access_check_failed,account helper exited→account_helper_exited,account helper stderr→account_helper_stderr. The config package logsconfig_audit_before_load,config_audit_unknown_kind,config_audit_encode_failed,config_audit_not_openandconfig_audit_closedin place of itsconfig: ...messages, and keeps the audit event kind inaudit_event. - A system-level Broker no longer logs an account helper's exit as an error while the Broker is stopping. Such exits and their
context canceledstderr lines are recorded below the warning levels and are not respawned. agent-peer service installchecks thebroker.listenaddress before it starts the service. An address already in use fails the installation with the address, the configuration file and thebroker.listenkey to change. When the address is held by this service's own running Broker, identified by the service manager's main pid and the local socket peer pid, the installation stops it and waits up to 20 seconds for the address, so a reinstall is not mistaken for a conflict; a foreign occupant fails the installation with the running service untouched. A failed installation never leaves a service that starts at boot or login: Linux disables the unit, and macOS removes the plist a fresh installation wrote or, when the plist existed before the installation, keeps it and disables the launchd label. The configuration file stays. If the service holding the address cannot be stopped, the installation still disables it and the error says it will not start automatically and gives the command that restores it. If the installation stopped an existing service before it failed, the error saysthe existing service was stoppedand gives the command that restores it; on macOS that command loads the pre-existing plist the installation kept. The readiness timeout carries the laststartup_failedreason from the service log, considering only records written after the installation began.- A readiness timeout in
agent-peer service installno longer reports only the silent socket when the service log has nostartup_failedrecord from this installation. The error now includes the state and last exit status the service manager reports:systemctl show -p ActiveState -p SubState -p ExecMainStatus agent-peer.service, orlaunchctl print <domain>/<label>'sstateandlast exit code, and it says so when the query itself fails. - On macOS, installing the service while it is running no longer fails with
Bootstrap failed: 5: Input/output error. The installation boots the old job out once before the bootstrap, waits untillaunchctl printreports it gone andbroker.listenis released, then bootstraps the new plist, retrying a bootstrap that still returns exit 5; the unload wait and the address wait share one 20-second budget, and the exit-5 retries have a separate 10-second budget. A failed replacement removes the plist a fresh installation wrote, or keeps a pre-existing plist and disables its label, so nothing starts at the next login; if the label cannot be disabled, the error says the service may start automatically. When the old service is gone, the error states that no Broker is running and gives the enable-then-bootstrap command that recovers it. - A failed configuration write during
agent-peer service installnow names the configuration file it targeted.
v0.2.0
Added
- Terminal commands for every Broker management operation:
agent-peer config getandagent-peer config setread and change configuration,agent-peer pairing-key createcreates a one-time pairing key, andagent-peer peer list,agent-peer peer connectandagent-peer peer disconnectlist, pair with and unpair Brokers. Each command is authorized against the account that runs it, as the corresponding agent-facing tool is, and writes the same audit entries. - Broker self-update, the
update_brokertool and theagent-peer updateterminal command. A Broker that runs under a service manager can be asked to install the latest official release: it downloads and verifies the release, replaces its own binary, replies, and exits so that the service manager starts the new version. Theupdate_brokertool lets a session start this upgrade; Claude Code asks for confirmation before the call runs, unless the tool has been allowed in advance. Theagent-peer updateterminal command asks the selected Broker to update itself, and the Broker authorizes the request against the caller's write permission on its configuration file; the command replaces the binary locally only for a user-level Broker that does not run under a service manager, or when no Broker is running, after checking write permission on the binary's directory. - A system-level admin group. Installing a system-level Broker creates the
agent-peergroup, which--admin-group <name>renames, and gives a newly generated configuration file root ownership, the group as its group, and mode0660. Members of the group manage the Broker withoutsudowhen their account runs no user-level Broker; an account that also runs one usessudoto reach the system-level Broker. The install script asks whether to add the installing account to the group and defaults to no;--join-admin-groupadds it without asking. An existing installation keeps its configuration file unchanged: rerun the install script, orsudo agent-peer service install --system, to create the group, then run thechgrpandchmod 0660commands it prints. Skip that step whenbroker.listenuses a port below 1024, because such a Broker refuses to start while another account can write the file. - An install script in every release archive. It installs the binary, installs and starts the Broker as a service, and registers the MCP server with Claude Code, for the account that runs it or, with
--system, for the account that invokedsudo. Running it again is safe and does not register the MCP server twice. - One-command online installation:
curl -fsSL https://github.com/wangzw/agent-peer/releases/latest/download/install.sh | shdownloads the latest release for the platform, verifies it againstchecksums.txt, and runs the archive's install script.--version <version>installs a published version, and a system-level installation runs the same command withsudoand--system.
Changed
- Installing a user-level or system-level service now generates a configuration file that lists every configuration item when no file exists: items with defaults are written with their values, items without a fixed default are shown commented out with an example, and each item has a one-line description. An existing file is left unchanged.
set_confignow replaces a commented-out placeholder for the key in place with the new value, instead of adding a second, active line elsewhere in the section.- A Broker with no alias configured now derives its default alias from the hostname and the account that runs it: a system-level Broker uses the first segment of the hostname, such as
buildbox, and a user-level Broker uses that segment followed by the account name, such asbuildbox.alice. The default no longer depends on the listen port. A Broker upgraded from v0.1.0 without an explicitbroker.aliastherefore gets a new alias, and its agents get new addresses. To keep the old alias, read it before upgrading, from theget_configtool forbroker.aliasor from the part after@in the agent addresses thatagent-peer statusprints, and setbroker.aliasto it after upgrading. With the default port it is the full hostname followed by-17443, shortened to 24 characters, for examplebuildbox-17443. - Brokers now check GitHub for a newer official release shortly after start and every 24 hours by default;
update.checkturns the check off andupdate.check_intervalchanges the interval. When a newer release exists,agent-peer statusprints its version, and a tool result in each session ends with a one-line notice, once per session and version. The Broker never installs a release on its own; an update always starts fromagent-peer updateor theupdate_brokertool. - A system-level Broker applies a
broker.listenport below 1024 only when the configuration file is writable by root alone: a non-root caller cannot set such a port through the tools or a terminal command, a reload keeps the old value and writes aconfig_rejectedaudit entry, and the Broker refuses to start when another account can write the file.
Removed
- The
AGENT_PEER_SOCKETenvironment variable, a breaking change. A session and a terminal command now select their Broker by operating-system account alone: the user-level Broker running for the calling account if there is one, otherwise the system-level Broker if the account may use its socket. An account that also runs a user-level Broker reaches the system-level Broker withsudo. Setting the variable no longer affects the selection.
Fixed
- Release bodies are now generated from the changelog. goreleaser did not load the extracted notes, so v0.1.0 was published with an empty body, and the body was added by hand afterwards.
- The README install steps now branch before moving the binary, so following the user-level and system-level paths in order no longer fails at the second step; the extraction step now uses an empty directory because the archive has no top-level directory.
- Writing the configuration file now refuses to follow a symbolic link: a symlink at the configuration path makes the write fail and leaves its target unchanged.