PuppyIP Resource Center
AI Coding Tools 8 min Published 2026-10-02

VS Code multi-folder and remote agents: 1.140 settings, worktrees and permission boundaries

When one task spans multiple repositories or agents need to run on different machines, identify each chat’s host, directory and permissions before deciding whether to create a worktree.

VS Code Agent Host Multi-folder sessions Remote agents Git worktree

Service eligibility and regional restrictions

PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.

Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.

Key Takeaways

  • VS Code 1.140 Stable was released on September 30, 2026. GitHub’s October 1 monthly roundup covers several September releases and does not mean these features first launched that day.
  • Multi-folder sessions are experimental and disabled by default. Enable multiRootEnabled for the chosen harness in user settings.json; the setting applies to new sessions.
  • Each chat can use its own directory or worktree. Chats using the same directory still share terminal, changes and other state.
  • Remote-delegation tools are disabled by default and available only in the Agents window. The target host must already be connected, with an existing trusted repository directory. The tools do not automatically clone or copy the source workspace.
  • Worktrees separate code changes but are not a security boundary. Symlinks to ignored directories send modifications back to the original checkout.

Separate chat relationships, execution hosts and code directories

The 1.140 release notes mark Multi-folder sessions, Remote delegation and Shared worktree folders as Experimental. These respectively control which directory a chat uses, which machine runs a task and how worktrees reuse ignored folders. Enabling one does not automatically enable the others or grant account permissions.

A main chat can create peer chats for related work, while independent deliverables can use independent sessions. Specify the directory when repository files are needed, and explicitly request a Git worktree when code changes need separation. These multi-folder agent sessions differ from ordinary editor multi-root workspaces. VS Code Agent Host Codex, the OpenAI Codex extension and the desktop app should also not be treated as the same entry point.

Step one: enable multi-folder sessions for the chosen harness

First use VS Code’s Check for Updates to verify the installed version. Open user-level settings.json and set the relevant setting to true: <code>chat.agentHost.copilotAgent.multiRootEnabled</code> for Copilot, <code>chat.agentHost.claudeAgent.multiRootEnabled</code> for Claude, or <code>chat.agentHost.codexAgent.multiRootEnabled</code> for Codex. These experimental settings are disabled by default and do not appear in the Settings editor.

Then create a new session. The official guidance says new sessions read the setting without restarting Agent Host. There is currently no dedicated UI for adding directories or choosing a peer chat’s directory, so state the target repository or worktree in the main chat request. For example, first request read-only API analysis in repository A, then a peer chat in repository B to inspect usage. If both chats need to modify the same repository independently, explicitly request separate new worktrees. Do not use automatic migration of an existing session as the success criterion.

Step two: confirm the directory each chat actually uses

Each chat’s terminal, tasks, changes, pull request and Agent merge state belong to its directory. Chats using the same directory share those states. Hovering over a session shows a summary of all directories, while hovering over a nested chat shows that chat’s directory details. Verify this information before permitting file writes.

For the first request, ask the agent only to report its current directory, repository, branch and intended files, without making changes. Compare the result with the requested target. If isolation is needed, the two chats should point to different worktrees. Creating two chats alone does not guarantee isolation. Peers sharing a checkout suit read-only research or review; editing tasks need explicit file ownership.

Step three: connect the remote host before specifying its workspace

Remote delegation in the Agents window requires enabling <code>chat.remoteAgentHostsEnabled</code> and <code>chat.remoteSessions.tools.enabled</code>, then connecting the intended host. Remote tools are disabled by default. <code>list_agent_hosts</code> lists hosts, models, resource capacity and session load. <code>create_remote_session</code> can target a host explicitly or select one matching an operating system, minimum memory, logical CPU count and optional model.

A remote session without a specified workspace has no repository directory. Repository work must use an existing trusted directory on the target host, either directly or through a new Git worktree. The tool does not automatically clone or copy the source workspace, and normal approvals still apply. Have the remote agent report its host and directory first, then confirm the files actually exist. Do not mistake a local path for a remote path.

Keep the coordinating Agents window open and connected. Use <code>get_remote_session</code> to read status and the latest response; the remote agent reports results through <code>send_remote_message</code>, since final responses are not forwarded automatically. This article did not test host registration, cross-account authorization, network reliability or specific plan charges. Follow official remote-host documentation and organizational configuration for actual connection steps.

Check worktree starting points and permissions separately

The official harness documentation says a new worktree starts from the committed Git state of the selected base branch. By default, it does not include uncommitted tracked changes, untracked files or ignored content such as .env and dependencies from the current checkout. If the task relies on uncommitted files, specify how they will be supplied or choose the current Folder.

Worktrees isolate code changes, not command, network or filesystem permissions. The general official guidance says Worktree sessions use Allow all, while Folder-session approval options depend on the harness. Review the current entry point’s permission notice before choosing a worktree, and consult official sandboxing configuration when system-level restrictions are needed. Normal approvals for remote delegation should not be read as a promise that every worktree will ask on each operation.

Reusing ignored folders: symlinks share modifications

<code>git.worktreeIncludeFiles</code> copies specified ignored files into a new worktree. The experimental <code>git.worktreeSymlinkFolders</code> instead creates symlinks to ignored folders in the current checkout that match .gitignore-style patterns, such as node_modules. The release notes do not give a default value for this setting, so do not assume it is automatically enabled.

A symlink is not an independent copy. Files changed by an agent through the link affect the corresponding folder in the original checkout. Do not share these as if they were isolated directories when independent dependency versions, build outputs or writable caches are needed. Confirm link targets first and validate them through read-only checks. If unexpected writes reach the original directory, stop the relevant writes and inspect those changes. Deleting the worktree alone does not establish that the effects have been reversed.

If a feature is missing or a task does not report back

Check the version, chosen harness, whether settings use user scope, whether a new session was created, whether the target host is connected and whether its trusted directory exists, in that order. Multi-folder settings being absent from the Settings editor is documented behavior. A remote final response not being forwarded automatically also does not mean the task failed; use status tools to check actual progress. If experimental features change or organizational policy disallows them, retain the existing workflow and check official documentation instead of loosening permissions to experiment.

If actual proxy-connection, 407 or certificate-chain errors occur, use the Copilot enterprise proxy and CA troubleshooting guide to investigate the network layer. Network egress cannot enable experimental settings, create remote directories or replace subscriptions and organizational authorization.

Sources

Frequently Asked Questions

Are VS Code 1.140 multi-folder sessions enabled by default?

No. They are experimental and disabled by default. Set the harness-specific multiRootEnabled setting to true in user settings.json, then create a new session.

Do two peer chats automatically use separate worktrees?

Do not assume so. Each chat can use its own directory, but chats pointing to the same directory still share state. Explicitly request separate worktrees for isolated changes and verify the actual directories.

Will a remote agent copy the local repository?

The source workspace is not automatically cloned or copied. The target host needs an existing trusted directory. A remote session without a specified workspace has no repository directory.

Will a remote task’s final response automatically return to the main chat?

It is not forwarded automatically. Keep the coordinating Agents window open and connected, inspect status with get_remote_session and have the remote agent report through send_remote_message.

Can Git worktrees restrict an agent’s network and file permissions?

Worktrees separate code changes and are not a security boundary. The general official documentation says Worktree sessions use Allow all. Check approvals and system-level isolation against the current harness and sandboxing configuration.

Does git.worktreeSymlinkFolders create independent dependency copies?

No. It creates symlinks to matching ignored folders in the original checkout. Writes through those links affect the original folders. Avoid sharing when independent writable dependencies or build outputs are required.