Claude Sonnet 5 vs Gemini 3.5 Flash for code review
Claude Sonnet 5 wins, 89–84
Same 12 code review tasks, marked blind by three rival labs. Claude Sonnet 5 took 6 tasks, Gemini 3.5 Flash took 1, 5 tied. Tested 18 Aug 2026.
Where they differed most
Review this function. Context you can rely on: `page` is 1-based — the public API docs promise that page=1 returns the first page; `items` is always an array and may be empty; `perPage` is taken straight from a query string. function pageOf(items, page, perPage) { const start = page * perPage; const rows = items.slice(start, start + perPage); const lastPage = Math.ceil(items.length / perPage); return { rows, total: items.length, lastPage, hasNext: page <= lastPage }; } List the real defects, most damaging first, and for each one say what a user of the API would actually SEE — not what the code does, what they notice. Then give the corrected function. Do not list style preferences as defects.
## Defects, most damaging first **1. `start = page * perPage` — page=1 doesn't return the first page** Since `page` is documented as 1-based, `page=1` should map to `start=0`. Instead `start = 1 * perPage`, which skips the entire first page. **What the user sees:** They call the API with `page=1` (per the docs, "the first page") and get back the *second* page of data. The first `perPage` items are never retrievable through the API at all — no combination of page numbers ever returns them. This silently corrupts every paginated response and vi…
Here are the real defects in the function, ordered from most damaging to least damaging, along with what an API consumer will actually experience. --- ### 1. Off-by-One Page Offset (Skipping the First Page) * **The Bug:** Because `page` is 1-based, the calculation `const start = page * perPage` is incorrect. If a user requests page 1 with 10 items per page, `start` becomes `10`. The code slices the array starting at index 10 instead of index 0. * **What the user actually sees:** * When requesting **Page 1**, they are shown the results for…
Task by task
| Task | Claude Sonnet 5 | Gemini 3.5 Flash |
|---|---|---|
| The pagination that skips page one | 6 | 8 |
| Nothing wrong with it | 8 | 8 |
| Three things wrong in six lines | 8 | 8 |
| Two customers, one last item | 9 | 9 |
| Rank by what breaks | 10 | 8 |
| The review, as JSON | 9 | 8 |
| Slow is not the same as wrong | 10 | 8 |
| Overdue at one in the morning | 9 | 8 |
| Write only the comment | 10 | 10 |
| The complaint that is not a defect | 8 | 8 |
| Right, and unusable | 10 | 9 |
| Refuse the rubber stamp | 10 | 9 |
Full receipts: Claude Sonnet 5, Gemini 3.5 Flash · judges gemini-3.1-pro-preview, gpt-5.6-terra, grok-4.5
Questions people ask
Which is better for code review: Claude Sonnet 5 or Gemini 3.5 Flash?
Claude Sonnet 5 — it scored 89/100 against 84/100 on our 12-task code review suite, winning 6 tasks to 1 with 5 tied. Every answer was marked blind by three judges from three rival AI labs.
How was this tested?
Both models answered the identical published code review tasks. Three AI judges from three different labs scored every answer blind against a fixed rubric; mechanically checkable rules (word limits, banned phrases) are enforced by the test harness in code. The raw outputs and judge verdicts are downloadable.
More code review head-to-heads: Claude Sonnet 5 vs GPT-5.6 Sol · Gemini 3.5 Flash vs GPT-5.6 Sol · Claude Sonnet 5 vs GPT-5.5 · Gemini 3.5 Flash vs GPT-5.5 · Claude Sonnet 5 vs Grok 4.5 · Claude Sonnet 5 vs GLM 5.2
Full ranking: Best AI for code review · model pages: Claude Sonnet 5, Gemini 3.5 Flash