{"slug": "the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context", "title": "The most useful thing we built for parallel agents doesn't touch their context. It merges their branches before they do.", "summary": "A developer built a \"shadow merger\" that continuously merges every open agent branch in a project using local git and detects file- and function-level collisions before agents attempt to merge. When a new commit lands, affected worktrees receive a one-line notice the next time their agent runs a command or edits a file, without blocking the agent. The team reports its \"problems caught before merge\" metric went from zero to 79 in the first week after the tool shipped.", "body_md": "*A short update from the series on evidence-based agentic development.*\n\nI run a lot of agents at once: several issues in flight, each in its own worktree, across six repositories, in more than one runtime, sometimes on more than one machine. Each agent sees only its own branch. They find out they collided when the second one tries to merge, or worse, after it has.\n\nSo we built a **shadow merger**. Whenever any agent's branch gets a new commit, it merges every open branch in the project together in the background, with local git only, and works out what collides: which files, which functions. When something changes, it queues a one-line notice for each affected worktree. The next time the agent there runs a command or edits a file, it gets the notice first:\n\nyour branch and #489 both change `kandiforge-com/lib/search/docsSearchData.ts`\n\nIt never blocks. It tells the agent while it can still do something about it.\n\nTwo more things ride on the same hook:\n\n`fatal: ambiguous argument 'origin/development'` 3 minutes ago.\"\nThe count we keep is **problems caught before merge**: the shadow merger's notices plus the code watcher's findings on unmerged commits. Every week before these shipped, it was zero, because nothing looked. In the first week: **79.** In mid-October it was tracking live overlaps such as two open branches in the same auth server file in one of our projects. Both agents already knew.\n\nThis is the opposite of what I expected a year ago. We spent most of our effort putting more knowledge *into* agents' context, and agents mostly ignored it. What works is watching the actual code and the actual work, and saying one specific, true thing at the moment it matters.\n\nThe outcome side, whether fixes after merge fall now that collisions are caught before, is still open: [What survived](https://dev.to/kentkandiforge/what-survived-a-year-of-trying-to-make-coding-agents-better-graded-against-a-holdout-o4m) has where it stands.\n\nThis is one of the write-ups behind my talk at [Build Stuff](https://buildstuff.events) in Vilnius this December, the 15th edition, under the theme *The Age of Agency*.\n\n**Control Your Fate at the Metal**\n\nWednesday 2 December, 15:00, Zeta 2. 45 minutes.\n\nIf you're coming, say hello. If you're not yet, `2026SPEAKER_20` takes 20% off a ticket.\n\n#BuildStuff15 #buildstuffconf #AgeOfAgency @buildstuffconf [https://buildstuff.events](https://buildstuff.events)", "url": "https://wpnews.pro/news/the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context", "canonical_source": "https://dev.to/kentkandiforge/the-most-useful-thing-we-built-for-parallel-agents-doesnt-touch-their-context-it-merges-their-2joh", "published_at": "2026-11-30 02:10:41+00:00", "updated_at": "2026-11-30 02:15:31.721260+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Build Stuff", "Vilnius"], "also_reported_by": [], "takeaway": "Run a background shadow merger that merges all open agent branches with local git on every commit and pushes a one-line collision notice into each affected worktree, catching overlaps before agents merge.", "recommendation": {"advice": "Merge all open agent branches in the background on each commit and surface file-level collision notices to agents before they merge, rather than adding more context.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context", "markdown": "https://wpnews.pro/news/the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context.md", "text": "https://wpnews.pro/news/the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context.txt", "jsonld": "https://wpnews.pro/news/the-most-useful-thing-we-built-for-parallel-agents-doesn-t-touch-their-context.jsonld"}}