The VS Code folder vs workspace difference is scope: a folder is a directory on disk, while a workspace is the collection of one or more folders open in a VS Code window, together with workspace-specific settings and saved editor state.
Opening one folder is already a single-folder workspace. You only need a .code-workspace file when you want to save a workspace configuration, especially one containing multiple root folders.
| Choice | Folder opened directly | .code-workspace file |
|---|---|---|
| Root folders | One | One or more |
| Workspace settings | .vscode/settings.json | settings section in the workspace file |
| Folder-specific settings | Not a separate scope | .vscode/settings.json in each root folder |
| Best fit | A normal single project | Related projects or reusable workspace views |
How a single-folder workspace works
Open a folder with File > Open Folder. VS Code treats it as a workspace automatically. You can configure settings, tasks, and debugging without any extra file.
Workspace settings live in .vscode/settings.json at the folder root. Commit only settings that are safe and useful for everyone on the project.
VS Code also remembers state such as open files and editor layout. Reopening the folder restores that workspace state without requiring a workspace file.
How a saved workspace works
A saved workspace is a .code-workspace JSON file. It lists folders plus optional workspace settings, extension recommendations, tasks, and launch configurations.
Minimal example:
{
"folders": [
{ "path": "./frontend" },
{ "path": "./backend" }
]
}Open it with File > Open Workspace. Both folders appear as root entries in the File Explorer, and the workspace file name appears there. In File > Open Recent, saved workspaces have a (Workspace) suffix that distinguishes them from folders.
Workspace files support relative paths, which makes them portable when teammates keep the same relative folder layout. Folders elsewhere on disk may require absolute paths.
Choose the right workspace type
Use a simple folder for single projects and self-contained directories. Commit the .vscode folder to share settings with your team. This covers most day-to-day development.
Use a workspace file for multiple related projects. You can also create separate workspace files that expose different folder views or workspace-wide configurations for the same codebase.
Save or discard an untitled workspace
Adding a second folder creates an untitled workspace. It remains available while that VS Code instance is open. When you completely close the instance, VS Code asks whether to save the workspace if you want to reopen it later.
Use File > Save Workspace As to create a permanent .code-workspace file. If you close the untitled workspace without saving, VS Code asks whether to save it before deletion.
Saving a workspace does not delete the existing .vscode folder. In a multi-root workspace, applicable settings there remain folder-specific, while global workspace settings are stored in the .code-workspace file.
To work with multiple folders at once, see how to create and use a multi-root workspace.
Workspace Trust
Both folders and workspace files use the same Workspace Trust boundary. When VS Code asks whether you trust unfamiliar code, leave it in Restricted Mode until you have inspected the authors and contents.
Restricted Mode disables or limits features that can execute code, including tasks, debugging, the terminal, workspace settings, AI agents, and some extensions. Trust the workspace only after reviewing its files and authors.
Rune AI
Key Insights
- Opening a folder makes it a single-folder workspace.
- A .code-workspace file can list one or more root folders.
- Single-folder settings live in .vscode/settings.json.
- Multi-root workspace settings live in the .code-workspace file.
- VS Code asks before discarding an unsaved untitled workspace.
Frequently Asked Questions
Do I need a .code-workspace file for every project?
Can I save an open folder as a workspace?
What happens to folder settings in a multi-root workspace?
Conclusion
Open a folder for a normal single-project workflow. Use a saved .code-workspace file when one VS Code window must contain multiple roots or reusable workspace-wide configuration.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.