AI NewsDev toolsAnnouncement

Foremerge is an open-source coordination protocol for parallel coding agents that catches conflicts Git cannot see, and it reached 424 stars a month after the first commit

Foremerge is a Rust CLI, JSON API and MCP server that has agents announce what they are about to change in semantic terms before they write code, so two agents editing different files with plans that undo each other get warned before either commits, and reached 424 stars 31 days after the first commit under Apache 2.0.

Editorial3 min read

LinkedInX
GitHub Open Graph card for the naw103 foremerge repository

Image: GitHub

Why it mattersRunning two or more coding agents in parallel is now common, and Git only looks at text overlap, so silent semantic conflicts across separate worktrees are a real failure mode this project addresses directly rather than hoping models catch it in review.

Foremerge launched on Show HN on 21 September 2026 and picked up 19 points and 424 GitHub stars, 31 days after the first commit on 21 August. It is an open-source protocol under Apache 2.0 that sits above Git and lets parallel coding agents warn each other before they write code that would silently undo the other's work.

The failure mode

Git compares text and only text. When two coding agents each work in an isolated worktree, they never touch the same file at the same time, and Git cannot warn about anything else. Foremerge's own example: one agent replaces PaymentService with StripePaymentService across every caller, another adds PayPal support to the old PaymentService. Neither edit collides on any line. Git merges both clean. The PayPal work is now attached to a class nothing calls, and the repository owner finds out at runtime.

That shape becomes common the moment a team runs two agents in parallel, which is now a routine setup with Claude Code, Codex and Cursor worktrees.

What the protocol does

Before an agent writes code, it publishes a semantic scope declaration and an operation. In the example above, agent A declares symbol:PaymentService=replace and agent B declares symbol:PaymentService=extend. A shared SQLite database inside the repository's Git common directory, visible to every worktree on the same machine, holds every live claim. Foremerge compares operations deterministically. Two declarations against the same symbol with opposing operations raise a HIGH destructive_vs_additive advisory that names both agents and suggests a stable abstraction such as PaymentProvider.

The comparison uses the declared operation and ignores the prose the agent wrote. "Consolidate payments onto Stripe" and "Replace PaymentService with Stripe" reach the same verdict, because the same operation was declared. No model is asked to judge, so the same inputs always produce the same result.

The warnings are advisory. Foremerge never locks a file and never blocks an agent, because one crashed agent would then stall the whole fleet. Both worktrees stay clean at the moment of warning.

The check runs, the agent's claim does not count

Foremerge treats an agent's claim that its tests passed as unverified. Acceptance is gated on Foremerge running the registered check itself, whether that is cargo test, a build or a typecheck. If a project registers no check, work is accepted with the record marked UNVERIFIED and the reason, so the audit trail never implies a check ran when none did. foremerge doctor reports whether the registered checks can actually run in an agent worktree, which matters because dependency directories are usually gitignored and git worktree add will not create them.

Where it fits

The install is a CLI, a JSON HTTP API on localhost:47811, and an MCP server. It ships native skills for Claude Code, Codex and Cursor, so an agent in any of those clients can publish intent, claim scopes and check for conflicts by tool call. The project is at version 0.5.0, a pre-1.0 local-first MVP, and the README states plainly that "published benchmark results do not yet exist" and that machine-to-machine coordination is outside scope.

For a team running two or more coding agents in the same repository, this is the shape the coordination layer has to take. The alternatives are serialising the agents, which defeats the point, or catching semantic collisions in human review, which is how the PayPal case reaches production. Surfacing the conflict before either agent writes a line is the cheapest place to catch it.

Source

GitHub, naw103/foremerge, Apache 2.0, verified against the GitHub API at 2026-09-21T19:30:00Z. Show HN discussion at news.ycombinator.com/item?id=49789356.

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX