CLAUDE_CODE_MESSAGING_TOKEN
A Claude Code environment variable, read out of the shipped bundle. No mined inventory carries it: everything below comes from what this site has written about it.
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 this per-session token to hooks and Bash commands alongside CLAUDE_CODE_MESSAGING_SOCKET. A script posting to the socket can send {"type":"auth","token":"<token>"} as its first line to prove it belongs to the session. On native Windows, Claude Code requires this line and closes any connection that doesn't open with a valid one. The [own-child rules](/docs/en/cross-session-messaging#the-sessions-inbox-socket) say when Claude Code consults the token. Each session exports its own token, never one inherited from a parent session. Settings env blocks can't set it. Requires Claude Code v2.1.228 or later
Anthropic's own wording. Read off Environment variables, captured 2026-08-28.
Presence across releases
The miner has never read a build containing this name. It is here because a changelog entry of ours names it, which is evidence that it existed and not evidence of which releases carried it. The inventory starts at v2.1.138 and everything older than that was never mined.
Changelog entries naming it
-
v2.1.228Cross-session messaging between Claude Code sessions is now authenticated
Messages between your Claude Code sessions are now token-authenticated, strictly on Windows and best-effort elsewhere.
named in this entry
-
v2.1.228Local messaging inbox publishes an auth key so peers can prove who they are
Your local message inbox publishes a key file so other sessions can prove who they are.
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.