Include the messaging ref in `claude agents --json`
Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 11, 2026
ListAgents shows each peer session as name [ref] (for example my-session [a1b2c3]), and SendMessage accepts name [ref] to tell apart sessions that share a name. claude agents --json (2.1.296) does not carry that ref, and the ref cannot be derived from sessionId.
Tools that build on the listing, such as a pane that offers a "message this session" draft, can therefore only address peers by their bare name. That has two consequences:
- Between drafting and sending, another session can take the name, and the message reaches the wrong session.
- Such tools have to copy the resolver's internal rules about which names are routable, and those copies drift with every release.
Request: add the ref (or another stable address SendMessage resolves by default, such as sid:<sessionId>, which currently sits behind a flag that defaults to off) to each entry of claude agents --json.
Related: #97220 (hooks cannot obtain the display name SendMessage accepts), #95807, #89946.