## TL;DR

Copilot code review caps the diff size it will analyze. Shrink the PR (split it, or mark generated files so they are excluded) and request the review again.

## Error

```text
Copilot code review: unable to review  -  diff exceeds the maximum size.
```

## Steps

1. Check the diff size on the PR (files changed / additions+deletions). Expected: confirmation it exceeds the review limit.
2. Mark generated files as generated via `.gitattributes` (`*.snap linguist-generated=true`) so they are excluded. Expected: the reviewable diff shrinks.
3. If the human-written diff is still too large, split the PR into stacked smaller PRs. Expected: each PR fits the limit.
4. Re-request the Copilot review. Expected: the review posts.

## When to use

- Copilot code review fails with a diff-too-large message.
- The PR contains generated or vendored files inflating the diff.

## When not to use

- Copilot reviewed and you disagree with comments  -  reply to the comments.
- Copilot is not enabled for the repo; enable it first.

## Tool compatibility

- GitHub Copilot code review.
- GitHub.

## Variant phrasings

### Diff large due to a lockfile

Lockfiles are the classic culprit  -  linguist-generated marking fixes it permanently.

### Diff large due to vendored deps

Vendor directories should be gitignored or marked generated.

## Why it happens

The review model has a fixed context window; beyond it, the tool cannot see the whole change, so it declines rather than reviewing blind. The cap also nudges PRs toward human-reviewable sizes.

## Edge cases

- The size cap applies to the whole diff, not per file  -  one giant generated file can block review of everything else.
- Splitting purely to satisfy the bot is fine when each split is independently coherent.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_cQ6AxuIqSpkiXN_CFJ4jvA
