naw103/foremerge
Catch intent conflicts before code conflicts. The open-source coordination protocol for coding agents, built above Git.
What it solves
Foremerge addresses "intent conflicts" that occur when multiple AI coding agents work on the same project simultaneously. While Git can detect when two agents edit the same line of code, it cannot detect when two logically sound changes in different files contradict each other (e.g., one agent replaces a service that another agent is currently extending). Foremerge allows agents to coordinate their plans before writing any code, preventing wasted effort and broken integrations.
How it works
Foremerge acts as a coordination protocol built on top of Git. It uses a shared SQLite database stored within the project's .git folder, allowing agents operating in separate Git worktrees to share a "semantic whiteboard."
- Intent Publication: Before coding, an agent announces its target (e.g., "I am changing the
sendEmailfunction") and the operation (e.g.,replaceorextend). - Conflict Detection: Foremerge compares these declarations against other agents' plans. If two agents target the same symbol with conflicting operations, it raises an advisory warning.
- Verification Gate: Once work is complete, Foremerge requires a validation check (like a test suite) to run against the specific code fingerprint before the work can be marked as accepted.
- Non-Blocking: It does not lock files or block agents; it provides advisory warnings and evidence so the human or agent can decide how to proceed.
Who it’s for
Developers using multiple AI coding agents (such as Claude Code, Codex, or Cursor) in parallel on a single codebase who need to prevent logical collisions and maintain an audit trail of agent decisions.
Highlights
- Semantic Awareness: Detects conflicts based on symbols and intents rather than just text lines.
- Local-First: Uses a local SQLite store in the
.gitdirectory for zero-config sharing between local worktrees. - MCP Integration: Provides a Model Context Protocol (MCP) server to allow AI agents to natively register, publish intents, and query conflicts.
- Verification-Gated: Ensures that ChangeSets are validated by actual command execution (e.g.,
cargo test) rather than relying on agent-reported status.
Related
- Dispatch
- Project
- Project
- Project
- Project