[Bug] Session identity broken for multi-agent worktree workflows: filtering, naming, and cross-worktree resume
Bug Description
Session identity is broken for multi-agent worktree workflows (naming, filtering, resume, remote-control)
Problem
Four interconnected session-identity issues that compound into a broken experience when running multiple agents in separate git worktrees:
- Unfiltered session list: claude --resume shows ALL sessions for the entire repository (44 in my case) regardless of which worktree/branch the user is in. No
filtering by current worktree.
- Garbage session names: Session names display random text from the session — not the agent name, not a user-assigned name. Examples: "Please dispatch captain on the
git issues It feels like you are not using tools and skills appropriate", "Do a handoff", "resume". The @agent tag IS visible on some entries (proving the system knows
the agent name), but the primary display label is garbage text.
- Claude Code randomly overrides user-assigned session names: Even when a session name is explicitly assigned by the user, Claude Code silently replaces it with
auto-generated text at some later point. This is not "bad defaults" — it's the system actively overriding user intent. You assign a name, you see it confirmed, and
later the name is something else. This makes the naming system untrustworthy.
- Cross-worktree resume fails silently: Sessions from other worktrees are shown in the list, but selecting one fails because the session was started in a different
worktree with different branch state. The UI shows an affordance that always fails.
- Remote-control mirrors the same broken list: The Claude Desktop Code tab's session picker shows the same unfiltered, badly-named session list. A principal managing a
fleet of agents sees every agent's sessions mixed together with meaningless names.
Steps to reproduce
- Create a git repo with multiple worktrees: git worktree add .worktrees/devex -b devex
- Start sessions in different worktrees with different agent names: cd .worktrees/devex && claude --agent devex
- Optionally: assign a custom session name
- Exit the session
- Run claude --resume from the devex worktree
- Observe: sessions from all worktrees visible, names are garbage, any custom name may have been overridden
- Select a session from a different worktree → fails
Expected behavior
- Filter by worktree by default — claude --resume in the devex worktree shows only devex sessions. Ctrl+A or a toggle to show all.
- Use agent name as session display name — sessions started with --agent devex display "devex" as the primary label, not random session text.
- Never override user-assigned session names — if the user names a session, that name persists for the lifetime of the session. Claude Code may suggest a name for
unnamed sessions, but must never silently replace a user-assigned name.
- Prevent or warn on cross-worktree resume — don't show sessions the user can select but cannot resume.
- Fix remote-control session picker — apply the same filtering and naming to the Claude Desktop Code tab.
Why this matters
Multi-agent development with worktrees is a growing pattern (Claude Code's own --agent flag and EnterWorktree tool encourage it). The current session management UX
assumes a single-session, single-directory workflow. When scaled to 5-8 concurrent agents on the same repo, the resume/remote-control experience breaks down completely.
The principal managing a fleet of agents needs clean, agent-named, worktree-filtered navigation — not a raw dump of every session ever started.
Reporter
- Name: Jordan Dea-Mattson
- GitHub: @jordandm (the-agency-ai), @jordan-of (OrdinaryFolk)
- Email: jordandm@users.noreply.github.com, jordan-of@users.noreply.github.com
- Framework: https://github.com/the-agency-ai/the-agency (8 concurrent worktree agents)
- Claude Code version: (fill at submission — claude --version)
- Screenshot available showing the 44-session unfiltered list
Related
- --agent/--name env var feedback (separate filing) — the agent name exists internally but isn't surfaced
- Filed as part of the 2026-04-11/12 feedback batch
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.101
- Feedback ID: ce60ba6d-01b6-4126-ac04-c94b1e74cd67
Errors
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Output blocked by content filtering policy\"},\"request_id\":\"req_011CZwHyHAGs3JxBGJEgkNGQ\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53430)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T03:43:27.528Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Output blocked by content filtering policy\"}…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗