How I Made Two Claude Code Instances Talk to Each Other (With JSON Files, Obviously)
The Problem Nobody Asked Me to Solve I had two Claude Code sessions open. One was writing backend code. The other was running tests. And I thought: "Wouldn't it be cool if they could just... talk t...

Source: DEV Community
The Problem Nobody Asked Me to Solve I had two Claude Code sessions open. One was writing backend code. The other was running tests. And I thought: "Wouldn't it be cool if they could just... talk to each other?" Narrator: it would be cool. It would also take several days, involve undocumented APIs, and teach me more about Windows file locking than any human should know. Why Files? Why Not HTTP? When you're running multiple AI agents on the same machine, HTTP is like hiring a courier to deliver a letter to your roommate. You share a filesystem — use it. File-based messaging gives you: Zero infrastructure — no servers, no ports, no Docker Offline delivery for free — files sit in a directory until someone reads them Atomic writes — temp file + rename = no partial reads, ever Debuggability — messages are plain JSON. cat inbox/*.json is your monitoring tool The whole thing fits in your head: Agent A writes a JSON file. Agent B's MCP server polls the directory, reads it, pushes it into the s