{"name":"CLAUDE_CODE_MESSAGING_TOKEN","slug":"claude-code-messaging-token","family":"env","title":"Environment variables","noun":"environment variable","description":"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","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.308","builds":0,"mined_builds":149,"first_cited":{"version":"2.1.228","released_at":"2026-08-11 17:45:45","spans":1}},"aliases":[],"entries":[{"version":"2.1.228","anchor":"cross-session-messaging-between-claude-code-sessions-is-now-","heading":"Cross-session messaging between Claude Code sessions is now authenticated","line":"Messages between your Claude Code sessions are now token-authenticated, strictly on Windows and best-effort elsewhere.","released_at":"2026-08-11 17:45:45","reason":"named in this entry, found in this entry's text"},{"version":"2.1.228","anchor":"local-messaging-inbox-publishes-an-auth-key-so-peers-can-pro","heading":"Local messaging inbox publishes an auth key so peers can prove who they are","line":"Your local message inbox publishes a key file so other sessions can prove who they are.","released_at":"2026-08-11 17:45:45","reason":"named in this entry, found in this entry's text"}],"entries_total":2,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"cross-session-messaging","title":"Message your other Claude Code sessions","documented":false},{"source":"claude-code","path":"settings","title":"Claude Code settings","documented":false},{"source":"claude-code","path":"settings-reference","title":"All settings","documented":false}],"docs_total":4,"gates":[],"related":[{"name":"CLAUDE_CODE_MESSAGING_SOCKET","slug":"claude-code-messaging-socket","description":"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"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-messaging-token","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}