This repository was archived by the owner on May 20, 2026. It is now read-only.
Repository navigation
Support empty and multi-root workspaces - #3139
Merged
Merged
Conversation
The issue was the content provider loading from the wrong path. This is easy for the empty workspace case - even the terminal uses process.cwd. But for multi-root it's more of a "best we can do" case because ideally we'd load chats from a different place than the`cwd`-influenced .. and instead be tied to the code-workspace file... but this was a decent compromise for now.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Claude Code session storage/loading behavior to work more reliably when there is no workspace folder open (empty workspace) and when there are multiple workspace roots, avoiding loading from an incorrect path.
Changes:
- Adjusted session discovery to use a
'-'“no-project” directory for empty and multi-root workspaces. - Updated Claude Code SDK session startup to set
cwdonly for single-root workspaces and pass workspace roots viaadditionalDirectories. - Added unit tests covering session loading for no-workspace and multi-root workspaces.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/extension/agents/claude/node/test/claudeCodeSessionService.spec.ts | Adds coverage for empty-workspace and multi-root session loading behavior. |
| src/extension/agents/claude/node/claudeCodeSessionService.ts | Changes project directory selection logic for session loading (single-root vs empty/multi-root). |
| src/extension/agents/claude/node/claudeCodeAgent.ts | Changes SDK Options construction for cwd and additionalDirectories to better support empty/multi-root workspaces. |
Connor Peet (connor4312)
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue was the content provider loading from the wrong path. This is easy for the empty workspace case - even the terminal uses process.cwd.
But for multi-root it's more of a "best we can do" case because ideally we'd load chats from a different place than the
cwd-influenced .. and instead be tied to the code-workspace file... but this was a decent compromise for now.Fixes microsoft/vscode#290242