<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged samp</title>
<link>https://coderlegion.com/tag/samp</link>
<description>Powered by Question2Answer</description>
<item>
<title>How I got my AI agents to communicate across repos — and shipped SAMP doing it</title>
<link>https://coderlegion.com/16043/how-i-got-my-ai-agents-to-communicate-across-repos-and-shipped-samp-doing-it</link>
<description>&lt;p&gt;&lt;strong&gt;Situation.&lt;/strong&gt; I was working on &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/lumen-argus/lumen-argus&quot;&gt;&lt;strong&gt;lumen-argus&lt;/strong&gt;&lt;/a&gt;, a project that runs across three Claude Code sessions in three different repos. They needed to share context — &quot;I just refactored the auth module,&quot; &quot;the schema migration landed, pull main.&quot; For weeks I was copy-pasting between terminal windows like a caveman.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Task.&lt;/strong&gt; I wanted cross-session, cross-repo messaging for AI agents. Cheap. Fast. Local. Ideally something I could read with &lt;code&gt;cat&lt;/code&gt; if anything went wrong.&lt;/p&gt;
&lt;p&gt;Three constraints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Token cost per message had to be near zero.&lt;/li&gt;
&lt;li&gt;No new servers, no daemons, no MCP handshake.&lt;/li&gt;
&lt;li&gt;It had to work for &lt;em&gt;any&lt;/em&gt; agent — Claude Code today, Cursor or my next project tomorrow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Action.&lt;/strong&gt; I surveyed the existing options. &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/Dicklesworthstone/mcp_agent_mail&quot;&gt;&lt;code&gt;mcp_agent_mail&lt;/code&gt;&lt;/a&gt;, Agent Teams, broker daemons — all of them spin up an HTTP server, register identities, run a SQLite store, and burn tokens on polling hooks. Overkill for three agents swapping a dozen messages a day.&lt;/p&gt;
&lt;p&gt;So I borrowed Linus Torvalds' playbook from &lt;code&gt;git&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Per-writer append-only logs.&lt;/strong&gt; One file per agent: &lt;code&gt;log-&amp;lt;alias&amp;gt;.jsonl&lt;/code&gt;. No file ever has two writers, so there's no locking, no interleave, and Syncthing / Dropbox / iCloud can't cause merge conflicts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content-addressed IDs.&lt;/strong&gt; &lt;code&gt;id = sha256({ts, from, to, thread, body})[:16]&lt;/code&gt;. Same content → same id, so dedup after sync is automatic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;mtime&lt;/code&gt; short-circuit.&lt;/strong&gt; Before parsing anything, stat the log files; if nothing changed, exit immediately.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I packaged it as &lt;strong&gt;SAMP&lt;/strong&gt; (Simple Agent Message Protocol) — a vendor-neutral spec — and shipped a reference implementation, &lt;strong&gt;agent-message&lt;/strong&gt;: three Claude Code slash commands (&lt;code&gt;/message-send&lt;/code&gt;, &lt;code&gt;/message-inbox&lt;/code&gt;, &lt;code&gt;/message-reply&lt;/code&gt;), a &lt;code&gt;msg&lt;/code&gt; shell helper for humans, and a tiny Python wrapper any other agent CLI can spawn.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Result.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;1 Bash tool call per send/receive&lt;/strong&gt; from Claude Code. No MCP init, no ack roundtrip.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;0 LLM tokens&lt;/strong&gt; when humans (or &lt;code&gt;cron&lt;/code&gt;, or scripts) read/send via the shell helper. The model is never in the loop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;~30 ms latency&lt;/strong&gt; — that's &lt;code&gt;python3&lt;/code&gt; startup. Everything else is a file append.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Works offline. Syncs across machines via Syncthing / Dropbox / iCloud&lt;/strong&gt; with zero conflicts by construction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One install script.&lt;/strong&gt; No pip, no npm, no Docker.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Docs: &lt;a rel=&quot;nofollow&quot; href=&quot;https://slima4.github.io/agent-message/&quot;&gt;https://slima4.github.io/agent-message/&lt;/a&gt;&lt;br&gt;
Repo: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/slima4/agent-message&quot;&gt;https://github.com/slima4/agent-message&lt;/a&gt;&lt;br&gt;
Spec: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/slima4/agent-message/blob/main/SPEC.md&quot;&gt;https://github.com/slima4/agent-message/blob/main/SPEC.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you're juggling multiple agent sessions and copy-pasting between them, give it a try. PRs and issues welcome.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/16043/how-i-got-my-ai-agents-to-communicate-across-repos-and-shipped-samp-doing-it</guid>
<pubDate>Tue, 28 Apr 2026 05:29:41 +0000</pubDate>
</item>
</channel>
</rss>