OmniscioGuidesCould not find merge-base
Claude Code: Could not find merge-base
Last checked against Anthropic's documentation on November 22, 2026. By the Omniscio team. Updated .
What is the exact message?
The refusal opens with the base branch Claude Code compared against. Anthropic's example names main:
Could not find merge-base with main. Pass the base branch explicitly (e.g. `/code-review ultra develop`) or make sure you're in a git repo with a main branch.The sentence after the first one depends on what Claude Code observed, and there are three forms.
When you did not pass a base branch, Claude Code compared against the repository's default branch and the hint suggests passing yours explicitly, as the example above does.
When you passed a base branch that was already in your clone, the hint reads:
Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)When you passed a base branch that was not in your clone, Claude Code fetched it from origin before comparing, and the hint reads:
<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)In that third case, when Claude Code cannot tell whether your clone is shallow, it suggests git fetch --unshallow origin instead. Before v2.1.221 it suggested that command for every fetched base branch, and on a complete clone the command fails with fatal: --unshallow on a complete repository does not make sense.
What does it mean?
An ultrareview compares two points in git: your branch and a base branch. That comparison needs a commit both branches can trace back to, and this message means git found none.
Claude Code refuses the review before the cloud session starts, so nothing is uploaded and no review runs.
Anthropic states the three situations that produce the refusal: the base branch cannot be found at all, Claude Code cannot verify that your clone is complete, or the repository is one where the whole-tree diff is not possible, such as the SHA-256 object format.
A missing merge-base does not always refuse the review. On a clone Claude Code can verify is complete, with at least one branch, it falls back to reviewing every tracked file instead.
How do I fix it?
- Name your real base branch. Run
/code-review ultra <branch>with the branch your work branched from, such as/code-review ultra develop. Not sure which one that is? Ask Claude in the session:which branch did this work start from? - If the hint names a missing branch, fetch it. When it reads
Make sure <branch> exists locally or on origin, run thegit fetch origin <branch>it prints, then rerun the review. - If your clone might not have full history, unshallow it. Run
git fetch --unshallow origin, then rerun the review. The hint only suggests this when Claude Code cannot tell whether the clone is shallow; on a complete clone the command fails withfatal: --unshallow on a complete repository does not make sense, and there is nothing to fix. - If the hint says the fetched branch shares no history with
HEAD, pass the branch that is your real base instead.HEADis the commit you have checked out right now.
The base branch is the only thing these steps change. Nothing is installed, and no file in the repository is modified by the review itself.
How do I know it worked?
- The same command starts the review instead of printing the
Could not find merge-baseline again. - The review covers the diff against the branch you named, so the files it reports are the ones your branch changed.
- If Claude Code fell back to a whole-tree review, it reviews every tracked file rather than the diff; Anthropic says that fallback needs a clone it can verify is complete, with at least one branch.
Where these answers come from
- Anthropic's error reference, Could not find merge-base with the base branch, read November 22, 2026: the message, the three hint forms, the fallback to a whole-tree review, and the v2.1.221 change to the unshallow hint.
- Ultrareview diff limits and fallbacks, which the same entry points to for the whole-tree fallback.
Common questions
What does Could not find merge-base mean?
An ultrareview compares your branch with a base branch, and that comparison needs a commit both share. The message means git merge-base found no such commit, so Claude Code refused the review before starting the cloud session.
How do I fix it?
Pass your real base branch explicitly, as in /code-review ultra develop. If your clone might not have full history, run git fetch --unshallow origin and rerun the review.
Why did the hint mention git fetch --unshallow?
When the base branch you named was not in your clone, Claude Code fetched it from origin, and it suggests unshallowing when it cannot tell whether your clone is shallow. On a complete clone the command fails because there is nothing to unshallow.
Does this always stop the review?
No. On a clone Claude Code can verify is complete, with at least one branch, it reviews every tracked file instead of refusing. The refusal appears when the base branch can't be found, when the clone's completeness cannot be verified, or in a repository where the whole-tree diff isn't possible.