context limit hit on monorepo PR: agent reviewed only the first 200 files
Gets a review agent past the file-count wall on monorepo PRs so every changed file gets reviewed, not just the first batch. Use it when a PR touches hundreds of files and the agent quietly stops after the first N. The tell is a review that mentions only a fraction of the changed files.
TL;DR: Get the full changed-file list from the API, split it into fixed-size batches, review one batch per model call, and save findings after each batch. Agents iterate "for each file, review it" until the context fills, then the loop just ends with no error. An explicit file list plus a progress tracker is what makes the agent notice it stopped early.
context limit hit on monorepo PR: agent reviewed only the first 200 filesGet the authoritative changed-file list from the API with pagination. Never trust the agent's memory of what it saw. Expected: a complete list with the true file count.
Split the list into fixed-size batches, sized so one batch plus its findings fits the context window with room to spare. Expected: batch size chosen from a token budget, not a guess.
Review one batch per model call, saving findings to disk after each batch. Expected: a findings file per batch, written before the next batch starts.
Track progress explicitly: batch 3 of 12, files 201-300 of 1180. If the run dies, resume from the last completed batch. Expected: restarts never re-review completed batches.
After the last batch, merge all findings files and dedupe. Expected: a single finding list covering every file.
Sanity-check coverage by diffing the reviewed file list against the API's changed-file list. Expected: the two lists match exactly.
Use this when
- a PR touches more files than fit in one review call
- the agent reviews the first batch and stops without any error
- monorepo PRs with hundreds of changed files
Not for this skill when
- the PR has few files but huge diffs (chunk by diff size, not file count)
- the agent errors loudly on large PRs (that is a different failure - check timeouts and memory)
- most changed files are generated (exclude them from review instead of batching them)
Variant phrasings
review bot only checked the first 200 files of a big PR
monorepo PR partially reviewed: agent stopped early
agent skipped files silently on a 1000-file pull request
Why it happens
The typical agent loop reviews files until the context fills, then ends or starts summarizing instead of reviewing. Nothing errors, so the run looks successful. Without an explicit file list and a progress tracker, the agent has no way to know it stopped early, and neither does anyone reading the review.
Edge cases
- Batched reviews lose cross-file context; carry a short summary of shared types and interfaces between batches.
- Duplicate findings across batch boundaries need deduping by file plus line plus rule.
- Prioritize: review source files first, tests second, generated files last (or not at all).
- A PR that touches a thousand files may deserve a "too large to review well" comment itself.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstYBfvEgc6wb7yXXr-FG5tw