In the chaotic world of autonomous coding agents, isolation is often sold as a safety feature. But for developer Anton Dziatkovskii, a single checkbox in the Claude desktop app turned his Mac Pro into a graveyard of orphaned code. On November 11, 2026, Dziatkovskii asked his AI agent which folder was the active working directory. The response wasn't a single path, but a list of 95: the main repository and 94 git worktrees created by previous agent sessions.
The Checkbox That Broke the Build
The culprit was the "Worktree" option in the Claude Code tab, a feature designed to prevent agents from overwriting each other's files during parallel execution. While intended for isolated, large-scale refactors by human developers, the feature defaulted to "on" for short-lived agent sessions. This created a scenario where every new session spawned its own checkout. Dziatkovskii discovered that 43 of these branches contained committed work that had never been merged back into the main branch. The oldest stranded commit dated back to October 3, while the bulk accumulated between November 2 and 9.
Merging the Digital Graveyard
The technical reality was less catastrophic than the workflow failure. Git worktrees share a single object store, meaning the commits were technically reachable, but they were functionally invisible to the primary workflow. Without a remote repository to enforce integration, the work existed only on a single local disk. Dziatkovskiiβs reaction was visceral; he dictated a voice note describing the situation as a "serious screwup." An agent was subsequently tasked with merging the 43 branches. The process took less than a minute, with 41 branches merging automatically. Only two required manual conflict resolution, involving shared files like AGENTS.md, the contract defining agent behavior.
The Failure of Manual Coordination
This incident highlights the fragility of relying on human-like coordination for non-human agents. Prior to the worktree explosion, Dziatkovskii used a manual markdown "board" for agents to claim files. That system failed too; the board file had only one commit in its history since September 30, despite agents using it. The manual step was skipped, and the file lived in the repository, meaning each worktree had its own isolated, empty version of the board. Agents were essentially shouting into voids, unaware that other instances were modifying the same underlying codebase.
Key Takeaways
- Isolation Defaults Are Dangerous: Features like
git worktreeare powerful for human developers but create integration debt when applied to ephemeral, autonomous agents without a merge strategy. - The "No Remote" Risk: Keeping all agent work on a single local disk without a remote backup or CI pipeline makes orphaned branches invisible and unrecoverable for future sessions.
- Manual Protocols Fail at Scale: Relying on agents to manually update shared state files (like a claim board) is unreliable; automated hooks are required to enforce coordination.
- Audit Your Branches: Developers running local agents should immediately run
git branch --no-merged mainto check for stranded work from previous sessions.
The Bottom Line
We are building tools for humans and expecting agents to use them like humans. Until we design agent-native workflows with automatic integration, we will keep losing code in the cracks of isolation.
The Fix: Automated Gates
In response, Dziatkovskii implemented a hard gate. A hook named no_worktree_gate.py now intercepts the WorktreeCreate event in Claude Code, forcing a non-zero exit to cancel the checkout. This prevents new worktrees from being spawned. Coordination is now handled by onair.py, a shared claim system outside the repository. Agents now post JSON claims with a 4-hour TTL to a central service. If an agent tries to write to a file already claimed by another session, the hook blocks the write and names the "neighbor." This shifts the burden from manual discipline to automated enforcement, ensuring that while agents remain isolated in their execution, their outputs converge in a single, authoritative branch.