Concurrent agent workspaces
|
Stub. Full step-by-step playbooks will land here. For the why, read Git concurrency enshittification. |
Goal
Run human work and one or more agents on related changes without corrupting a single shared index, without surprising path breaks, and without multiplying dependency trees needlessly.
Near-term options (choose deliberately)
| Approach | Prefer when | Watch out for |
|---|---|---|
Native worktrees |
You need real separate checkouts and standard Git CLI everywhere |
Absolute path drift; duplicated |
jj / op-log style tools |
You want working-copy-as-revision and less index pain |
Team Git interoperability and tooling familiarity |
GitButler virtual branches |
You want one path and hunk lanes for unfinished work |
Native Git commands outside the tool desync workspace state |
Process namespaces + CoW clones (DIY Phase A) |
You control the agent runner and can pin a stable |
Operational complexity; still not FS-native editions |
Hard rules for agents
-
Do not let agents write into the human interactive working tree by default.
-
Prefer ephemeral sandboxes that export patches / revisions rather than mutating
HEADin place. -
Share content-addressable dependency stores (e.g. pnpm) across sandboxes when possible.
-
Install the encoding guard machine-wide (
core.hooksPath) before agents commit anywhere: agents commit under your identity, so history cannot tell you which one double-encoded a file (Prevent text encoding corruption).
Worktree placement (today vs long-range)
If you choose native worktrees, where they live matters as much as how you add them.
-
Today (hive / agent compatibility): Org-scoped Git worktrees —
$CODE_ROOT/<host>/<owner>/.worktrees/<repo>-<purpose-slug>, linked only; forbid global$CODE_ROOT/.worktreesand$CODE_ROOT/worktrees. -
Long-range ideal: Git worktrees long-range — repo-local
<repo>/.worktrees/<purpose>, relative path storage,git worktree add --local, without overloading.git/worktrees/admin metadata.
Owner-scoped is the compatibility bridge until Git stores relative checkout homes. == Phase B pointer
Filesystem editions (connectome-fs) make “new workspace” an O(1) edition fork with stable paths. Until then, this how-to stays in userspace tradeoffs.