SendMessage: structured message to a cross-session peer is denied and shown as a turn error
What happened
Claude Code 2.1.296. Session B received a plain-text cross-session message from session A (from was a uds:/tmp/cc-socks/<pid>.sock address). Session B called SendMessage with to set to that address and message set to a structured object, {"type":"shutdown_request"}.
The tool rejected the call:
structured messages cannot be sent cross-session — only plain text
The session UI showed that denial as the turn result:
Thought for 5s
Error: structured messages cannot be sent cross-session — only plain text
Plain text to the same uds address is accepted. Only the structured object form is rejected.
Why it happens
SendMessage validateInput in 2.1.296 (@anthropic-ai/claude-code) returns this string with errorCode 9 when message is an object and the recipient scheme is not other. The bridge scheme hits the same string earlier in the same function.
That disagrees with the rest of the contract the model is given:
- The tool schema still lists a structured
messageobject (shutdown_request,shutdown_response,plan_approval_response) with no cross-session exclusion. - The system prompt says to answer a
shutdown_request/plan_approval_requestframe with the structured object form, and to reply to a cross-session message by copying itsfromintoto.
A string that only looks like protocol JSON is a different error (message text must not be a teammate protocol frame). The object form is the one that produces this exact text.
Expected
Keep cross-session delivery plain-text only. Do not offer the structured object for a uds/bridge recipient, and do not render this denial as a user-visible turn error. It should come back as a normal tool result so the model can resend the same note as plain text.
Repro
- Two Claude Code 2.1.296 sessions on one machine, cross-session messaging on.
- From session A,
SendMessagea plain-text note to session B. - From session B,
SendMessagewithto= A'suds:/tmp/cc-socks/<pid>.sockandmessage={"type":"shutdown_request"}(object, not a string). - The tool returns
structured messages cannot be sent cross-session — only plain text, and the UI showsError: structured messages cannot be sent cross-session — only plain text.
Evidence
- Claude Code 2.1.296, binary
/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe - Session
d8cf50ba-ca8f-417f-9f23-e8cf8642f799, 2026-10-12T16:54:01Z through 2026-10-12T16:55:16Z (repeated tool_use_error on the same call shape) - Peer address shape:
uds:/tmp/cc-socks/4115885.sock
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗