[BUG] VS Code: "Resume session" on a conversation that entered a worktree starts a fresh empty conversation instead
What's Wrong?
In the VS Code extension, Resume session (sessions list → right-click → Resume session) does not resume a conversation that called EnterWorktree partway through. Each click opens a new editor tab running a brand-new empty conversation in the main checkout. No error is shown, so from the user's side it looks like nothing happens. I clicked 5 times and got 5 fresh sessions.
The conversation is still listed in the sidebar under its correct title, and its transcript is intact on disk in the worktree-keyed project dir (~/.claude/projects/<repo>--claude-worktrees-<name>/<id>.jsonl, about 2 MB).
Workaround that works: open the worktree folder (<repo>/.claude/worktrees/<name>) as its own VS Code window and resume from there. That path sends resume: <id> and recovers the full conversation.
This looks like the same missing-resume failure as #82802, reached from a different entry point: the sessions-list Resume action rather than tab restore after a VS Code restart. Possibly related: #34437.
What Should Happen?
Resume should launch with resume: <id> and cwd = the worktree. The CLI handles that fine, as the workaround shows. If the extension can't resume, it should say so rather than silently starting a new conversation.
Error Messages/Logs
Extension log (exthost/Anthropic.claude-code/Claude VSCode.log), main-checkout window. Every Resume click produced this shape, with no resume in launch_claude:
09:56:54.263 Received message from webview: {"type":"request",...,"request":{"type":"open_in_editor","sessionId":"<string>","usage":"<object>"}}
09:56:55.424 Received message from webview: {"type":"launch_claude","channelId":"qal8tao46tc","cwd":"<string>","freshStartIfUnresumable":false,"permissionMode":"<string>","thinkingLevel":"<string>"}
09:56:56.092 Spawning Claude with SDK query function - cwd: C:\<repo>, permission mode: auto, version: 2.1.289, ..., resume: undefined
The same thing repeated at 09:57:05, 09:57:23, 09:58:12 and 09:58:26, always resume: undefined with cwd = main checkout. One [error] Error processing client request: Error: Webview is disposed also appeared at 09:57:11.
The same conversation, resumed from a window opened on the worktree folder:
10:01:54.134 Received message from webview: {"type":"launch_claude","channelId":"9zqld3ol6au","cwd":"<string>","resume":"<string>","freshStartIfUnresumable":false,...}
10:01:54.957 Spawning Claude with SDK query function - cwd: C:\<repo>\.claude\worktrees\<name>, permission mode: auto, version: 2.1.289, ..., resume: 94066a3f-...
The log redacts sessionId in open_in_editor, so I can't show which ID the webview passed on the failing clicks.
Steps to Reproduce
This is the sequence that produced the bug, confirmed from the log. I haven't re-run it from a clean setup.
- Open a git repo folder in VS Code and start a Claude Code conversation (cwd = main checkout).
- Have Claude call
EnterWorktreewith a name, then continue the conversation for a while. - Close that conversation's tab.
- In the sessions list, right-click the conversation and choose Resume session.
- A new tab opens with an empty conversation in the main checkout. The original conversation isn't loaded.
Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
VS Code extension 2.1.289. 2.1.291 was released a few hours earlier; I haven't retested on it.
Platform
Claude subscription (OAuth)
Operating System
Windows 11
Terminal/Shell
VS Code extension (Git Bash)