CLAUDE_CODE_MESSAGING_SOCKET
A Claude Code environment variable, read out of the shipped bundle. It has been in the build since v2.1.224, including the newest one read.
What it is
Set by Claude Code, not by you: in sessions that bind an [inbox socket](/docs/en/cross-session-messaging#the-sessions-inbox-socket), Claude Code exports that socket's path to hooks and Bash commands when it binds the socket. In a session that starts with messaging on, Claude Code binds the socket before any hook runs. Other sessions on the machine deliver messages to this path. Each session exports its own socket rather than one inherited from a parent, and messages arriving on it go through the session's [inbound controls](/docs/en/cross-session-messaging#control-inbound-messages). Settings env blocks can't set it. Requires Claude Code v2.1.224 or later
Anthropic's own wording. Read off Environment variables, captured 2026-08-28.
Presence across releases
| Releases | Reading | Declared type | Default |
|---|---|---|---|
| 2.1.245 – 2.1.250 5 releases | never mined | — | — |
| 2.1.224 – 2.1.243 19 releases | in the build | — | — |
A row reading never mined is a release with no archived bundle behind it. Nothing was read out of it, so nothing here says whether the name was in it. A declared type or a default is only ever what that release's own bundle stated.
Changelog entries naming it
-
v2.1.248Peer address row in the info panel
The info panel can show a Peer address row, unavailable unless CLAUDE_CODE_MESSAGING_SOCKET is set.
named in this entry
-
v2.1.224Peer address shown in the session info panel
The session info panel now shows your peer socket address when cross-session messaging is on.
named in this entry
-
v2.1.224New environment variable
CLAUDE_CODE_MESSAGING_SOCKETPoint CLAUDE_CODE_MESSAGING_SOCKET at a socket path to enable session-to-session messaging and stream-json message replay.
named in this entry
-
v2.1.224Local messaging socket: where it lives, who can read it, and refusing to steal a live one
The messaging socket lives under XDG_RUNTIME_DIR with locked-down permissions and refuses to hijack a live one.
named in this entry
-
v2.1.224Cross-session messaging inbox now actually starts at startup
Startup can now actually open the local socket that lets other sessions message you.
named in this entry
Documentation pages
- Environment variables reference table Claude Code CLI
- Message your other Claude Code sessions mentions it Claude Code CLI
- Claude Code settings mentions it Claude Code CLI
- Claude Code settings reference mentions it Claude Code CLI
A reference table page is one whose own table defines this name, and it is where the description above came from. A page that mentions it carries the name somewhere in its text and may say nothing about it at all. Every page carrying it.
Names beside it
Every environment variable in the inventory starting claude_code_messaging, up to twelve of them.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the environment variable does. All environment variables.