Imagine you have two Claude Code sessions running at the same time:
Session A discovers that an API schema has changed. Without messaging, you may have to copy the information yourself into Session B. With cross-session messaging, Claude can send the relevant text directly to the other session.
| Need | Best feature |
|---|---|
| Continue the same conversation somewhere else | Resume the session |
| Coordinate a group of Claude sessions that work as a team | Agent Teams |
| Watch and steer many sessions from one screen | Agent View |
| Let independent sessions exchange findings/status | Cross-Session Messaging |
| Send CI/chat/external events into Claude | Channels |
The current documentation states that cross-session messaging requires Claude Code v2.1.224+ on macOS, Linux, and WSL 2, and v2.1.234+ on native Windows. Messaging is enabled automatically when the session meets the requirements.
For same-machine messaging on certain providers or when feature-flag fetching is disabled, the current docs require v2.1.248+.
claude --version. You can also use /list-agents (or /peers) to check which sessions Claude can reach.You normally do not call the messaging tools yourself. Claude uses two tools:
| Tool | Purpose |
|---|---|
ListAgents | Discovers sessions Claude can reach. |
SendMessage | Sends a text message to a selected session. |
You can simply ask Claude for the communication you want:
Ask the session running in my other terminal whether the migration finished
Or describe what another session needs to know:
Explain what we just did to the session working on the payments API
In supported versions, you can name another live session with an @ mention. For example:
Let @api-worker know the schema migration finished
The typeahead can help select the target. If a session name contains spaces or other special characters, Claude Code can use a quoted mention such as @"release notes".
A running receiving session reads the message between tool calls, so an active tool is not interrupted. If the receiving session is idle, Claude Code starts a new turn with the message.
The receiving Claude gets the message text, the sender's name, and normally a reply address. It does not receive the sender's conversation history or files.
Messages from another Claude session do not count as your consent.
CLAUDE.md, or other configuration on the basis of another session's request.The setting crossSessionInbound controls how a session treats messages arriving from other sessions.
| Value | Meaning |
|---|---|
accept | Deliver each message to Claude. |
hold | Show a notice but do not deliver the message until allowed. |
refuse | Drop incoming messages without delivering them. |
You can also access the setting from the /config interface in supported versions, where the row is named Messages from your other sessions.
When you have not explicitly configured crossSessionInbound, Claude Code determines behavior based on the permission modes of the sender and receiver.
When a message is held, the approval dialog can show the sender and a preview. You can approve or deny that individual message.
Claude can request a one-time notice when another local session next becomes idle or exits.
Tell me when the migration session finishes what it's working on
This uses notify_when_idle. It is useful for long-running migrations, tests, or other work where repeatedly checking the other terminal is inconvenient.
Run:
/list-agents
You can also use:
/peers
The list can include:
The transport depends on where the target session runs:
| Target | How the message travels |
|---|---|
| Same machine | Per-session local socket/pipe; not through Anthropic servers. |
| Another machine | Through Anthropic servers and that machine's Remote Control connection. |
| Claude Code on the web | Through Anthropic servers to the cloud session. |
If you want explicit approval before messages leave the current machine, set:
{
"isolatePeerMachines": true
}
This requires approval before SendMessage reaches a session beyond the current machine, including when bypass permissions would otherwise skip ordinary prompts.
You can control receiving separately from sending/listing.
{
"crossSessionInbound": "refuse"
}
Add permission deny rules for:
SendMessage ListAgents
{
"permissions": {
"deny": ["SendMessage", "ListAgents"]
},
"crossSessionInbound": "refuse"
}
SendMessage also affects messaging to subagents and agent-team teammates because the same tool is used for those messages.Each session with cross-session messaging enabled can bind an inbox endpoint used by other local sessions.
/status shows the Peer addressCLAUDE_CODE_MESSAGING_SOCKETCLAUDE_CODE_MESSAGING_TOKEN is also exportedThis section mainly matters when a session you expect is missing from the agent list, or when a script/hook needs to post into a session.
A long-running claude -p session can bind an inbox and receive messages. Bare mode does not bind the socket, so a bare-mode session cannot receive cross-session messages and does not appear in the agent list.
A -p session cannot display an interactive approval dialog. If unattended message handling is needed, the documentation describes configuring crossSessionInbound explicitly, for example with accept.
| Problem | What to check |
|---|---|
/list-agents is not recognized | Check Claude Code version and availability requirements. |
| Session is listed but message does not arrive | Check deny rules and the receiving session's inbound controls. |
| Cloud session is missing | Check that the current session is connected to Remote Control. |
| Other-machine session is missing | Both sides need the appropriate Remote Control setup. |
| Expected inbox is unavailable | Use /status and inspect the Peer address reason; debug logs can provide more detail. |
Session A: Backend migration changes an API field.
Session B: Frontend is building against the old field.
Session C: Integration tests are running.
The important idea is that each session can remain independent while sharing the small piece of information needed to stay coordinated.
| Cross-Session Messaging | Agent Teams |
|---|---|
| Independent sessions communicate. | Claude coordinates a team of sessions. |
| You can start and steer the independent sessions yourself. | Team structure includes a lead, teammates, and shared task coordination. |
| Good for passing findings, decisions, and status. | Good for coordinated multi-agent work. |
| Communication is plain text. | Teams can use structured team/task coordination. |
/list-agents to see reachable sessions.@session-name when you want to target a specific session.crossSessionInbound when messages are held or refused.isolatePeerMachines if you want approval before messages leave the machine.ListAgents and SendMessage?accept, hold, and refuse?isolatePeerMachines protect?-p session be useful for messaging?/list-agents to identify the other session.
crossSessionInbound to hold and observe what happens to an incoming message.
Cross-session messaging is Claude Code's communication layer for independent sessions. It lets one session pass a finding, decision, or status update to another without merging their contexts.