TechBuzzPro

VS Code Open Multiple Folders: How-To Guide

· 6 min read · Apps & Browsers

In this article
  1. What a Multi-Root Workspace Is
  2. How to Add a Folder to the Current Window
  3. How to Save and Reopen the Workspace
  4. What You Can Do with Multiple Folders
  5. How to Choose Between Multiple Folders and Separate Windows
  6. Common Problems and Fixes
  7. Alternatives to Multi-Root Workspaces
  8. Frequently Asked Questions

Yes, Visual Studio Code can open multiple folders in a single window, and the feature is called a multi-root workspace. You add folders to the current window through the File menu, and the folders appear as separate top-level items in the Explorer sidebar. This guide explains the two ways to do it, how to manage the workspace file it creates, and how to fix common issues.

What a Multi-Root Workspace Is

By default, VS Code opens one folder at a time. That single-folder mode is what most people use for a single project. A multi-root workspace is a different mode: instead of one folder, the window holds two or more folders, each shown as its own root in the Explorer. The folders keep their own settings, but you can search across all of them, run tasks from any of them, and share one set of workspace-level settings.

The workspace is saved as a .code-workspace file, which is a JSON file that lists the folders. You can store that file anywhere, even outside the folders it references. When you open the file, VS Code restores the same set of folders.

How to Add a Folder to the Current Window

The quickest way to open multiple folders is to add them one at a time to the same window. The exact menu label depends on your operating system and VS Code version, but the action is consistent.

  1. Open VS Code and start with any window (empty or with a folder already open).
  2. Go to File > Add Folder to Workspace… (on macOS it is under the File menu as well).
  3. In the file picker, select the folder you want to add and click Add.
  4. Repeat for each additional folder.

After the first add, VS Code switches the window to workspace mode. You will see the folders listed in the Explorer, each with its own name. The title bar shows the name of the workspace (often “Untitled (workspace)”) instead of just the folder name.

How to Save and Reopen the Workspace

Once you have added all the folders, you should save the workspace so you can reopen it later without re-adding folders.

  1. Go to File > Save Workspace As….
  2. Choose a location and a name for the .code-workspace file.
  3. Click Save.

To reopen the workspace later, use File > Open Workspace from File… and select the .code-workspace file. You can also double-click the file in your operating system’s file explorer, provided VS Code is associated with that extension. The workspace file is plain JSON, so you can also edit it manually to add or remove folders—each folder is an object with a path property.

What You Can Do with Multiple Folders

Once you have a multi-root workspace, most features work across all folders:

  • Search – Ctrl+Shift+F (Cmd+Shift+F on macOS) searches all folders by default. You can exclude specific folders in the search input.
  • Source control – Each folder can be its own Git repository. The Source Control view shows a separate section for each repository.
  • Tasks and debug configurations – You can define tasks and launch configurations that apply to a specific folder or to the whole workspace.
  • Settings – Workspace settings (stored in .vscode/settings.json inside each folder) apply to that folder. A separate workspace-level settings file applies to all folders.
  • Extensions – Extensions are enabled per workspace. Some extensions only activate when they detect a relevant folder.

How to Choose Between Multiple Folders and Separate Windows

Multi-root workspaces are not always the best choice. Consider a few factors:

  • Related projects – If you regularly work on two or three projects that depend on each other (e.g., a frontend and a backend), a multi-root workspace lets you edit both without switching windows.
  • Independent projects – If the projects are unrelated, separate windows keep settings and extensions isolated. A workspace-level setting in one window won’t affect the other.
  • Performance – Opening many large folders in one window can slow down file watching and search. If you notice lag, consider splitting into separate windows.
  • Team sharing – A .code-workspace file can be committed to a repository so all team members open the same set of folders with the same settings.

Common Problems and Fixes

Here are frequent issues users run into and how to resolve them.

  • “Add Folder to Workspace” is grayed out. This happens when the window is already in a special mode (like a file-only window). Open a folder first, then the menu item becomes active.
  • Folders appear nested under one another. That is not possible in the default Explorer—each added folder is a separate root. If you see a folder inside another, you likely opened a subfolder instead of adding a new root.
  • Settings apply to the wrong folder. Remember that .vscode/settings.json inside a folder applies only to that folder. To set a workspace-wide setting, use File > Preferences > Settings and select the “Workspace” tab.
  • Search results are missing from one folder. Check the search input’s “files to include/exclude” patterns. Also verify the folder is not excluded by files.exclude or search.exclude in settings.
  • Git shows multiple repositories but you want a single view. That is expected. Each folder is its own repository, so the Source Control view shows them separately. You can collapse the view or use the “…” menu to focus on one.

Alternatives to Multi-Root Workspaces

If a multi-root workspace doesn’t fit your workflow, there are other ways to work with multiple folders:

  • Separate windows – Open each folder in its own window. Use the OS window snapping or a tiling window manager to arrange them side by side.
  • Symbolic links or junctions – On Windows and macOS/Linux, you can create a symlink inside a parent folder that points to another folder. Then open the parent folder, and the linked folder appears as a subfolder. This works but can confuse tools that resolve real paths.
  • Workspace file with relative paths – If you move the .code-workspace file, the folder paths are relative to the workspace file’s location. You can keep the workspace file in a shared parent directory and reference folders with ../ paths.

Frequently Asked Questions

Can I open two folders side by side in the same window?

Yes, that is exactly what a multi-root workspace does. Each folder appears as a separate top-level entry in the Explorer, and you can open files from both at the same time in the editor area. There is no built-in split of the Explorer itself, but the folders are listed one after another.

Does opening multiple folders slow down VS Code?

It can, especially if the folders contain many files (like node_modules). VS Code watches files for changes, and more folders mean more watchers. You can mitigate this by using the files.watcherExclude setting to exclude large directories from watching.

Can I have different settings for each folder in a workspace?

Yes. Each folder can have its own .vscode/settings.json that applies only to that folder. Workspace-level settings (stored in the .code-workspace file) apply to all folders. Folder settings take precedence over workspace settings.

How do I remove a folder from a workspace?

Right-click the folder in the Explorer and select Remove Folder from Workspace. The folder is not deleted from disk, only removed from the current window. You can also edit the .code-workspace file and delete the folder object.

Can I open a multi-root workspace from the command line?

Yes. Run code myworkspace.code-workspace from a terminal, and VS Code will open that workspace. You can also pass multiple folder paths, but that opens them in separate windows unless you use the --add flag with an existing workspace.

Why is my workspace file showing as a folder in the Explorer?

If you open a .code-workspace file directly (instead of using “Open Workspace from File”), VS Code may treat it as a regular file. Use the File menu command to open it as a workspace, or double-click the file if VS Code is the default handler.