> ## Documentation Index
> Fetch the complete documentation index at: https://ade-app.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Conflicts

> Predict, simulate, and resolve merge conflicts between lanes before they ever block a merge.

ADE surfaces integration risk before it becomes a merge-time emergency. A single engine predicts conflicts, computes pairwise risk, runs pre-flight merge simulations, and drives AI-assisted resolution — so you can reorder, rebase, or fix a collision while work is still in progress.

There's no standalone "Conflicts" tab; the signal is projected into the surfaces where it matters: lane status badges, the lane's catch-up menu, and PR merge readiness.

## Pre-flight detection

ADE compares your active lanes — against each other and against their base — by running `git merge-tree` on the host that owns the worktrees. It predicts whether a merge or rebase *would* conflict without actually performing one, then caches the result and surfaces it as a status.

| Status | Meaning |
| - | - |
| **Merge-ready** | A base prediction exists, no predicted conflicts, and the lane isn't behind. |
| **Behind base** | No conflicts, but the lane is behind its base and should rebase. |
| **Conflict predicted** | A dry merge predicts conflicts with the base or a peer lane. |
| **Conflict active** | A real merge or rebase is in progress and has produced actual conflicts. |

> [!NOTE]
>
> Predictions older than five minutes are marked **stale** and shown with a clock indicator rather than silently refetched — the UI annotates them, and clicking re-runs the prediction for that pair.

## Risk levels

For each lane pair, ADE derives a risk level from how many files overlap and whether a real conflict is predicted.

| Level | Meaning |
| - | - |
| **None** | No overlapping files. |
| **Low** | A small overlap — likely an easy merge. |
| **Medium** | Several shared files; review before merging. |
| **High** | Marker-level conflicts predicted, or heavy overlap — expect manual resolution. |

ADE also keeps a project-wide **risk matrix** that scores every lane pair at once. There is no matrix view in the app. Agents and scripts read it through the conflicts tools and actions: the CTO `getConflictRiskMatrix` tool, and the `conflicts.getRiskMatrix` and `conflicts.getBatchAssessment` actions.

## Live merge simulation

Agents can run a one-shot **merge simulation** (the CTO `simulateMerge` tool or the `conflicts.simulateMerge` action) between two lanes (or a lane and its base). ADE computes the merge base, runs `git merge-tree`, and returns one of:

* **Clean** — no conflicts; the merged file list and diff stat.
* **Conflict** — the conflicting files, each with rendered conflict-marker previews.
* **Error** — a bad ref or corrupt index, surfaced rather than assumed clean.

This is the same primitive that backs the PR merge-readiness check, so a simulation matches what the PRs tab predicts.

## Rebase when a lane drifts

When a lane falls behind its base, a rebase pulls it forward and is usually the cleanest way to clear a predicted conflict before it reaches a PR. ADE resolves the right comparison ref for you — the open PR's base branch, or the project default branch when there is no open PR.

## AI-assisted resolution

When a conflict needs more than a reorder, ADE can resolve it for you in two ways:

> [card] Proposal flow
>
> ADE builds a bounded context for the specific conflict, asks a model for a patch, and lets you apply it unstaged, staged, or as a commit — with one-click undo. If required file context is incomplete, it refuses to guess and tells you why.

> [card] External CLI resolver
>
> For bigger merges, ADE spawns a Codex or Claude CLI session in the lane's worktree (or a dedicated merge lane), captures the changes, and commits them as an explicit, reviewable step.

## Prevention

* Keep lanes narrow so they touch fewer shared files.
* Stack related changes instead of editing the same area from unrelated lanes.
* Rebase long-running lanes regularly.
* Ask an agent to explain a conflict before asking it to fix one.

> [!WARNING]
>
> Conflict prediction is a warning system. Always verify with Git, tests, and PR checks before merging.

> [card] [Lanes](https://ade-app.dev/docs/lanes/overview.md)
>
> See stack order and which lanes overlap before you merge.

> [card] [Pull requests](https://ade-app.dev/docs/tools/pull-requests.md)
>
> Review CI, comments, and merge readiness for each PR.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.