DEV Community

yukihiro amadatsu
yukihiro amadatsu

Posted on

πŸ“» I Made Claude Code Instances Talk to Each Other in Real Time

What if your AI coding assistants could collaborate β€” not through files or git, but by actually talking to each other?

I built Walkie-Talkie, a real-time messaging system that lets multiple Claude Code instances communicate with each other. And now it's available as a plugin you can install in seconds.

πŸ’‘ Why Would You Want This?

Think of it as Slack for Claude Code instances. Each terminal is a participant in a group chat. Anyone can lead, anyone can follow.

  • Agents collaborating on code β€” you don't pre-assign roles. Just like messaging a coworker on Slack, you'd say "hey, can you review this?" in the conversation. Roles emerge naturally. And there's no limit on the number of participants.
  • Hands-off or hands-on β€” your choice. Let agents work things out among themselves, or jump in anytime from the dashboard to steer the conversation, give new instructions, or correct course. You're not locked into either mode β€” you can switch between observer and director mid-conversation.
  • Play a TRPG β€” yes, seriously. Claude Code instances can play Call of Cthulhu with each other. One runs the scenario, the others roleplay.
  • Trigger Claude Code from anywhere, anytime. The Hub is just an HTTP server. That means a cron job, a CI pipeline, or any script can send a message to a connected agent β€” and the agent will execute it. Until now, scheduling Claude Code tasks (like nightly code reviews or periodic cleanups) required the API. With Walkie-Talkie, you can do it with a single curl command, no API key needed, while the agent maintains its full context window.

The possibilities are endless. Each terminal maintains its own context window, so conversations can go deep. And because this runs entirely through Claude Code's built-in infrastructure β€” no separate API calls β€” it works within your existing Pro or Max plan. No extra cost.

This isn't hypothetical. It works today.

πŸ”§ How It Works

Claude Code A ──stdio──> MCP Server ──HTTP──> Hub ──HTTP──> MCP Server ──stdio──> Claude Code B
                                               β”‚
                                          Dashboard
                                        (ON-AIR screen)
Enter fullscreen mode Exit fullscreen mode

The system has three parts:

  1. Hub β€” A central server that routes messages between agents
  2. MCP Server β€” Connects each Claude Code instance to the Hub
  3. Dashboard β€” A browser-based control panel where you can watch conversations, send instructions, and manage agents

Each Claude Code instance joins with a name (like a callsign), then enters an autonomous conversation loop β€” listening for messages, responding, and listening again. Just like a real walkie-talkie.

πŸŽ₯ See It In Action

Two Agents Chatting

The agents don't just reply once β€” they keep the conversation going autonomously. No human intervention needed. They listen, they talk back, they keep listening.

The Dashboard

The ON-AIR dashboard gives you a bird's-eye view of everything happening. You can:

  • Watch all messages in real time
  • Send instructions to any agent as the operator
  • Kick individual agents or stop everyone

When you send an instruction as operator, the agent actually executes it β€” runs commands, reads files, writes code β€” then reports back.

Operator Mode: Distributing Tasks

Tell one agent to write FizzBuzz in Ruby, then ask another to review it. They'll discuss, refactor, and improve the code β€” just like real teammates on Slack. You kicked it off, but they take it from there.

πŸš€ Getting Started

Walkie-Talkie is a Claude Code plugin. No manual MCP configuration needed.

# 1. Clone and build the Hub
git clone https://github.com/suruseas/walkie-talkie.git
cd walkie-talkie
npm install
npm run build

# 2. Set the Join token (add this to your ~/.zshrc)
export WALKIE_TALKIE_JOIN_TOKEN=your-secret-value-here
source ~/.zshrc

# 3. Start the Hub
npm start
Enter fullscreen mode Exit fullscreen mode
# 4. In Claude Code, install the plugin
/plugin marketplace add suruseas/walkie-talkie
/plugin install walkie-talkie@suruseas
Enter fullscreen mode Exit fullscreen mode

Restart Claude Code, then:

/walkie-talkie alice
Enter fullscreen mode Exit fullscreen mode

Open another Claude Code session, join as a different name, and they'll start chatting. See the README for full setup details.

To stop agents, click "Stop All" on the ON-AIR dashboard, or press Escape (Ctrl+C) in the individual terminal.

🧠 The Technical Bits

Autonomous Conversation Loop

The magic is in the SKILL.md file that drives agent behavior. It instructs Claude Code to:

  1. Join the hub
  2. Wait for messages (long poll)
  3. Reply immediately
  4. Go back to waiting
  5. Never ask the user what to do β€” just keep the loop going

This creates truly autonomous agents that maintain conversations without human intervention.

There's another crucial behavior in the SKILL.md: when an agent receives a message from operator, it treats it as a task and executes it using Claude Code's full toolset β€” Bash, file read/write, everything. This is what makes the dashboard so powerful, but also what makes this system dangerous β€” it can run commands on your computer. Any message from the operator is treated as an instruction to execute, not just a chat message.

Long Polling for Real-Time Feel

Instead of WebSockets, I used HTTP long polling. The MCP server holds a connection open for up to an hour, waiting for messages. This gives a real-time feel while staying compatible with Claude Code's MCP stdio transport.

⚠️ Important Safety Warning

I need to be very clear about this: Walkie-Talkie is powerful, and power demands caution.

NEVER expose the Hub server to the internet. The Hub should only run on localhost. If you make it accessible from outside your machine, anyone who discovers it could connect agents to your Hub and potentially execute commands on your system.

This is not a theoretical risk. The SKILL.md explicitly instructs agents to execute operator messages as tasks using Claude Code's full toolset β€” Bash commands, file operations, anything. If a malicious actor gains access to your Hub, they can run arbitrary commands on every connected agent's machine. This is by design for local use, but catastrophic if exposed.

You are fully responsible for how you use this tool. I built this as an experiment and share it as-is. I cannot and do not take responsibility for any damage, data loss, or security incidents that may result from using Walkie-Talkie. By using it, you accept this risk.

Some ground rules:

  • Run the Hub on localhost only β€” never bind it to 0.0.0.0 or expose it through a reverse proxy
  • Keep your Join token secret β€” anyone with the token can connect agents to your Hub
  • Don't leave agents running unattended β€” autonomous agents with tool access can do unexpected things
  • Review the code yourself β€” this is open source for a reason. Understand what you're running.

With that said β€” if you use it responsibly on your local machine, it's an incredibly fun and useful tool.

🎯 Try It

The project is open source: github.com/suruseas/walkie-talkie

Install the plugin and let your Claude Code instances start talking. I'd love to hear what workflows you come up with.


Have questions or ideas? Reach out on GitHub or DEV β€” but I'm running a full marathon on March 1st (JST), so responses may be slow around that time. If I go silent for too long... something may have happened out there on the course. πŸƒ

Top comments (0)