CC-301e · Module 1
Merge Conflict Resolution
4 min read
Merge conflicts are where Claude Code genuinely shines. A merge conflict is a structured problem with clear inputs (the two divergent versions and the common ancestor), a clear output (the resolved version), and a clear success criterion (the code compiles and tests pass). This is exactly the type of problem Claude solves well.
The workflow is direct. You hit a merge conflict. You tell Claude: "Resolve the merge conflicts in these files." Claude reads the conflict markers, understands both sides of the change, determines the correct resolution based on the intent of each branch, and produces the merged result. For straightforward conflicts — both sides added imports, both sides modified adjacent lines — Claude resolves correctly over 90% of the time. For semantic conflicts — both sides changed the same function's behavior in incompatible ways — Claude identifies the conflict and asks for your judgment.
- 1. Initiate the Merge Run git merge or git rebase and let it fail with conflicts. Do not attempt manual resolution. The conflict markers give Claude the structured input it needs.
- 2. Hand Conflicts to Claude "Resolve the merge conflicts in the files listed by git status. Preserve the intent of both branches. If the conflict is in business logic and you cannot determine the correct resolution, ask me."
- 3. Verify and Complete Review Claude's resolutions, run the test suite to verify correctness, then complete the merge. The test suite is your safety net — it catches semantic errors that textual resolution missed.