September 30, 2026
AI agents in VS Code no longer share one folder: each chat gets its own repository or worktree
In VS Code 1.140, chats in the same session can work in different folders, and the agent can delegate tasks to remote hosts.

Visual Studio Code
@code
🚀 The latest @code release makes it easier to work across repositories and worktrees and delegate tasks to remote agent hosts. 🧵 Here's what's new: https://code.visualstudio.com/updates/v1_140
· 4.5K views
Previously, all chats in a session shared one folder and checkout. In version 1.140, released on Sep 30, each chat can have its own repository or worktree.
A worktree is a separate working folder for the same repository. The agent can change code there independently of the current checkout.
How to give chats separate folders
A folder for each chat. Enable multi-folder sessions in your user settings.json. Set the relevant agent's setting to true:
- `chat.agentHost.copilotAgent.multiRootEnabled` - `chat.agentHost.claudeAgent.multiRootEnabled` - `chat.agentHost.codexAgent.multiRootEnabled`
Then create a new session. Ask the main chat to create a peer chat with the folder you want.
A new worktree session defaults to the current branch's upstream branch, such as origin/main. Before creating it, VS Code attempts to fetch the selected remote branch.
The experimental `git.worktreeSymlinkFolders` setting lets you reuse node_modules. It accepts .gitignore-style patterns: new worktrees receive symbolic links to matching ignored folders in the current checkout.
How to delegate a task to a remote agent
A task for another host. Experimental remote delegation sends a task from an Agent Host session in the Agents window to a connected host. To use it, enable `chat.remoteAgentHostsEnabled` and `chat.remoteSessions.tools.enabled`, then connect your hosts.
To connect over SSH:
1. Click New in the Agents window. 2. In the working folder list, select Remote, then SSH. 3. Enter `user@hostname`. 4. Select a folder and enter a prompt.
VS Code installs and starts the remote CLI automatically. The repository must already be on the target host: remote delegation uses an existing trusted folder without copying or cloning it.
The `create_remote_session` tool selects a host based on its OS, memory, logical processor count, and model. Among matching hosts, it prefers the least busy one. Example requirements from the VS Code developers: Linux, at least 16 GiB of memory, and 8 logical processors.
The Agents window must stay connected. Send the result of the remote work through `send_remote_message`.
VS Code 1.140.0 is available in Stable through Check for Updates, and installers for Windows, macOS, and Linux are linked in the release notes.
Source
