Multiple Mounts
On this page
A Swarmfile engine can host more than one mount at a time, so you can work in two repositories - or two branches of one repository - side by side on the same machine, each as its own drive. This is the quick, human-facing version of the setup described for automated fleets in Coding Agents.
When to open a second mount#
- Two repositories at once - a live repository and a prep repository, or two clients you switch between all day.
- Two branches of one repository - compare a look-dev branch against main without switching the whole drive back and forth.
- An agent or script that needs its own workspace - a second mount keeps its changelists and locks separate from yours.
Each mount is a full, symmetric mount: its own branch, its own open changelists, its own lock state. Nothing you do in one changes the branch the other is on.
Opening one#
In the Desktop App, hover a repository in the left rail and click its + to open that repository as another drive, or use the + half of the mount switcher (the drive name at the top of the window), or + Open another drive… inside the switcher. Each opens the Open a drive dialog, where you pick:
- the repository (preselected when you came from a repository's +) and optionally a branch;
- an optional name so you can tell drives apart ("agent-2", "client-b") - the same thing the CLI calls a label (
--label).
Swarmfile chooses where the drive appears - the next free drive letter on Windows, and a new folder beside your main drive on macOS and Linux, named after the drive (or its branch) - and the dialog shows the exact letter or folder before you open it. To pick a specific drive letter or an empty folder of your own, open Advanced.
If a drive can't open, the dialog says why straight away - for a taken drive letter it offers the next free one - and the failed drive never becomes the current one. A drive that is slow to attach closes the dialog and shows Connecting… in the list (it can't be switched to until it's ready); Swarmfile switches to it once it's live, unless you've moved to another drive in the meantime, and a notice says how it went.
From the CLI, the same thing:
swarmfile mounts open Y: --label client-b # Windows: a drive letter
swarmfile mounts open auto --label client-b # Windows: next free letter
swarmfile mounts open ~/swarmfile/client-b --label client-b # macOS/Linux: a folder
swarmfile mounts open Y: --label dev --branch look-dev-warm # pin this mount to a branch
swarmfile mounts open Y: --label side --repository proj_… # a different repository (same org)
swarmfile mounts open ~/agent-2 --exclusive # exclusive-write mode (agent fleets)
On Windows the folder or drive letter must be free - an existing non-empty folder is refused rather than mounted over, while an existing empty folder is accepted (the app's folder picker only returns folders that already exist, so this is the normal second-mount shape). On macOS and Linux the mount point is a normal folder, and the same path can't be used by two mounts at once. See Filesystem Compatibility for the per-platform details.
Keeping two agents off the same file#
Locks protect a file against other people and machines, but two mounts of one engine share one machine identity - so by default nothing stops two agent mounts from editing the same file at the same time; the later save comes back as a conflict to resolve rather than silently winning. If you want the second writer refused at open instead (and the file protected from rename, delete or atomic-save replace while it's open), open each agent's mount with --exclusive:
swarmfile mounts open ~/agent-1 --exclusive --label agent-1
swarmfile mounts open ~/agent-2 --exclusive --label agent-2
Exclusive-write mode is opt-in per mount. While one exclusive mount has a file open for writing, another exclusive mount on the same repository+branch has its write-open refused - with EAGAIN on macOS and Linux, and on Windows with the sharing violation apps report as "file in use" - and a rename, delete, or atomic-save replace of that file is refused too, so the holder's file can't be moved, replaced, or removed out from under it.
The refusal is recorded (with the holding mount) in the tray's blocked-writes view and in swarmfile status. Closing the file - or finishing its save - releases the claim. A mount opened without --exclusive neither takes nor honors claims, so your human drive and non-exclusive mounts behave exactly as before; the protection is between the mounts that opted in.
In the desktop app the same option is the Prevent another drive from editing a file this one has open checkbox under Advanced in the Open a drive dialog, and an exclusive drive carries a lock badge in the drive list. Like the flag, it is fixed when the drive opens - close and reopen the drive to change it.
Same dialog, one field down: Conflict handling pins this drive's conflict mode - the per-drive form of mounts open --conflict-mode (CLI reference). Leave it on the repository setting unless the drive is an automated writer, which needs a refused save to fail its fsync (Linux also the close-time flush; Windows FlushFileBuffers - a macOS close() cannot carry the error by design): Hard: fail the save makes that call return a stale-version error instead of parking the conflict for later resolution, so the writer's loop can re-read and retry.
Fixed once the drive is open, like the other open-time options here - a pinned mode shows on the drive row and in mounts list / mounts status, and a successful open warns if the engine didn't apply it.
Working with several mounts#
swarmfile mounts list- every mount, its label, branch, repository, and which one iscurrent.swarmfile mounts current <id>- choose which mount commands without an explicit target should act on.swarmfile --mount <id> status- run any command against one specific mount, without changing the current one. Write the flag before the subcommand.swarmfile mounts branch <id> <branch>- move one mount to another branch without touching the others.swarmfile mounts close <id>- shut one down. It refuses while a changelist is open (--forceabandons it), and it always refuses the boot mount.
The Desktop App does the same: each repository in the left rail lists its open drives underneath, each row showing the drive's path, branch and status with a control to make it current and a × to close it (the boot drive's × has no close action - it explains that the drive can't be closed and that switching its repository repoints it).
Sparse mounts#
Sometimes a mount should show only part of the repository - the one folder a coding agent works in, or a single discipline's directory on a giant media repository. swarmfile mounts open <path> --sparse "<glob>" opens a sparse mount that exposes only the paths matching the include globs; --exclude takes the complementary form. The glob dialect matches materialize --sparse: a glob matching a directory includes its subtree, a leading ! excludes an earlier match, and a bare name matches at any depth.
A sparse mount is honest about the boundary: an excluded path is invisible at that drive (no listing entry, an open fails as if it weren't there, and creating or renaming onto it is refused). The scope is per mount, so a second, full mount of the same repository on the same machine is unaffected. Offline sets respect the scope - swarmfile hydrate start on a sparse mount can narrow inside it but never widen past it, and Pack & Go takes exactly what the mount exposes. When a render node needs the whole repository resident instead, swarmfile hydrate start with no path pins everything under the mount's scope.
See the CLI reference for the full flag set.
Limits and practical notes#
- macOS: FUSE-T provides 18 mount-helper slots per Mac, shared with every FUSE-T app on it (not a macOS mount limit). If an
openfails withfuse_t_helper_ports_exhausted, close a drive or quit the app holding a slot, then retry;swarmfile doctornames the holders. A boot mount that never attached can retry in place withswarmfile mounts retry; one that attached earlier needs a restart. - One engine, one cache directory. Don't point two engines at the same cache directory or mount point. Running a separate engine per mount is a valid isolation choice, but it must have its own
SWARMFILE_CACHE_DIR. - Shared scratch cache. All mounts of the same repository on a machine can share one scratch directory for tool caches, so a second mount doesn't re-download dependencies - see Coding Agents.
- Switching the whole engine is different from picking a current mount:
swarmfile workspace switchmoves the engine's active org/repository - usually in place, without a restart. If the hot path cannot complete, the engine drains and restarts instead (the OS supervisor relaunches it), so the drives briefly unmount and return. Mounts of the repository being left follow the switch to the new repository's active branch; mounts on other repositories stay put - and one on a different repository blocks an org switch until it is closed (the app names both before you confirm). See Switching the active organization or repository.
Where to go next#
- CLI: swarmfile → mounts - every
mountssubcommand and flag. - Working Offline (Pack & Go) - reserving a scope on one mount for offline work.
- Coding Agents - the headless, one-mount-per-agent version of this setup.
Something wrong or missing? Report a docs issue.