How to Change Projects in VS Code: Folders, Workspaces, and Switching Explained
Visual Studio Code doesn't use traditional "project files" the way older IDEs do. Instead, it organizes work around folders and workspaces — a flexible system that's powerful once you understand it, but genuinely confusing for newcomers who expect a simple "open project" button. Here's how switching between projects actually works.
What VS Code Considers a "Project"
VS Code treats a folder as the basic unit of a project. When you open a folder, VS Code loads its files, applies any settings stored in that folder's .vscode directory, and activates relevant extensions. There's no proprietary project file managing this — just the folder itself.
A workspace is one level up. A .code-workspace file lets you bundle multiple folders into a single named session, with shared settings and a unified sidebar. This matters for monorepos or full-stack projects where your frontend and backend live in separate directories.
Understanding this distinction is the first step, because "changing projects" can mean two different things depending on your setup.
Method 1: Open a New Folder Directly
The most straightforward way to switch projects is to open a different folder:
- File → Open Folder (Windows/Linux) or File → Open… (macOS)
- Use the keyboard shortcut Ctrl+K Ctrl+O (Windows/Linux) or Cmd+K Cmd+O (macOS)
This replaces your current workspace with the selected folder. VS Code will prompt you to open it in the same window or a new one. Choosing same window closes the current project; choosing new window keeps both open simultaneously.
Method 2: Use Recent Folders from the File Menu
VS Code keeps a history of recently opened folders and workspaces. Access it via:
- File → Open Recent
- Or the shortcut Ctrl+R (Windows/Linux) / Cmd+R (macOS), which opens a quick-pick list
This is the fastest method when you're cycling between a handful of known projects. The list is persistent across sessions, so your frequently used directories stay accessible without navigating your file system each time.
Method 3: Switch Using the Command Palette
The Command Palette (Ctrl+Shift+P / Cmd+Shift+P) is where most VS Code power users live. Type any of the following:
Open Folder— browse to a new project directoryOpen Recent— same as the File menu shortcutOpen Workspace from File— load a saved.code-workspacefile
The Command Palette is especially useful if you're already deep in an editing session and don't want to reach for the menu bar.
Method 4: Open and Switch Workspaces 🗂️
If you've saved a multi-root workspace (File → Save Workspace As…), switching to it is as simple as double-clicking the .code-workspace file in your file explorer, or using File → Open Workspace from File.
Workspaces remember:
- Which folders are included
- Window layout and open tabs (partially, depending on settings)
- Workspace-level
settings.jsonoverrides - Recommended extensions for that project
For developers juggling multiple clients or codebases, saving named workspaces is a significant time saver over re-opening folders manually.
Method 5: Use the Explorer or Integrated Terminal
If you already have VS Code open with a terminal running, you can navigate to a new project directory using cd and then type:
code . This opens the current terminal directory as a new VS Code window. It's a common workflow for developers who prefer the command line and works reliably across Windows (with VS Code in PATH), macOS, and Linux.
Variables That Affect How This Works for You
Switching projects in VS Code isn't universally identical — a few factors shape the experience:
| Variable | How It Affects Project Switching |
|---|---|
| Single vs. multi-root workspace | Multi-root setups require workspace files, not just folders |
| Extension profiles | VS Code Profiles (added in v1.75) let you load different extension sets per project type |
| Settings sync | If Settings Sync is on, your preferences follow you; local .vscode overrides can conflict |
| OS and PATH configuration | The code . terminal command only works if VS Code is added to system PATH |
| Remote development | Projects on SSH, WSL, or containers need the relevant Remote extension and switch differently |
How Different Developer Setups Change the Experience 💻
A solo developer working on a few personal projects will likely use Recent Files and folder opens exclusively — the built-in workflow handles this with minimal friction.
A freelancer or agency developer managing multiple client codebases benefits from saved .code-workspace files organized by client, potentially combined with VS Code Profiles to load only relevant extensions per project type (e.g., PHP tools for one client, React tooling for another).
A team working in a monorepo often keeps a single multi-root workspace open and rarely "switches" projects in the traditional sense — the sidebar surfaces all packages simultaneously, and switching is more about navigating within the workspace than replacing it.
Developers using remote environments (SSH servers, WSL, Docker containers) find that project switching involves reconnecting to a remote host first, which adds a layer the Remote Development extension suite manages — but it's a meaningfully different flow than local folder switching.
What Gets Preserved When You Switch
By default, VS Code does not restore your exact tab layout when you reopen a folder, though recently opened files will reappear. The Restore Windows setting (window.restoreWindows) controls whether VS Code reopens your last session on launch. If you want tabs to persist per-project, enabling workspace-specific settings and using the workspace file format gives you more reliable restoration.
The right approach to switching projects depends heavily on whether you're working locally or remotely, how many projects you're actively maintaining, and whether you need extension sets to change between them — all of which vary considerably from one developer's setup to the next.