Two agents editing the same folder will trip over each other. Git has a built-in answer: worktrees. A worktree is another working folder for the same repository, checked out on its own branch, sharing one object database.
The commands
git worktree add ../app-fix-login -b fix-login
git worktree list
git worktree remove ../app-fix-loginThe first command creates a folder next to your repository with a new branch fix-login. Start one agent session in each folder.
What you get
- Each agent has its own files and its own branch, so uncommitted edits do not collide.
- History and objects are shared, so a worktree is quick to create and uses little disk space.
- Git refuses to check out the same branch in two worktrees, which prevents the worst mix-ups.
What you do not get
- Separate dependencies. Untracked folders such as
node_modulesare per worktree, so each one needs an install. - Separate ports and databases. Two dev servers on one port still collide.
- Shared understanding. Two agents in two folders do not know what the other found.
Keep them coordinated
Give each worktree one issue. Let each agent save findings and failed attempts to the project while it works, so the second agent does not repeat the dead end of the first. Merge through pull requests, one per branch, each reviewed by a person.
On Contextingo each agent session starts on an issue with session_start, so two worktrees on two issues share one project knowledge. See how a handover works.