ListAgents: peer rows don't show cwd/branch, so the agent can't resolve "the <task> session"
What happens
With several Claude Code sessions open on one machine, ListAgents gives each peer a name that is either derived from the directory the session was launched in (<repo>-38) or randomly generated (pothos-heart-97). Each row carries only the name, mode, busy/idle, and start time.
Users don't refer to their sessions by those names, because they never see them. They refer to them by what the session is working on, usually the worktree or branch. In my case I asked the agent to "notify the friendship-shop session when the release is out". That session's name is <repo>-38, and it works inside a worktree on branch feat/friendship-shop. Nothing in the ListAgents output connects the two, so the agent could not resolve the request, and I had to answer "it's <repo>-38, I don't know your numbering".
The agent could only find out that a friendship-shop worktree exists by running git worktree list itself. That still doesn't say which live session is in it.
Ask
Either of these would let the agent resolve "the X session" without asking:
- Show each peer's current working directory and git branch in the
ListAgentsrows, reflecting the current worktree afterEnterWorktree/cd, not only the launch directory. - Show the user each session's own messaging name (in the prompt footer, status line, or
/status), so the user can say "send it to<name>".
Related: #93515 asks to surface user-assigned session titles. This issue covers the case where the user assigned nothing and refers to a session by its task.
Environment
- Claude Code 2.1.296
- macOS 27.0.1
- Sessions: several interactive sessions on one machine, some working inside git worktrees under
.claude/worktrees/