[FEATURE] [VSCode extension] Clicking a session in the sessions list ignores preferredLocation and always opens in an editor tab (no way to open in the secondary sidebar)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I keep both the integrated terminal and the Claude Code chat view docked in the secondary side bar (right), while the sessions list lives in the primary side bar (left activity bar).
When I click a session in the sessions list, it always opens as an editor tab in the center editor group. This takes over my code editing area every time. Setting claudeCode.preferredLocation to "sidebar" does not change this — clicked sessions still open in the editor.
From inspecting the extension (v2.1.170), it looks like:
claudeCode.preferredLocationonly affects the generic "Claude Code: Open" command (editor.openLast) and the status bar button — not clicks in the sessions list.- Session-list clicks route only through the "open in editor" path (
claude-vscode.editor.open), with no code path that loads a specific session into the secondary sidebar view. claude-vscode.sidebar.opentakes no session argument, so it only focuses the sidebar — it can't load a selected session.
Proposed Solution
- Make session-list clicks respect
claudeCode.preferredLocation, so that with"sidebar"set, clicking a session opens/reuses the Claude Code view in the secondary side bar instead of an editor tab. - Add a command such as "Claude Code: Open Session in Side Bar" that accepts a session id, plus a context-menu entry on session items in the list.
Alternative Solutions
- A per-session-list setting (e.g.
claudeCode.sessionsList.openLocation:editor|sidebar|window) decoupled from the generic open behavior. - Allow choosing the open target via modifier-click (e.g. Ctrl/Alt+click to open in sidebar) or a small location toggle in the sessions list header.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
My layout: editor groups in the center for code, Claude Code chat + integrated terminal pinned together in the right secondary side bar. I browse past sessions in the left sessions list and want to resume one. Today, clicking it spawns an editor tab that disrupts my code layout; I want it to appear in the Claude view on the right, next to my terminal, where I already work with Claude.
Additional Context
- Claude Code extension: v2.1.170
- VSCode: with secondary side bar support enabled
- OS: Windows 11
claudeCode.preferredLocationset to"sidebar"in settings
3 Comments
I just got Claude access at my workplace today - and this same issue was present for me - id like this to be prioritized - copilot chat worked like this and it was convenient.
was going to open a bug but then saw this adding my info here
Bug Report
Title: Sessions list click ignores preferredLocation: "sidebar" — always opens in editor tab
Extension: Claude Code for VS Code (anthropic.claude-code)
Version: 2.1.186
VS Code version: (user to fill in — Help → About)
<img width="372" height="277" alt="Image" src="https://github.com/user-attachments/assets/cd91fbcb-0832-4bdb-a8e3-3cca4720faa8" />
OS: Windows 11 Enterprise
Description
When claudeCode.preferredLocation is set to "sidebar", clicking a session in the sessions list panel opens it as a new editor tab instead of in the sidebar. The claude-vscode.sidebar.open command (via Ctrl+Shift+P) works correctly and does open in the sidebar, but the sessions list does not respect the same preference.
Steps to reproduce
Set "claudeCode.preferredLocation": "sidebar" in VS Code user settings (settings.json).
Open the Claude Code sessions list in the activity bar.
Click any session item in the list.
Expected behavior
The session opens in the sidebar (same as running Claude Code: Open in Side Bar from the command palette).
Actual behavior
The session opens as a new tab in the editor area, and the preferredLocation setting appears to be reset to "panel" as a side effect, undoing the user's preference.
Workaround
Use Ctrl+Shift+P → Claude Code: Open in Side Bar each time.
Root cause (from extension source)
The extension registers a claude-vscode.editor.openLast command that correctly checks getPreferredLocation() and routes to the sidebar when set. However, the sessions list view (claudeVSCodeSessionsList) appears to invoke claude-vscode.primaryEditor.open or claude-vscode.editor.open directly — bypassing the preference check — and the non-active-column path calls setPreferredLocation("panel"), actively overwriting the user's setting.
(asking AI i see two different sidbar views
<img width="571" height="483" alt="Image" src="https://github.com/user-attachments/assets/5d75091c-4ae2-42e1-a691-b5c53b6b29c0" />
<img width="564" height="995" alt="Image" src="https://github.com/user-attachments/assets/c5618fb7-a8ae-4cd4-a372-2e834af8f3ea" />
Those are two separate views registered by the Claude Code extension:
Sessions list (first icon) — the session browser/manager. Shows all your conversations, lets you switch between them. This is claudeVSCodeSessionsList.
Claude chat (second icon) — the actual conversation interface. This is the sidebar-embedded chat view (claudeVSCodeSidebarSecondary), which is what opens when you use Ctrl+Shift+P → Claude Code: Open in Side Bar.
The intended workflow is:
Use the sessions list to pick which conversation you want
The chat view then loads that conversation in the chat panel
The bug you found is exactly the disconnect — clicking a session in the first panel should load it into the second panel (sidebar chat), but instead it opens a new editor tab. They're not wired together correctly when preferredLocation is sidebar.
@Cade-Rasmussen @Finrod927 I also ran into this issue and upvoted. But in the meantime, you can use
/resumein your current claude chat, in the sidebar, and it will provide a dropdown of old conversations you can select to resume there instead of in a new editor tabStill wanted as of extension 2.1.228 (VS Code 1.132). Adding a root-cause trace in case it helps someone pick this up - the change looks well contained.
Cause
The sessions list in the activity bar sends an
open_in_editorrequest to the host. The host then callsclaude-vscode.editor.openwithViewColumn.Active. This path does not readclaudeCode.preferredLocation. Onlyclaude-vscode.editor.openLastreads that setting. The status bar item also reads it, but only to set its first visibility.The New session button at the top of the same list sends the same request. Therefore, that button also ignores the setting. It always opens an editor tab.
No command can do this task from outside the extension. The
claude-vscode.sidebar.opencommand accepts no arguments. Therefore, it can show the sidebar, but it cannot load a selected session. Issue #40169 asks for a command that accepts a session ID.Why the change is small
The sidebar can already load a session into the current view. The session history menu in the chat header does this. It does this when the surface does not use the open-in-tab mode.
The host needs only a method to send a session to that surface. There are three steps:
preferredLocationhas the valuesidebar. As an alternative, add aclaude-vscode.openSessionInSidebarcommand that accepts a session ID. This alternative also closes issue #40169.Two conditions to remember
openNewInTabis false. If you do not do this, a click on New session opens a new tab in each open Claude editor tab. That click sends no session ID.remote:prefix on the current path. These sessions need the teleport function.Test result
I verified this shape by patching my local install - session-list clicks now load into the secondary sidebar, and nothing else changed behavior. Happy to test a real build.