← Back to library

▶ quest log

Git Worktrees: One Folder Per Agent, One Branch Per Task

Coding ToolsAdvanced@umacodessaved MAY 12

◇ Could this help me?

Yes. Worktrees are a built-in git feature, the description of how they share history and object storage is accurate, and giving each agent an isolated directory is genuinely the cleanest way to run parallel work without merge chaos. Two practical notes: ignored files such as environment files and installed dependencies do not come along to a new worktree and have to be set up per directory, and stale worktrees accumulate, so prune them on a schedule. This is a general practice.

✦ Walkthrough+10 xp / step
0 / 7 steps · adopt for +40
$ suggested_prompt+40xp

Set this repository up for isolated parallel work using git worktrees. Create a worktrees directory at the root and add it to the ignore file, then add a standing instruction to the project instructions file saying that any handed-off task creates a fresh worktree on its own branch inside that folder, does all its work there, and stops for review before merging. Tell me what per-worktree setup is needed for environment files and dependencies that are not tracked in git, and give me a command to prune worktrees once their branches are merged.

More from Coding Tools

Enter world →