Multi-root workspaces
A multi-root workspace holds several folders in one window, for example a frontend, a backend and a shared library. Search, Code Intelligence, Agent Memory and the agents see all of them, and each folder keeps its own index and settings.
When to use it#
Use a multi-root workspace when one task spans several repositories or folders that are not nested in each other. If the folders are unrelated, open them in separate windows instead: each window has its own folders, extensions, language servers and terminals.
Add folders#
- Open the first folder Open a folder as usual. It becomes the primary folder.
- Add more folders Choose File ▸ Add Folder to Workspace… and pick another folder. Each folder appears in the Explorer under its own header.
- Save the workspace
Choose File ▸ Save Workspace As… to write a
.code-workspacefile. Open it later with File ▸ Open Workspace from File…. - Pick the primary folder Right-click a folder header and choose Set as Primary Folder. The primary folder is marked with a star.
A folder cannot be inside another folder of the same workspace, and a folder can be open in only one window at a time. Opening a folder that another window already has focuses that window.
The .code-workspace format is the one VS Code uses: folders by path or uri, comments allowed. Paths are written relative to the file when the folders are close to it. IZ Code stores the primary folder in the file's settings as izcode.workspace.primaryFolder. If a folder in the file cannot be opened, IZ Code tells you and opens the others.
Recent projects remember a multi-root workspace as one entry and reopen the whole set.
Primary folder and active folder#
| Concept | What it is | Used for |
|---|---|---|
| Primary folder | The folder you chose with Set as Primary Folder (the first folder if you didn't choose). Kept across restarts. | Workspace settings, the window title (primary (+N)), the working directory of new chats, workflows, the browser's site data, and where extensions run. |
| Active folder | The folder of the file you are editing (the primary folder if no file is open). | Git status in the status bar, the default Code Intelligence folder, which launch.json opens. |
| All folders | Every folder in the window. | Search, Quick Open, agent code and memory tools, tasks, project instructions. |
Removing or reordering the other folders does not change the primary folder.
flowchart TD
subgraph win["One window"]
P["api (primary)"]
W[web]
S[shared]
end
P --> PS["Settings, new chats, extensions"]
win --> AL["Search, agents, tasks"]What works across folders#
- Explorer, Quick Open, Search, breadcrumbs, diffs and tabs label each path with its folder when there is more than one. Two folders with the same name are told apart by their parent folder. Copy Relative Path includes the folder name.
- Code Intelligence keeps one index per folder. The scope picker shows every folder at the top level, and search has an All folders option that merges results. See Code Intelligence.
- Agents can read and edit files in every folder of the window. They are told the workspace has several folders, receive each folder's
AGENTS.md,CLAUDE.mdor.izcode/instructions.mdunder its own heading, and their code and memory searches cover all folders (or one folder when asked). File mentions show the folder:@file:api/format.ts. - MCP servers from each folder's
.vscode/mcp.jsonare merged. If two folders define a server with the same name, the primary folder's wins. - Agent Memory: wiki pages and skills stay in the folder they came from; conversation memory is stored in the primary folder of the session. See Agent Memory.
- Run and debug: each folder has its own
launch.json, and${workspaceFolder}resolves per folder. Tasks from every folder'stasks.jsonare listed; a task withoutcwdruns in its own folder. See Run and debug. - Terminals follow the folder they were opened in. A terminal whose folder was removed is labelled (folder removed).
- Settings for Code Intelligence and Agent Memory let you pick which folder you are configuring.
Windows#
Each window is a separate workspace with its own folders, extension host, language servers and terminals.
- File ▸ New Window opens an empty window. Open Folder in New Window… opens a folder in one.
- Right-click a folder header and choose Move Folder to New Window to split a folder off into its own window.
- Closing a window while others stay open drops its workspace. Quitting the app, or closing the last window, keeps everything for the next start.
- Launching IZ Code again from the command line or the dock hands the folders to the running app instead of starting a second copy.
On startup IZ Code reopens your windows according to Settings ▸ General ▸ Startup ▸ Window Restoration.
Local and remote folders together#
A window can hold local folders and folders on an SSH host side by side. The Explorer, file editing, Git, terminals and agents work in every folder. Extensions, tasks, debugging and language servers run either locally or on the remote host, depending on where the primary folder is. Folders on the other side show a files only badge. To get full features for such a folder, make it the primary folder or use Move Folder to New Window.
Remote folders are not stored with passwords. After a restart, IZ Code reconnects them in the background using ssh-agent or a key without a passphrase. Folders that need a password show a banner with Reconnect and Forget. See Remote over SSH.
Settings#
| Setting | Values | Default |
|---|---|---|
izcode.window.restoreWindows (Window Restoration) | all (Reopen all windows), one (Reopen the last window only), none (Start with an empty window) | all |
izcode.remote.autoReconnect (Reconnect remote folders on startup) | true, false | true |
izcode.workspace.primaryFolder | folder path, in the .code-workspace file | first folder |
Tips and limits#
Related#
One index per folder, searched together.
IndexRemote over SSHOpen folders on another machine.
SSHWorkspace TrustWhat happens when you add an untrusted folder.
Trust