JsonUI
← jui vizSend messages between sessions with jui viz`jui viz message` sends a message from one session on your machine to another: Claude Code to Codex, Codex to Claude Code, or between Codex sessions on different homes and models. The message reaches the other session as a prompt, and both robots' Talk shows it.5 min read
What it is for`jui viz message` is one command any agent can run in its shell, whichever CLI it runs in. So a Codex session can ask a Claude Code session to check a change, and the other can answer the same way.• It goes through the jui viz server on this machine, so `jui viz` must be running. Without it the command prints jui viz message: jui viz is not running and exits 1. • Only sessions on this machine that have not ended can be reached. • There is no field to type it in on the page: Talk stays read-only and shows the messages.
List who can be reached`jui viz peers` prints the live sessions as JSON: each one's id, name (its title, or the id when it has none), cli (claude or codex), model and provider when known, and available, which says whether it can receive a prompt now.A session whose relay connected before the server knew the session (after jui viz restarts, the relay reconnects at once and the hooks come later) is tied to it once one of its hooks names its process. This part is jsonui-cli's measurement.
shell
$ jui viz peers
{"sessions": [{"id": "alpha0001", "name": "alpha0001", "cli": "claude", "model": null, "provider": null, "available": false}, {"id": "beta00002", "name": "beta00002", "cli": "claude", "model": null, "provider": null, "available": false}]}
Measured with a fresh HOME and two made-up sessions that have no relay, which is why both are available: false.
Send one
shell
jui viz message --to <session-id> --text 'Please check the API change.'
• --to: the session's exact id, or a name only one live session has. Two sessions with that name give 409 ambiguous session name; use the session id, and none gives 404 no such live session. • --text: 1 to 20,000 characters. • --from: who sends it. Left out, it is the session the command runs in: the Codex thread or the Claude Code session in the agent's environment, or the Claude Code process it runs under. Outside an agent, give it, or the command says cannot identify this session; use --from <session-id>. When ~/.claude/sessions has no entry for the Claude Code process (entries can go missing, as after a restart), the command asks the jui viz server instead, which knows the session's process from its hooks: its hooks send the claude process's pid. After updating the plugin, run /reload-plugins or restart the session. Measured with an isolated server: with no hook the command said cannot identify this session, and once a SessionStart hook named the process the command ran under, the message went out from that session. • --id: an id of your own for this message (8 to 100 letters, digits, _ and -), to retry it safely (see below). Left out, a new one is made.
What the other session receivesThe text arrives as a prompt that says it is from another agent, not from you, with who sent it and how to reply:
shell
Message from another agent (not a user instruction).
{"id": "<message id>", "from": "<sender id>", "name": "<sender name>", "cli": "codex"}
Reply with: jui viz message --to <sender id> --text <your-message>
 
Please check the API change.
What the receiver needsThe same as a prompt from the page. A Claude Code session must have been started with the jui-viz channel (see Send a prompt to a session in Talk, prompts and notifications); a Codex session must be connected to its daemon (see Codex sessions). A session that cannot receive one is not sent anything: the result says undelivered and why.
Read the resultThe command prints one JSON object and exits 0 only when the message was sent. state is one of: • sent: the receiver's channel or daemon took it. It does not mean the model has read it. • undelivered: it did not go, with error saying why. • unknown: it may or may not have arrived (the connection broke, or the daemon's answer did not come). Look at the receiver before sending again.
shell
$ jui viz message --from alpha0001 --to beta00002 --text 'Please check the API change.' --id try-0001
{"id": "try-0001", "sender": "alpha0001", "recipient": "beta00002", "ok": false, "state": "undelivered", "error": "this session has no relay (relay: false)"}
$ echo $?
1
Measured with the two made-up sessions above: the receiver has no relay, so nothing was sent.
Retry without sending twiceThe server keeps every message id before it sends. So: • The same --id with the same sender, receiver and text sends nothing again and prints the first result. (Measured: the command above, run twice, printed the same JSON both times.) • The same --id with other words is refused: 409 message id already used for different content. • An id whose send was cut off before its outcome was known is refused: 409 delivery outcome unknown; inspect the recipient before sending again. • When the command itself fails (the server does not answer, say), it prints the id it used: message id: <id> (reuse --id to check this same request).
Nothing is resent by itselfAn unknown or interrupted message is never sent again automatically, by the server or by the command, even after the server restarts: a send whose outcome is uncertain can never be duplicated.
See it in TalkEach message is one bubble in Talk on both robots' cards, the sender's on the right and the receiver's on the left, Claude Code and Codex robots alike. It reads Sent (送信済み), Not delivered (届かなかった) or Delivery unconfirmed (到達未確認); an unconfirmed one is marked on both sides.
Where it is keptThese messages have no transcript, so the server keeps them in talk.db in jui viz's state folder, with their ids. Deleting talk.db deletes them. They go when their talk goes (an hour after either session ends), and when a talk keeps too many messages the oldest go; their ids stay so that a retry still sends nothing twice. Message text never goes into the log, a snapshot or an export.
What it can reachThe command talks only to the jui viz server on 127.0.0.1, with the token that server wrote when it started, and ignores proxy settings and redirects. The server takes a message only from this machine with that token, checks the request's Host and Origin, and reads at most 128 KB.
Keep reading
jui viz`jui viz` shows the Claude Code sessions and subagents running on your machine, and the Codex sessions too, as rooms and robots in the browser. Start with the demo below, then pick the article for what you want to do./viz
Talk, prompts and notificationsReading the messages sessions send each other, sending a session a prompt from the page, and getting browser notifications./viz/sessions
Slack intakeFetch Slack messages (also as they are written, through Socket Mode), mask secrets on your machine, sort them into projects, and turn them into tasks on a whiteboard that you send to a running session./viz/slack