VS Code session panel silently drops group members whose cwd is a git worktree
Summary
A session whose working directory is a git worktree inside the workspace is silently dropped from its session group in the VS Code sidebar after a restart. The group's stored membership still contains the session ID — only the UI loses it. There is no error, no placeholder, and no way to reach the session from that window.
From the user's point of view, a week of work on an open draft PR looks deleted.
Environment
- Claude Code / VS Code extension 2.1.251
- macOS 26.5.2 (Apple silicon)
- VS Code window rooted at
/Users/sobsoft/ai_industry_eps
Repro
- From the workspace root, create a worktree under it and run Claude there:
```
git worktree add .claude/worktrees/x <branch>
cd .claude/worktrees/x && claude
~/.claude/projects/-Users-…-eps--claude-worktrees-x/<id>.jsonl`
The session gets its own project key:
- In the workspace window's session panel, drag that session into a group (e.g.
factory_app). - Restart VS Code.
- The group renders with one fewer session. The missing one is unreachable from that window.
Evidence
globalStorage/state.vscdb, key Anthropic.claude-code:
sessionGroups:/Users/sobsoft/ai_industry_eps
factory_app → 5 sessionIds
The sidebar renders 4. The five members, and where their transcripts live:
| session id | project key | rendered |
|---|---|---|
| 521084e7-… | -Users-sobsoft-ai-industry-eps | yes |
| d7c17109-… | -Users-sobsoft-ai-industry-eps | yes |
| 8595cb19-… | -Users-sobsoft-ai-industry-eps | yes |
| 1b730683-… | -Users-sobsoft-ai-industry-eps | yes |
| 0e811186-… | -Users-sobsoft-ai-industry-eps--claude-worktrees-blok-bez-sila | no |
The only difference is cwd. list_sessions for the workspace does not return the worktree-keyed session, and the panel discards a group member it cannot resolve instead of surfacing it.
The transcript file and the worktree were intact the whole time — nothing was actually lost, which is precisely why the silent drop is so misleading.
Expected
Either:
- include sessions whose
cwdis a git worktree inside the workspace in that workspace'slist_sessions, or - render an unresolved group member as an unreachable entry showing its path, so it can be found and reopened.
Silently omitting it is the one behaviour that gives no way to recover.
Notes
Groups are per-workspace, so the workaround is to open the worktree folder as its own VS Code window — but the user has to already know the worktree exists, which is exactly the knowledge the panel destroyed.