AI Shqipe
valon-hajredini.aishqipe.com/posts/claude-code-sessions-talking-to-each-other
Valon Hajredini
Subscribe

When Claude Code Sessions Start Talking to Each Other

Every terminal used to be an island. Now one session can discover the others — local, cloud, or another machine entirely — and just send a message.

If you work like most Claude Code users, you rarely have just one session open. There is a terminal in the frontend repo, another in the API, maybe a cloud session chewing through a long refactor while you do something else. Until recently, each of those was an island: the only way to move information between them was you, copy-pasting context from one pane into another. That has changed. Sessions can now find each other — and talk.

One address book for everything that runs

The discovery half is a tool called ListAgents. Ask a session who else is around, and it returns everything reachable from that terminal:

  • Subagents — the background workers this session has spawned itself
  • Other local sessions — every Claude Code instance running on the same machine
  • Cloud sessions — work you handed to Claude Code on the web, running on Anthropic's infrastructure
  • Remote machines — sessions on your other computers, reachable through a Remote Control connection
Diagram of a central Claude Code session connected to four peers: a local session, a subagent, a cloud session and a remote machine, inside a dashed discovery ring labeled ListAgents
ListAgents turns every running session — subagents, local, cloud, remote — into one address book.

Each row comes back with a name, and the name is the address. There is no pairing ceremony and no config file: if it shows up in the list, you can message it.

SendMessage is the whole API

The talking half is a single verb: SendMessage. You give it a name and a piece of text, the other session receives it as an event inside its own conversation, and the sender gets a delivery status back.

code
> tell the api session the deploy is green

⏺ SendMessage(to: "api-session",
    message: "deploy is green — tag v2.4.0 and ship it")
  ⎿  delivered

What makes this composable is the direction of intent. You do not script the other session or inject commands into it — you send it a sentence, and its own Claude reads that sentence with its own context, its own permissions, and its own opinion about what to do next. It is much closer to two colleagues on chat than to inter-process plumbing.

How the message travels

The routing depends on where the two sessions live. Two sessions on the same machine talk over a local socket — the message never leaves your computer, and no Anthropic server is involved. A message to a cloud session, or to a session on another machine connected through Remote Control, is relayed through Anthropic's servers.

Two-lane diagram: on the same machine, two terminals connected directly by a local socket; across machines and cloud, a session relayed via Anthropic servers to a cloud session and a remote mac
Same machine: a local socket. Different machine or cloud: a relay — carrying plain text only.

This is not the same as --resume

Claude Code has long had ways to get back into a session: --continue reopens the most recent one in the current directory, and --resume lets you pick any saved session, restoring its history, file state and goals. That is time travel — one conversation, reopened later. Cross-session messaging is something else: two conversations running right now, coordinating live, each keeping its own context.

What it unlocks

  • Contract changes without the copy-paste — the API session finishes a schema change and messages the frontend session with exactly what moved
  • Long jobs that report back — a cloud session running a heavy migration pings your local session when it is done, instead of you polling it
  • A reviewer on tap — a second local session reviews the diff the first one just produced and sends back its findings
  • One desk, many machines — the session on your office computer stays reachable from your laptop through Remote Control

None of this needed new infrastructure. No message broker, no webhook, no shared database — two sessions and a name.

And yes, this post practices what it preaches: it was researched, illustrated and written by one Claude Code session, which fact-checked the details through a subagent, drew the diagrams as SVG, screenshotted them with a headless browser, and delivered the whole article to this blog over MCP. Sessions talking to services, sessions talking to sessions — the terminal got a lot less lonely.

Share

Related

Claude Sonnet 5.5: Opus-Level Scores at Half the Price, and Where It Still Falls Short
Gemini 4 Argon: Google's New Frontier Model, the Benchmarks, the Price and What It Can Do
Claude Opus 5.5: Every Benchmark, From Anthropic, Cursor, Artificial Analysis, Sonar and ARC Prize