← cd ../blog

Claude Code's New Superpower: Cross-Session Messaging

If you’ve been using Claude Code to speed up your development workflow, you know how powerful it is to have an AI pair programmer directly in your terminal. But until recently, each session was siloed. If you were working on a frontend component in one terminal and fixing a backend API in another, the two Claude sessions had no idea what the other was doing.

That changes now. Claude Code has introduced a game-changing feature: Cross-Session Messaging.

What is Cross-Session Messaging?

Available in Claude Code v2.1.224 and later, cross-session messaging allows one of your Claude Code sessions to deliver a message to another session. This means your separate terminal sessions can now communicate with each other, sharing context and updates dynamically.

Instead of you acting as the middleman—copy-pasting a database schema change from one terminal to another—Claude can simply pass the information along.

When Should You Use It?

This feature is perfect for scenarios where one session’s work impacts another, or when you need coordination across different tasks:

  • Handing over findings: If your backend session discovers a breaking change, Claude can summarize it and send it to your frontend session so it can adapt immediately.
  • Coordinating parallel worktrees: If you are working on the same repository in separate git worktrees, sessions can inform each other when changes land.
  • Getting status from long-running work: You can have a session running a slow migration or a heavy test suite report back to the session you are currently focused on.
  • Replying across machines: You can even answer a message that arrived from one of your sessions on another machine or on the web via Remote Control.

How Does It Work Under the Hood?

Claude handles this communication autonomously. You don’t need to manually configure complicated webhooks or pipes. When Claude determines a message needs to be sent, or if you explicitly ask it to (e.g., “Tell the frontend session that the API route has changed to /v2/users”), it uses two internal tools:

  1. ListAgents: Claude uses this tool to discover which of your other sessions it can reach. It lists your local sessions running on the same machine (or remote ones if connected via Remote Control).
  2. SendMessage: Claude uses this tool to deliver the specific message to the target agent by name.

The receiving session processes the message seamlessly between its own tool calls or starts a new turn if idle, ensuring that running tasks are never interrupted.

Managing Security and Permissions

With great power comes great responsibility. The Claude Code team has implemented strict boundaries to ensure this feature remains secure and helpful:

  • No unauthorized actions: A message from another session never counts as your consent. It cannot answer a pending permission prompt on your behalf.
  • Context stays separate: The receiving session gets only the text of the message, not the sender’s entire conversation history or files.
  • Inbound controls: You can control how a session treats incoming messages using the crossSessionInbound setting, choosing to accept, hold for approval, or refuse messages entirely.

Use Cases in Practice

Here are some real-world examples of how you can use this feature to improve your workflow:

  • Frontend/Backend Synchronization: When updating an API endpoint in your backend session, ask Claude to “tell the frontend session about the new /v2/auth endpoint structure.” The frontend session can then update the client code without you needing to switch contexts.
  • Database Migrations: While a long-running database migration is executing in a background session, ask the session you are currently working in to “ask the migration session if it has finished yet.”
  • Continuous Integration (CI) Feedback: Have a session dedicated to running tests. When it finishes, it can message your active session: “The test suite failed on auth.spec.ts. Please check line 45.”
  • Code Review Across Branches: If you are comparing two branches in separate worktrees, the sessions can discuss differences and summarize architectural changes between the versions.

Conclusion

Cross-session messaging transforms Claude Code from a set of isolated assistants into a coordinated AI team right on your machine. By allowing sessions to share context and updates autonomously, it reduces friction, prevents context-switching, and makes multi-terminal development workflows smoother than ever.

Give it a try by opening two terminals, starting Claude Code in both, and asking one to send a message to the other. You might just find it’s the missing piece in your AI-assisted development workflow!

$ echo "EOF"