Opening the project folder you want to work on
To change projects in VS Code, you open a different folder. VS Code treats each folder as a separate project, so switching projects means closing the current folder and opening a new one. The simplest way is to go to File in the menu bar, click Open Folder, navigate to the folder where your project lives, and click Select Folder.
When you open a new folder this way, VS Code closes the previous project and loads the new one. All your files from the old project disappear from the sidebar, and the new project's files take their place. Your settings, extensions, and terminal stay the same — only the files you see change.
If you have unsaved changes in the old project, VS Code will ask you to save them before switching. You can save, discard, or cancel the switch entirely from that dialog.
Key Takeaways
- Open a new project by clicking File, then Open Folder, then selecting the folder that contains your project files.
- VS Code closes the previous project automatically when you open a new one, but warns you if you have unsaved changes.
- You can open multiple projects in separate VS Code windows at the same time by holding Ctrl (or Cmd on Mac) while selecting folders.
- The File menu also shows your recent projects, so you can switch back to a project you worked on before without navigating the file system.
- Workspaces let you save a group of related projects together so you can open them all at once instead of one at a time.
Using the recent projects list to switch faster
VS Code keeps a list of projects you have opened recently. Click File, then look for Open Recent — you will see a submenu with folder names. Click the project name to open it when ready. This is faster than navigating through your file system every time.
The recent list shows the last 10 to 20 projects, depending on how many you have opened. If a project is no longer on your computer, VS Code will show it in the list but tell you the folder does not exist when you click it. You can remove a project from the recent list by right-clicking its name and selecting Remove from Recent.
Opening multiple projects in separate windows
Sometimes you need to work on two projects at the same time — comparing code, copying files between them, or testing how they interact. You can open a second project in a new VS Code window instead of replacing the current one.
Click File, then Open Folder. Navigate to the second project folder. Before you click Select Folder, hold down Ctrl (on Windows or Linux) or Cmd (on Mac). Click Select Folder while holding the key. VS Code opens the second project in a new window, and your first project stays open in the original window.
You can now see both projects side by side on your screen, or switch between them by clicking each window. Each window has its own terminal, file explorer, and settings, so you can work on both projects independently.
Using workspaces to manage multiple projects together
A workspace is a saved collection of project folders. Instead of opening projects one at a time, you can save a workspace that remembers which projects you want to work on together, and open them all at once.
To create a workspace, open all the projects you want to group together in separate windows. Then click File, then Save Workspace As. Give the workspace a name and choose where to save it. VS Code saves a small file that remembers which folders you had open.
The next time you want to work on that group of projects, click File, then Open Recent, then Workspaces. Click the workspace name, and VS Code opens all the folders in separate windows automatically. This saves time if you always work on the same set of projects together.
Switching projects when you have unsaved changes
If you try to open a new project and you have unsaved changes in the current one, VS Code shows a dialog asking what you want to do. You have three choices: Save saves your changes and then switches projects, Don't Save throws away your changes and switches anyway, and Cancel keeps the current project open.
If you are not sure whether you want to keep your changes, click Cancel and review your work first. You can see what you changed by clicking the file name in the sidebar — unsaved files show a dot next to their name. Once you decide what to keep, you can switch projects without losing work you wanted to save.
Finding your project folder if you are not sure where it is
When you click File and Open Folder, a file browser window opens. If you do not remember where your project folder is, you can search for it. Look for a search box in the file browser — the exact location depends on your operating system, but it is usually near the top.
Type the project folder name and the browser will show matching folders. Once you find the right one, click it and then click Select Folder. If you still cannot find it, check with whoever gave you the project — they can tell you the full path to the folder, which you can paste into the file browser's address bar.
Keeping your settings when you switch projects
Your VS Code settings — like font size, color theme, and extensions — stay the same when you switch projects. You do not have to reconfigure anything each time you open a different folder.
However, some settings can be project-specific. If you want different settings for different projects, you can create a .vscode folder inside your project folder and add a settings.json file there. VS Code will use those settings only when that project is open. This is useful if one project needs a different indentation style or a different linter than another project.
Frequently Asked Questions
Can I have the same project open in two VS Code windows at the same time?
Yes, but VS Code will warn you that the same folder is open in multiple windows. This can cause problems if you edit the same file in both windows at the same time, because the changes might conflict. It is safer to use separate windows for different projects instead.
What happens to my terminal when I switch projects?
The terminal stays open and keeps running. If you were running a command in the old project, it keeps running even after you switch to a new project. You can open a new terminal in the new project by clicking Terminal in the menu bar, then New Terminal.
How do I remove a project from the recent list?
Click File, then Open Recent. Right-click the project name you want to remove and select Remove from Recent. The project stays on your computer — it just disappears from the list in VS Code.
Can I rename a workspace after I create it?
VS Code does not have a built-in rename function for workspaces. To rename one, you have to save the workspace with a new name, then delete the old workspace file from your file system. The workspace file is usually a small text file with a .code-workspace extension.
What is the difference between opening a folder and opening a workspace?
Opening a folder opens a single project. Opening a workspace opens multiple folders at once, all in separate windows. Use a folder when you are working on one project, and use a workspace when you regularly work on the same group of projects together.