[FEATURE] Let /open?session= target the sidebar, or honor claudeCode.preferredLocation

Status Open
Reported on v2.1.245
Maintainer reply None cached
Activity 0 comments · opened Aug 25, 2026

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:

  1. Accept a location hint on the existing route, e.g. vscode://Anthropic.claude-code/open?session=<id>&location=sidebar, or
  2. Have /open?session=<id> honor the existing claudeCode.preferredLocation setting 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

  1. Four Claude sessions run in parallel, two of them in the same repo.
  2. One blocks on a permission prompt; my menu bar turns red and names it.
  3. I click that entry. Today: the right window is focused, and I then find the session manually.
  4. With this change: the click lands directly on the session that is waiting.

Additional Context

  • Extension 2.1.245, VS Code 1.129.1, macOS 15.5 (arm64), sessions in the secondary sidebar.
  • claudeCode.preferredLocation is panel in 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.

View original on GitHub ↗