Managing Fragmented Projects with VS Code Multi-Root Workspaces
VS Code’s Multi‑Root Workspaces let you keep unrelated repositories open in one window, overriding global settings per session and keeping terminal context per folder.
25 Apr 2026, 07:54 UTC

The Problem: The 'Too Many Windows' Fatigue
When working on a full-stack application or a set of microservices, you often face a dilemma: open each repository in its own VS Code window, or move everything into one giant parent folder. The first approach leads to a cluttered taskbar and constant window-switching. The second approach—creating a 'meta-folder'—often breaks relative paths, messes up Git root detection, and forces you to deal with a massive, irrelevant file tree in your explorer.
The solution is Multi-Root Workspaces. This feature allows you to group unrelated directories into a single logical session without changing their physical location on your disk. The key takeaway is that a workspace is not a folder; it is a configuration file that tells VS Code how to treat a collection of folders as a single unit.
How Multi-Root Workspaces Differ from Folders
In a standard VS Code setup, you open a folder, and that folder is the root. In a Multi-Root Workspace, you have a .code-workspace file. This JSON file acts as the orchestrator for your session.
- Independent Git Roots: Each folder maintains its own
.gitdirectory. VS Code's Source Control view will show separate sections for each repository, allowing you to commit to the frontend and backend independently. - Scoped Settings: You can define settings that apply only to that specific workspace, overriding your global User settings without modifying the
.vscode/settings.jsoninside the project folders themselves. - Context-Aware Terminals: When you open a new integrated terminal, VS Code asks which root folder you want the terminal to start in, preventing the need to
cdacross your hard drive.
Practical Implementation: The Shared Configuration
To set this up, open your first project folder normally. Then, go to File > Add Folder to Workspace... and select your second project. To make this persistent, select File > Save Workspace As... to create your .code-workspace file.
Consider a scenario where you have a /backend (Python) and a /frontend (TypeScript) folder. You want the backend to use a specific Python interpreter and the frontend to use a specific ESLint rule, but you want both to share a specific theme and font size for this project only.
{\n \"folders\": [\n { \"path\": \"projects/api-server\" },\n { \"path\": \"projects/web-client\" }\n ],\n \"settings\": {\n \"editor.fontSize\": 14,\n \"files.autoSave\": \"onFocusChange\"\n }\n}
In this configuration, the settings block applies to every folder in the workspace. However, if projects/api-server has its own .vscode/settings.json, those local settings will take precedence over the workspace settings, which in turn take precedence over your global User settings.
Search and Navigation Across Roots
One of the most useful aspects of this setup is the Search functionality. By default, Ctrl+Shift+F (or Cmd+Shift+F) searches across all folders currently in the workspace. This is invaluable for tracing a variable name from a backend API response through to the frontend consumption logic.
If the noise is too high, you can right-click a specific folder in the Explorer and select Find in Folder... to restrict the search scope to just that root.
Trade-offs and Extension Limitations
- Relative Path Resolution: Some extensions resolve paths relative to the first folder added to the workspace rather than the folder containing the file. If you notice a plugin failing to find a config file, check if it is \"workspace-aware.\"
- Extension Conflicts: Certain language servers may struggle when multiple folders contain the same configuration file (e.g., two different
tsconfig.jsonfiles). In these cases, ensure each folder is a clean root with its own isolated configuration.
Verification Check
To verify your workspace is functioning correctly: 1. Open your .code-workspace file. 2. Add a unique setting (e.g., \"editor.cursorStyle\": \"underline\") to the settings block. 3. Save the file and check if the cursor style changes across all open files in that session. If it does, your workspace override is active.
Closing Action
If you are currently managing three or more windows for a single project, try the Add Folder to Workspace workflow. Save the resulting .code-workspace file in a shared location, and you can relaunch your entire multi-repo environment with a single click.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.