Fork the running environment
Give work separate runtime namespaces so independent agents do not contend for the same services.
Trade-off: More isolation means more environments to provision and clean up.
Separate code is easy. What about shared databases, ports, services, and environments?
Separate source trees can still point at one mutable database or one set of service ports. The right isolation boundary depends on the change being attempted.
Give work separate runtime namespaces so independent agents do not contend for the same services.
Trade-off: More isolation means more environments to provision and clean up.
Explore ways to copy, diff, and reconcile database or data-lake state per task.
Trade-off: Diverged data eventually needs a reconciliation policy.
The comparison: worktrees separate files; runtime namespaces separate services; data branches separate mutations. All isolation has a reintegration cost.
WHAT TO WATCHEnvironment setup, teardown and cleanup cost.
youtube.com · Angie Jones · from 14:20
“Another issue, specifically when running multiple agents in parallel, was that the agents were bumping into each other as they were trying to work. And more importantly, our machines couldn’t handle the load anymore.”
Block’s answer was dedicated cloud workspaces, one isolated environment per agent. Quoted from YouTube’s auto-generated captions.
youtube.com · Eric Zakariasson, Cursor · from 21:00
“you can reuse services but you’re still going to have to branch every like database or cache or user management to have like reproducible and separate environment”
Worktrees separate the code, not the state. Cursor runs each cloud agent in its own VM with its own database, and he guesses they run “multiple thousands a day”. Quoted from YouTube’s auto-generated captions.
youtube.com · Robert Erez, Octopus Deploy · from 59:07
“any sort of scenario where you want that AI agent to kind of validate what it’s done, you’re essentially talking about ephemeral environments, even if it’s not exposed to people”
The old pattern was a few shared test environments, one per tester, with people coordinating who had the system. Agents that check their own work need environments that are created and torn down per change. Quoted from YouTube’s auto-generated captions.
github.com · Issue #3178
“Under the repo's own "worktree-per-writer" rule, each worktree (and each Claude Code session with a different cwd) reads and writes a different claims.json, so claims_claim / claims_board / claims_steal do not coordinate the sessions they are meant to coordinate.”
Isolating the code also isolated the coordination. Shown by reading the source, not from an incident where two agents took the same task. The fix, PR #3210, was still unmerged in October 2026.
github.com · Problem Statement, item 1
“Workers can't see each other's beads. A bead created by agent A is invisible to agent B until A's branch merges to main.”
Giving each worker its own branch let them write without contention, but they couldn't coordinate. The design doc moved everything to one shared main with explicit transactions, live since 24 February 2026.
github.com · Issue #2633, Summary
“The result is that state is written to whichever subdirectory the session drifted into, and then never read again. Nothing errors.”
On one 12-repository workspace this left 109 state directories (97 stray) and about 25 daemons. Fixed in the reporter's fork; the upstream issue is still open. A 2025 issue (#765) describes the same root cause.
openai.com · Increasing application legibility
“As code throughput increased, our bottleneck became human QA capacity.”
The fix was to make the app bootable per worktree, with an ephemeral logs, metrics and traces stack, so Codex could run and check one instance per change itself.
datadoghq.com · Allocate capacity based on workload criticality
“At Datadog, we first introduced source-specific limits to prevent concurrent evaluation workloads from consuming the entire shared quota. Now, we further isolate evaluation traffic by routing it through a separate provider account.”
Isolation is not only about files and environments. A shared model quota is a resource agents compete for too.
medium.com · The task survived. The procedure did not.
“It can launch another agent and leave two processes editing the same worktree.”
What a naive retry does after the coordinator dies mid-handoff. She also lists stranded claims, duplicate sessions after retries and stale completions arriving after a newer generation started.
builders.abnormal.ai · Share one environment, override one service
“Every agent shares one running base environment and overrides only the service it’s touching.”
At 200+ agent PRs a day, a full environment per branch was too expensive. Each testbox overrides only the service under change and gets private copies of the datastores it declares.
builders.abnormal.ai · Share one environment, override one service
“A redirect only works if every consumer of the config layer honors it, and the ones that don’t fail silently, because a working connection to the wrong database looks exactly like a working connection. We shipped two consumers that quietly ignored ours.”
Isolation that leaks fails silently. They added a capture agent that checks the connections each test actually makes against the service’s declared manifest.
paxos.com
“Across all four, the same patterns showed up: Slack as the universal entry point, pre-warmed ephemeral sandboxes, async fire-and-forget that produces PRs, human review as the merge gate, directory-scoped context files (CLAUDE.md / AGENTS.md), bounded CI retries, and MCP as the tool-integration standard.”
The four are Stripe’s Minions, Ramp’s Inspect, Spotify’s Honk and Paxos’s own Hoplites. A useful checklist of what company agent factories have converged on.
stripe.dev · How do minions work?
“This also gives parallelization without the overhead of something like git worktrees, which wouldn’t scale at Stripe.”
Each minion gets a pre-warmed devbox, ready in about 10 seconds with Stripe code and services loaded and cut off from production and the internet. Over a thousand merged PRs a week are written entirely by minions.
stripe.dev · Devboxes, hot and ready
“Humans should be able to give many agents logically separate work. Agents should have clean environments and working directories: it unnecessarily wastes tokens on resolution if agents are interfering with one another’s changes.”
Stripe keeps a warm pool of identical devboxes, with repositories cloned and Bazel and type-checking caches already warm, and gives each task its own box.
github.com · Concurrent Automated Development
“Never allow two writers in one worktree. Give every writing agent an isolated worktree and explicit file ownership.”
The same section adds: "Only the integration owner edits shared manifests and lockfiles or reconciles overlapping changes."
builders.ramp.com · Sandbox
“This ensures that at most, the repository is 30 minutes out of date”
Every Inspect session starts from a repository image rebuilt every 30 minutes, so isolation comes with a known staleness bound. Inspect writes about 30% of merged PRs in Ramp’s frontend and backend repositories. The Pragmatic Engineer later reported 75%.
stevekinney.com
“Worktrees reduce file collisions. They do not isolate services, ports, databases, secrets, or decisions.”