[VS Code] open?session= URI does not focus an already-open session - opens a fresh conversation (busy) or a duplicate view (idle)
Environment
- Claude Code VS Code extension 2.1.163 (win32-x64), VS Code on Windows 11 Pro (build 26200)
- Single VS Code window; the target session belongs to the currently open workspace
Docs say
Per https://code.claude.com/docs/en/vs-code (URI handler section):
session — A session ID to resume instead of starting a new conversation. … If the session isn't found, a fresh conversation starts instead. If the session is already open in a tab, that tab is focused.
Actual behavior (measured 2026-06-05)
Launching vscode://anthropic.claude-code/open?session=<id> where <id> is the hook-payload / transcript-filename session UUID:
| Target session state | Result |
|---|---|
| Open in a tab, busy (tool running or permission prompt pending) | A fresh empty conversation opens (the "not found" fallback) |
| Open in a tab, idle | A duplicate view of the conversation opens at the default location, instead of focusing the existing tab |
| Closed (same workspace) | Resumes correctly ✅ |
Verified via SessionStart/SessionEnd hook markers: each URI launch against an open session produced a new startup session id with no transcript (fresh-conversation fallback), and the duplicate/resume cases produced corresponding lifecycle events for the target id.
Expected
Focus the existing tab, as documented — including (especially) when the session is busy.
Use case / impact
Hook-driven OS toast notification → click → jump to the conversation that needs attention. A permission-pending session is exactly the one the user wants to jump to, and it is exactly the state that cannot be resolved. Related: #57230 (attention signals when running multiple sessions — currently only the small tab dot exists).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗