agent-messaging-session-relaylisted
Install: claude install-skill tony/skills
# Message another agent
Deliver a message from this session to another running agent session, and verify the origin
of messages that arrive here.
Per-agent specifics live in an adapter — `references/codex.md` and
`references/claude-code.md`. Read the one for the agent you are talking
to; this file is the procedure.
## 1. Know your own address
You cannot ask for a reply without one, and no transport supplies it for you.
- **Codex**: `$CODEX_THREAD_ID`, injected into every command you run.
- **Claude Code**: your session name, from `ListAgents`. Your inbox is
`$CLAUDE_CODE_MESSAGING_SOCKET`.
## 2. Find the target
Discovery is **vendor-scoped** — each agent enumerates only its own kind. To reach the other
vendor you must read its registry directly.
- **Claude sessions, from Claude**: `ListAgents`. Addresses are session names.
- **Claude sessions, from anything else**: `claude agents --json` lists only live sessions,
each with `name`, `pid`, and `status`. Read that session's inbox from
`${CLAUDE_CONFIG_DIR:-$HOME/.claude}/sessions/<pid>.json`, field `messagingSocketPath` —
never build the path yourself, because its directory follows `XDG_RUNTIME_DIR` and differs
across hosts. Resolve a name through the listing, never by scanning the socket directory:
it publishes no names, most entries are **stale**, and one logical session can hold two
sockets (parent and child).
- **Codex sessions, from anything**: all Codex state lives under
`${CODEX_HOME:-$HOME/.codex}