Urgent.News

What's breaking now, across thousands of outlets.

AI

Anthropic recommends a git worktree per agent. Your runtime infra makes that a problem.

A developer supervising four coding agents has four changes in flight at once, each in its own git worktree. That The post Anthropic recommends a git worktree per agent. Your runtime infra makes that a problem. appeared first on The New Stack .

Anthropic recommends a git worktree per agent. Your runtime infra makes that a problem.

Anthropic recently suggested using a separate git worktree for each AI agent, as it is now considered the standard approach for running agents in parallel. This recommendation comes after what was once an expert workflow has become the recommended starting point for many developers today. While Git made branches cheap 20 years ago, enabling developers to isolate changes and work on multiple tasks concurrently, the practice of switching between branches and shipping one change at a time kept everything streamlined.

However, with the introduction of coding agents, the cap on the number of changes in flight has been removed, leading to four active changes moving towards merge simultaneously. The issue arises because the shared resources, such as a single staging cluster, database, message queue, and set of dependent services, can no longer handle four parallel changes without causing bottlenecks.

Each change needs to be fully functional and tested from the code layer all the way down to the data layer. This discrepancy has led to teams experiencing lower merge rates and extended review times due to the lack of parallel execution at the shared resource level. The solution lies in treating branching as a fundamental primitive at every layer of the stack, rather than solely relying on Git.

By implementing branch-based development, each layer of the stack can provide a cheap, instant, and disposable branch primitive, allowing changes to exist end-to-end without duplication. This approach involves leveraging existing features like worktrees, pipeline caching, preview deploys, database branching, and environment sandboxing.

The upper layers have already adopted this idea, with CI systems running individual pipeline runs for each branch on shared runner pools and front-end platforms like Vercel and Netlify creating preview deployments for non-production branches. Similarly, databases have caught up by offering copy-on-write views of shared storage, enabling branches to be created in seconds, regardless of database size.

This development signifies a shift in how developers approach branching, as each layer now possesses its own branch primitive, addressing the initial bottleneck caused by shared resources.

Written by urgent.news from The New Stack's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at thenewstack.io →

More in AI

More from Thursday 6 August →