Two Claude Code sessions can’t see each other. Separate context windows, separate working directories, separate memory. That’s fine until the work in one depends on the work in the other, and you end up hand-carrying messages between two terminal windows.
I was building a real-time collaboration tool between two separately hosted WordPress sites, each talking to the other over an authenticated server-to-server connection. I ran one Claude Code session per site to build both ends at once. The two ends had to line up exactly, so the sessions couldn’t work blind. I gave them a shared file to coordinate through.
The trick
The channel is a markdown file in /tmp. One agent writes requests, the other appends answers, the first agent watches the file for changes. No server, no queue, no API between them. Both agents already have file tools, so there’s nothing to set up.
I wrapped it in a slash command, /collab. Run it in the first session with a task and it creates the file:
/tmp/collab-1719096000.md
It seeds the file with the task, some context, and a numbered list of requests for the other agent. Then it gives me a short message to paste into the second session: read the file, append your answers under ## Answers, don’t edit anything above that line, add a ## Questions section if you need to ask back.
Answers are appended, never edited, each one numbered and timestamped:
### Answer 1 (2026-06-22T14:02Z)
Plugin X is active. Version 2.1.0. Matches mine.
Nothing gets overwritten, so the file becomes the full log of the exchange.
Here’s the loop running:
Why it works
The first agent runs a watch loop: check the file’s modified time every five seconds, and when it changes, read the new content and show me what the other agent added. I see both halves of the conversation in one window.
Append-only is the load-bearing rule. Neither agent rewrites history, so there’s no race to overwrite a section. They just keep adding to the bottom, and I stay in the loop because every message passes through a file I can read.
The limits are the obvious ones. /tmp doesn’t survive a reboot, there’s no real locking, and the handoff is manual: I paste the file path into the second session myself. For two sessions on one machine in one sitting, none of that has gotten in the way.
It’s one command file. Here’s the whole thing: collab.md. No code, just a markdown template, a join message, and the watch-loop instructions. Save it to ~/.claude/commands/collab.md, run /collab with a task, and paste the join message into your second session.








