-
Notifications
You must be signed in to change notification settings - Fork 41.8k
Multi‐root Workspace support in Chat
When you start a Copilot, Claude, or Codex agent session from the Chat view in a multi-root workspace, the agent can work across all folders in the workspace.
However, every session uses one workspace folder as its primary directory. The primary directory is the current working directory for the agent harness. Some hooks and other provider-specific configurations are loaded only from this directory.
The primary directory is fixed after the session starts. To use a different primary directory, start a new session and select the other folder before sending your first request.
Important
Selecting a primary directory does not restrict the agent to that folder. The agent can still read and modify files in all folders in the workspace.
Consider a workspace with two folders:
my-workspace
├── frontend
│ └── .github/hooks/
└── backend
└── .github/hooks/
The following features currently depend on the primary directory:
| Agent harness | Loaded from the primary directory |
|---|---|
| Copilot | Workspace hooks from .github/hooks/
|
| Claude | Hooks from .claude/settings.json or .claude/settings.local.json, and MCP servers from .mcp.json
|
| Codex | Hooks from .codex/hooks.json, and Codex instructions and rules |
For example, if you select the backend folder as the primary directory:
- The agent can still work in both the
frontendandbackendfolders. - Only hooks from the
backendfolder are used by the session. - With Claude, only MCP servers from
backend/.mcp.jsonare loaded. - With Codex, only instructions and rules that apply to the
backendfolder are used.
Only the provider-specific configuration listed in the table is affected. For example, the Claude limitation applies to .mcp.json; MCP servers configured in .vscode/mcp.json can still be discovered from all workspace folders.
When you create a session, VS Code checks which workspace folders contain configuration that depends on the primary directory.
A folder is considered relevant when it contains the following configuration:
| Agent harness | Relevant configuration |
|---|---|
| Copilot | One or more .json hook files under .github/hooks/
|
| Claude | A .mcp.json file or enabled hooks in .claude/settings.json or .claude/settings.local.json
|
| Codex | A .codex/hooks.json file |
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Build Champion
- Release Process
- Running the Endgame
- Related Projects
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Feedback Channels
- Source Code Organization
- Coding Guidelines
- Testing
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
- Accessibility Guidelines
- Custom ESLint rules
Documentation