[FEATURE] Let /open?session= target the sidebar, or honor claudeCode.preferredLocation
Problem Statement
I run several Claude Code sessions in parallel in VS Code and built a menu bar dashboard that lists them and lets me jump to whichever one is waiting on me. Getting to the right window works fine (code <folder>), but there is no way to get to the right session from outside VS Code when sessions live in the sidebar.
The only session-targeted entry point the extension exposes externally is the URI route /open?session=<id>. That route always resolves to claude-vscode.primaryEditor.open, which creates a webview panel in the editor area. Since the map consulted before revealing an existing session tracks editor panels only, a session that is currently open in the sidebar is not found — so instead of switching to it, a duplicate opens in the main editor area. That is worse than doing nothing, so I ended up disabling the feature.
Proposed Solution
Either of these would solve it:
- Accept a location hint on the existing route, e.g.
vscode://Anthropic.claude-code/open?session=<id>&location=sidebar, or - Have
/open?session=<id>honor the existingclaudeCode.preferredLocationsetting instead of always opening in the editor area, and reveal the session where it already lives if it is open anywhere in that window.
Option 2 needs no new API surface and matches what claude-vscode.editor.openLast already does when it checks the preferred location.
Alternative Solutions
- Focus the window only (what I do now). Correct but incomplete — I still pick the session by hand from the sidebar's history dropdown.
- Enable the deep link anyway. Rejected: it creates duplicate tabs for sidebar users.
- A VS Code command instead of a URI. There is no CLI equivalent of "run command", so this is not reachable from an external tool.
- Keyboard automation (focus window, then drive the UI). Needs Accessibility permissions and is brittle.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
- Four Claude sessions run in parallel, two of them in the same repo.
- One blocks on a permission prompt; my menu bar turns red and names it.
- I click that entry. Today: the right window is focused, and I then find the session manually.
- With this change: the click lands directly on the session that is waiting.
Additional Context
- Extension
2.1.245, VS Code1.129.1, macOS15.5(arm64), sessions in the secondary sidebar. claudeCode.preferredLocationispanelin my settings, but that setting is documented as updating automatically when Claude is opened in a new location, so it does not reliably indicate where a given session is currently displayed. Reading it externally is not a workaround.- The details above come from reading the bundled
extension.js, so I realise/open?session=is an internal detail rather than a documented API. Filing this as a request for a supported way to do it, not as a regression.