Two agents editing the same folder can step on each other's changes even if their chat windows are separate.

Caminho Solo context: This practical exercise complements Git Worktree: how to run multiple coding agents without mixing their files, with the original research and fuller walkthrough.

Why this question matters

Imagine asking one agent to improve registration while another fixes your shopping cart. Both enter the same project folder, edit nearby files and run tools that rewrite source code. Soon you cannot tell which modifications belong to which task. A Git repository stores your project's history. A branch names a line of development. A worktree is a directory containing the checked-out files. The git worktree command lets you attach additional working directories to one repository without making another full clone. This distinction is essential: creating a branch does not automatically create a second folder. Switching branches in the same folder can disrupt an agent that is editing files there. With worktrees, each agent can operate in its own checkout and index while sharing the repository's underlying objects and history.

Try the smallest experiment

Step 1. Create a disposable Git repository with one baseline commit, then make a new worktree on a feature branch.

Step 2. Run read-only inspections in one directory and a small isolated change in the other. Compare git status for each directory.

Step 3. Bring the change back through a reviewed merge or cherry-pick, then remove the test worktree only after confirming there are no unsaved changes.

What to write down

git worktree list git status --short # Inspect before doing any removal: git worktree list --porcelain 

One failure mode to watch

Worktrees isolate working folders, not business logic. Two branches can still conflict when merged.

Primary references

How to judge your result

Keep the input, expected result and actual observation together. Check the failure case before using this workflow with real accounts or production data.

Editorial disclosure: Fully AI-generated adaptation of the published Caminho Solo English article. Examples are suggested exercises, not claims of tests actually run.

Continue with Caminho Solo: The original guide and references add the broader context for this focused example.