Parallel agents are powerful and dangerous on a shared dirty tree.
Worktrees (or explicit branches per pane) give each agent a filesystem boundary. imux does not replace git discipline—it hosts the panes where that discipline happens.
Prerequisites
- git repo
- Comfort with git worktree or feature branches
Steps
- 01
Create an isolated worktree
git fetch origin git worktree add ../myapp-agent-a -b agent/a origin/mainOpen that path as its own imux workspace or pane cwd so the agent cannot touch your main checkout by accident.
- 02
One writer per tree
Assign a single implementer agent per worktree. Use other panes for tests/logs only. Two writers on one tree is the usual merge disaster.
- 03
Review before merge
When the agent finishes, review diffs, run tests in a neighbor pane, then merge via PR—not by copying files blindly into main.
- 04
Clean up worktrees
git worktree remove ../myapp-agent-a git branch -d agent/aRemove finished worktrees so disk and branch list stay sane.
FAQ
Does imux auto-create worktrees?
Some agent flows may offer isolation options depending on build and policy. Treat explicit git worktrees as the portable, reviewable default.
Is this the same as Docker isolation?
No. Worktrees isolate git working copies, not full OS sandboxes.