Catch intent conflicts before code conflicts.

Foremerge is the open-source coordination protocol for coding agents, built above Git. Claude Code in one worktree, Codex in another: agents from any provider share intent, semantic claims, dependencies, provisional ChangeSets, decisions, and verification through one store, so plans collide in a queryable database, not in your merge.

$ curl -fsSL https://naw103.github.io/foremerge/install.sh | sh

The problem

Git sees two clean trees. The plans already collide.

Agent A · worktree ../payments-stripe
Replace PaymentService with StripePaymentService
symbol:PaymentService
Agent B · worktree ../payments-paypal
Add PayPal support to PaymentService
symbol:PaymentService
HIGH · replace_vs_extend · rule FM-C001

One agent removes the extension point the other depends on. No overlapping lines, no diff, nothing for Git to flag until both implementations exist and the rework is expensive. Foremerge compares declared scopes and intent language before implementation and raises an explainable, advisory finding. No hard locks, no LLM in the detection path.

How it fits

A shared awareness layer. Git stays the repository.

Every agent keeps its own isolated worktree. Coordination state lives in one SQLite database under the repository's Git common directory, so linked worktrees share it automatically. Mutations update typed projections, materialize graph edges, and append a hash-chained semantic event in a single transaction.

CLI

One binary

Register agents, publish intents, claim scopes, query who is changing what, and gate ChangeSets, with --json for scripting.

MCP

Seven focused tools

register_agent, publish_intent, claim_work, query_work, check_conflicts, publish_changeset, coordinate_with_agent, all over stdio. No daemon required.

JSON API

Loopback daemon

An authenticated local HTTP API with an OpenAPI schema, for harnesses that prefer HTTP to stdio.

INTENT CLAIMED IN_PROGRESS PROVISIONAL VALIDATED ACCEPTED COMMITTED

Agent-reported test results are provenance, never proof. Acceptance requires Foremerge-executed validation against the exact Git fingerprint of the candidate, and any change after validation makes that evidence stale.

Mixed fleets

One store, many models.

The protocol carries nothing provider-specific, so heterogeneous fleets are the design center, not an edge case. Any MCP-capable client drives the same seven tools; anything else uses the CLI or JSON API. Every ChangeSet records which agent and which model did what, validated how, against which exact Git fingerprint. A mixed Claude + Codex run doesn't just work: it produces the cross-model coordination data nobody else is collecting.

Worktree A
Claude Code · claude-fable-5
Worktree B
Codex · gpt-5.2-codex

Semantic scopes

Claims describe concepts, not file paths.

File paths miss API, schema, configuration, infrastructure, and cross-language collisions. Foremerge scopes name the thing that is actually contended:

symbol:PaymentServiceA class, function, or type
api:POST /v1/chargesAn endpoint or interface
schema:invoices.totalA table, column, or document shape
migration:2026-08-add-taxA one-shot ordered change
contract:payment-providerA cross-component agreement
env:STRIPE_API_KEYConfiguration and environment

Claims are leased and advisory: overlap produces a warning and shared context, never a lock. Twelve scope kinds ship in 0.1.0.

What it does not claim

Deliberately small, deliberately honest.

  • Conflict detection is deterministic, explainable, and heuristic. It can miss synonymous concepts and warn on compatible work.
  • Local-first: one machine, one SQLite store shared across worktrees. Multi-machine shared mode is on the roadmap, not in the box.
  • There are benchmark fixtures and a reproducible plan, but no published coordinated-vs-uncoordinated results yet. No performance claims until there are.
  • It does not replace code review, CI, architecture ownership, or Git hosting rules, and passing validation proves only what was actually run.

The full trust model is in docs/limitations.md. Protocol feedback on scope vocabulary, conflict evidence, and verification policy is the contribution we want most: start a discussion.