# Stop AI coding agents from overwriting each other

<!--
title: "Prevent merge conflicts between AI coding agents · Cork"
description: "Git only sees two agents touching the same line. Cork checks every write against the other agents' changes, holds one that would break theirs, and lints each edit against their renames and new signatures."
canonical: "https://corkcli.com/use-cases/prevent-merge-conflicts-between-ai-agents"
last_updated: "2026-11-15"
-->

Cork checks every write before it lands. A write that would undo a teammate's change, or call a function another agent just renamed, is held once with what changed, and the retry goes through.

Install, free and local, no account: `npx corkcli` (or `curl -fsSL https://corkcli.com/install.sh | sh`). MCP only: https://mcp.corkcli.com

## How it works

1. **Every write is checked.** The gate runs before each write. A write into code a teammate is changing hears who and what first.
2. **Stale calls are caught.** After each write, semantic lint checks it against other agents' renames, removals and signature changes.
3. **Pushes land clean.** `git push` rebases onto the others' commits, reruns the tests and pushes, in one step.

## Measured

**40.6 → 0** rejected pushes per run with 16 agents on one repo, without Cork and with it. [Method and raw numbers](https://corkcli.com/benchmarks/study-7-scaling-to-sixteen-agents)

## Questions

### Why doesn't git catch these conflicts?

Git compares lines. When one agent renames a function and another adds a call to the old name in a different file, no line overlaps: the merge is clean and the build breaks. Cork compares names, signatures and callers.

### Does Cork block my agent?

A write is held once, with what changed and who changed it, and the retry goes through. A heads-up that someone is on the code never stops anything.

### Which languages does it understand?

The import-aware check, which stops a new call to an old name in another file, covers Python, JavaScript, TypeScript and Rust, on macOS and Linux with a cloud plan.

## Read more

- [What is a semantic merge conflict?](https://corkcli.com/blog/semantic-merge-conflict)
- [The write gate](https://corkcli.com/blog/write-gate)
- [Semantic lint](https://corkcli.com/blog/semantic-lint)
- [Why AI coding agents cause merge conflicts](https://corkcli.com/blog/why-ai-coding-agents-cause-merge-conflicts)

[All use cases](https://corkcli.com/use-cases.md) · [Cork in Markdown](https://corkcli.com/index.md) · [llms.txt](https://corkcli.com/llms.txt)

This page in HTML: https://corkcli.com/use-cases/prevent-merge-conflicts-between-ai-agents
