Back to list
AI エージェントをレポジトリ間での通信に導き、SAMP を実装する方法:スリムなファイルベースのメッセージプロトコル', 6.67
How I got my AI agents to communicate across repos — and shipped SAMP doing it
Translated: 2026/4/25 6:30:17 翻訳信頼度: 73.2%
Japanese Translation
状況。私は 3 つの異なるレポジトリで 3 つの Claude Code セッションを動かしている「lumen-argus」プロジェクトに取り組んでいました。それらは文脈の共有が必要でした—
Original Content
Situation. I was working on lumen-argus, a project that runs across three Claude Code sessions in three different repos. They needed to share context — "I just refactored the auth module," "the schema migration landed, pull main." For weeks I was copy-pasting between terminal windows like a caveman. Task. I wanted cross-session, cross-repo messaging for AI agents. Cheap. Fast. Local. Ideally something I could read with cat if anything went wrong. Three constraints: Token cost per message had to be near zero. No new servers, no daemons, no MCP handshake. It had to work for any agent — Claude Code today, Cursor or my next project tomorrow. Action. I surveyed the existing options. mcp_agent_mail, 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. So I borrowed Linus Torvalds' playbook from git: Per-writer append-only logs. One file per agent: log-.jsonl. No file ever has two writers, so there's no locking, no interleave, and Syncthing / Dropbox / iCloud can't cause merge conflicts. Content-addressed IDs. id = sha256({ts, from, to, thread, body})[:16]. Same content → same id, so dedup after sync is automatic. mtime short-circuit. Before parsing anything, stat the log files; if nothing changed, exit immediately. I packaged it as SAMP (Simple Agent Message Protocol) — a vendor-neutral spec — and shipped a reference implementation, agent-message: three Claude Code slash commands (/message-send, /message-inbox, /message-reply), a msg shell helper for humans, and a tiny Python wrapper any other agent CLI can spawn. Result. 1 Bash tool call per send/receive from Claude Code. No MCP init, no ack roundtrip. 0 LLM tokens when humans (or cron, or scripts) read/send via the shell helper. The model is never in the loop. ~30 ms latency — that's python3 startup. Everything else is a file append. Works offline. Syncs across machines via Syncthing / Dropbox / iCloud with zero conflicts by construction. One install script. No pip, no npm, no Docker. Docs: https://slima4.github.io/agent-message/ https://github.com/slima4/agent-message https://github.com/slima4/agent-message/blob/main/SPEC.md If you're juggling multiple agent sessions and copy-pasting between them, give it a try. PRs and issues welcome. Tags: ai, claudecode, anthropic, aiagents, SAMP