windows-and-projects.md

 1---
 2title: Windows & Projects
 3description: "How Zed handles multiple projects in windows, including the threads sidebar and options for opening in new windows."
 4---
 5
 6# Windows & Projects
 7
 8Zed lets you work on multiple projects in a single window. Projects appear in the threads sidebar on the left, and you can switch between them while keeping your context intact.
 9
10## How Projects Open
11
12By default, when you open a folder in Zed, it opens as a new project in your current window's threads sidebar rather than creating a new window. This keeps related work together and preserves your agent threads and layout.
13
14| Action             | Result                                    |
15| ------------------ | ----------------------------------------- |
16| File > Open        | Opens in current window (threads sidebar) |
17| File > Open Recent | Opens in current window (threads sidebar) |
18| Drag folder to Zed | Opens in current window (threads sidebar) |
19| `zed ~/project`    | Opens in current window (threads sidebar) |
20
21## Working with Multiple Projects
22
23When you have multiple projects open:
24
25- Click a project header to collapse or expand its threads; Cmd+click (macOS) or Ctrl+click (Linux/Windows) to switch to that project
26- Each project has its own file tree, git state, and search scope
27- Agent threads are tied to their project context
28- Your workspace layout (splits, tabs) is preserved per project
29
30Think of projects in the threads sidebar like browser tabs, but for repositories.
31
32## Opening in a New Window
33
34Sometimes you want a completely separate window. Here's how:
35
36### From Open Recent
37
38When using File > Open Recent ({#kb projects::OpenRecent}):
39
40- **Enter** or **click** opens in the current window (threads sidebar)
41- **Cmd+Enter** or **Cmd+click** (macOS) / **Ctrl+Enter** or **Ctrl+click** (Linux/Windows) opens in a new window
42
43### From the CLI
44
45Use the `-n` flag to force a new window:
46
47```sh
48zed -n ~/projects/other-project
49```
50
51Other CLI options for controlling window behavior:
52
53| Flag            | Behavior                                           |
54| --------------- | -------------------------------------------------- |
55| `-n`, `--new`   | Always open in a new window                        |
56| `-a`, `--add`   | Add to the current window's threads sidebar        |
57| `-r`, `--reuse` | Replace the current project in the existing window |
58
59See [CLI Reference](./reference/cli.md) for full details.
60
61### Via Settings
62
63You can change the default CLI behavior with the `cli_default_open_behavior` setting:
64
65```json [settings]
66{
67  "cli_default_open_behavior": "new_window"
68}
69```
70
71Options:
72
73- `existing_window` (default): Open folders in the current window's threads sidebar
74- `new_window`: Open folders in a new window
75
76This setting affects CLI and double-click behavior, not the File > Open menu.
77
78## Adding Folders to a Project
79
80If you want to add a folder to your current project (not as a separate project in the threads sidebar), you have several options:
81
82- **File menu**: File > Add Folder to Project
83- **Project panel**: Right-click in the project panel and choose "Add Folders to Project"
84- **Open Recent**: Select a recent project and click the "Add Folder to this Project" button
85
86This adds the folder as an additional root in your current project's file tree, similar to VS Code's multi-root workspaces.
87
88## See Also
89
90- [Threads Sidebar](./ai/parallel-agents.md#threads-sidebar): Managing threads across projects
91- [Getting Started](./getting-started.md): Essential commands and setup
92- [VS Code Migration](./migrate/vs-code.md): How Zed's project model differs from VS Code