The practical answer

Use one worktree per editing task, start both tasks from the same integration branch, and merge reviewed changes one at a time. Separate folders prevent overlapping edits; they do not prevent merge conflicts.

Why two agents need separate working folders

Two agents can work on the same project without working in the same folder. That distinction matters. In a shared checkout, one agent can change a file while the other is reading it, run tests against a half-finished edit, or include someone else's changes in its commit. Separate branches alone do not fix this if both agents still use the same checkout.

A Git worktree is another working folder attached to the same repository. Each folder has its own checked-out branch and working files. You can give one agent a login bug and another a documentation task without asking them to share uncommitted changes.

The best first parallel task is a pair of small, independent jobs. If both jobs change the same authentication flow, splitting them may create more review work than it saves. Decide who owns each file or feature before you launch.

Create a branch and folder for each task

This example uses PowerShell and an existing repository at C:\Projects\my-app. Replace that path with your project. The repository must already have an origin remote and a dev-preview branch; otherwise use your team's actual integration branch.

cd C:\Projects\my-app
git status --short
git fetch origin
git worktree add -b agent/login-fix C:\Projects\worktrees\my-app\login-fix origin/dev-preview
git worktree add -b agent/docs-update C:\Projects\worktrees\my-app\docs-update origin/dev-preview
git worktree list

Check the first status output before continuing: save unrelated work rather than letting it become part of the task. Start each agent in its assigned folder. Tell it the branch it should integrate into, the task's scope, and how to verify the result.

A new worktree does not automatically contain ignored dependencies or local environment files. Install the project's dependencies using its documented command. Supply only the development configuration that task needs. Never copy production credentials into an agent's folder as a convenience.

Give each agent a brief you can review

A useful brief includes the observed problem, the expected result, the files the agent may change, and the checks it should run. A login task might say:

Fix the login error shown when an email contains leading spaces.
Work in the login-fix worktree only.
Keep the public API unchanged.
Add a regression case for the failing input.
Run the repository's documented checks.
Report the changed files and any remaining uncertainty.

Ask the documentation agent to avoid the login implementation. Agree on shared dependencies first: if both tasks need the same schema change, land that prerequisite before splitting the remaining work.

Review and integrate one task at a time

In each worktree, inspect git diff, run the repository's checks, and commit only the intended files. Do not accept “tests passed” without knowing which commands ran and whether those checks cover the bug.

After the first task is accepted into your integration branch, refresh and rebase the second task before reviewing it:

cd C:\Projects\worktrees\my-app\docs-update
git fetch origin
git rebase origin/dev-preview
git diff origin/dev-preview...HEAD

Resolve conflicts deliberately and run checks again when integration changes the result. Use your team's pull-request process or an authorised fast-forward integration. Never force-push a shared integration branch to make parallel work fit.

Separate worktrees isolate edits, not runtime resources. Two development servers can still compete for a port. Two test suites can still change the same database. Use separate ports and disposable test data where those resources are shared.

Clean up after the changes are accepted

Before removing a worktree, check for uncommitted and ignored files you need to keep. Then remove the finished worktree from the original repository using Git, rather than deleting the folder manually:

cd C:\Projects\my-app
git -C C:\Projects\worktrees\my-app\login-fix status --short
git worktree remove C:\Projects\worktrees\my-app\login-fix
git branch -d agent/login-fix

If Git refuses, investigate. Do not add a force flag just to clear the warning. Keep backups and local configuration until you have confirmed they are no longer needed.

Where Towfu fits

Towfu brings your coding-agent CLIs into a Windows workspace and supports a separate Git worktree for each agent. That helps you see the sessions together while keeping their edits apart. It does not make competing edits compatible or replace your review.

You can use this workflow from ordinary terminals, too. Towfu is useful when the folders, sessions and account status become difficult to keep track of. See Towfu's workspace features or read how to work with Claude Code and Codex together.