<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jack random</title>
    <description>The latest articles on DEV Community by jack random (@jack-random).</description>
    <link>https://dev.to/jack-random</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4073265%2Fb0975f12-4387-4cf6-b760-52e0368e6b7a.png</url>
      <title>DEV Community: jack random</title>
      <link>https://dev.to/jack-random</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jack-random"/>
    <language>en</language>
    <item>
      <title>Bringing Claude Code–Style Cross-Session Messaging to OpenCode</title>
      <dc:creator>jack random</dc:creator>
      <pubDate>Tue, 11 Aug 2026 11:01:59 +0000</pubDate>
      <link>https://dev.to/jack-random/bringing-claude-code-style-cross-session-messaging-to-opencode-2mb3</link>
      <guid>https://dev.to/jack-random/bringing-claude-code-style-cross-session-messaging-to-opencode-2mb3</guid>
      <description>&lt;p&gt;Running multiple coding agents in parallel is useful—until those agents need to coordinate.&lt;/p&gt;

&lt;p&gt;One session may be reviewing a repository while another is implementing a change in a different terminal or worktree. Without a communication layer, the usual solution is manual: copy a conclusion from one window, paste it into another, and repeat whenever context changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jkrandom-sudo/opencode-plugin-peers" rel="noopener noreferrer"&gt;&lt;code&gt;opencode-plugin-peers&lt;/code&gt;&lt;/a&gt; brings &lt;strong&gt;Claude Code–style cross-session messaging&lt;/strong&gt; to OpenCode. It is modeled after Claude Code's cross-session messaging workflow, allowing independent OpenCode sessions on the same machine to discover and send plain-text messages to one another.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow it recreates
&lt;/h2&gt;

&lt;p&gt;The goal is simple: treat each OpenCode session as an independent peer while still giving sessions a reliable way to coordinate.&lt;/p&gt;

&lt;p&gt;With the plugin installed, sessions can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;discover available peers with &lt;code&gt;list_agents&lt;/code&gt; or &lt;code&gt;/peers&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;send a message with &lt;code&gt;send_message&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;address root sessions and child sessions independently&lt;/li&gt;
&lt;li&gt;receive messages even while the target session is busy&lt;/li&gt;
&lt;li&gt;retain queues, delivery outcomes, and sender outboxes across restarts&lt;/li&gt;
&lt;li&gt;control inbound behavior with &lt;code&gt;accept&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt;, &lt;code&gt;hold&lt;/code&gt;, or &lt;code&gt;refuse&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes multi-terminal, multi-repository, and multi-worktree workflows feel much closer to a coordinated group of coding agents instead of isolated windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why cross-session messaging matters
&lt;/h2&gt;

&lt;p&gt;Imagine three OpenCode sessions running at the same time:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One session investigates a failing test.&lt;/li&gt;
&lt;li&gt;A second session updates the implementation in another worktree.&lt;/li&gt;
&lt;li&gt;A third session reviews documentation and compatibility concerns.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The investigation session can send its findings directly to the implementation session. If the implementation session is busy, the message is still delivered through the plugin's local messaging layer. Durable queues and outboxes help preserve delivery state across restarts, so coordination is not tied to a single uninterrupted process.&lt;/p&gt;

&lt;p&gt;The important distinction is that the sessions remain independent. The plugin does not merge their conversation history or share hidden context. It provides a focused communication channel: plain-text messages between known local peers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local by design
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;opencode-plugin-peers&lt;/code&gt; keeps transport on the local machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unix-domain sockets on macOS and Linux&lt;/li&gt;
&lt;li&gt;loopback TCP on Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not provide remote messaging, file transfer, or shared conversation history. Those boundaries keep the plugin focused and make its behavior easier to reason about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opencode plugin &lt;span class="nt"&gt;-g&lt;/span&gt; opencode-plugin-peers

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The current npm release is &lt;strong&gt;0.2.2&lt;/strong&gt; and requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenCode 1.18.0 or later&lt;/li&gt;
&lt;li&gt;Node.js 18 or later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After installation, use &lt;code&gt;/peers&lt;/code&gt; to inspect discoverable sessions, or let an OpenCode agent use &lt;code&gt;list_agents&lt;/code&gt; and &lt;code&gt;send_message&lt;/code&gt; as part of its workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inbound controls and security
&lt;/h2&gt;

&lt;p&gt;Messages from peers should be treated as untrusted input. Processes running as the same operating-system user share the local trust boundary, so a message should not automatically be treated as a trusted instruction.&lt;/p&gt;

&lt;p&gt;For sensitive projects, consider conservative settings such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;peerPermissions: "ask"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;inboundPolicy: "hold"&lt;/code&gt; or &lt;code&gt;"refuse"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These controls let you decide whether inbound messages are accepted automatically, held for review, or refused. The repository README documents the full behavior and security model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/jkrandom-sudo/opencode-plugin-peers" rel="noopener noreferrer"&gt;jkrandom-sudo/opencode-plugin-peers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/opencode-plugin-peers" rel="noopener noreferrer"&gt;opencode-plugin-peers&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback is especially welcome for multi-worktree coordination, busy-session delivery, restart recovery, permission UX, and Windows behavior.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: This article was prepared with AI assistance and reviewed before publication.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>opencode</category>
      <category>claudecode</category>
      <category>developertools</category>
    </item>
  </channel>
</rss>
