Skip to main content
A workspace is the local repository directory where your Code runs execute. It belongs to a project and contains its chat tabs, Git state, changes, and review history. A workspace can use your existing checkout or a separate Git worktree.

Create a workspace

In Code, click Add Project or press ⌘N. You can add a local repository, clone a remote URL, or initialize a new repository. From a project, you can also create another worktree. Mains groups repositories by their remote origin. The working branch is read from Git, so branch changes made outside Mains also appear in the app.

Worktree isolation

Worktrees are off by default on new installs. Set Settings → Git → Worktrees to use separate working directories for new tasks. Existing preferences are retained when you update Mains. A worktree gives you another checkout and branch while sharing repository history. Use separate worktrees when several agents may edit the same files.
Two chats in one workspace share its files. Starting another chat does not create another worktree.

Workspace tools

Status

Workspace statuses include Backlog, Todo, In Progress, In Review, Done, Canceled, and Duplicate. Use them to organize local work. A local workspace status does not automatically update the issue in your connected tracker.

Archive and restore

Archive a workspace from its menu to hide it while keeping its run and review history. Restore it from Settings → Archive. Archiving runs the project’s archive script when one is configured. It does not automatically remove the worktree. Restoring the record does not recreate a directory that a script or another tool removed.

Delete a workspace

Deletion removes the workspace record and its associated history. The delete flow can also remove a Mains-created worktree. It does not remove your original checkout through that worktree option. Use archive when you may need the history again.