AI Code Review: Local Qwen vs. Claude in a Real PR11 min read2,274 words

AI Code Review: Local Qwen vs. Claude in a Real PR

A three-round code review test compares local Qwen3.6 with Claude models, showing where local AI falls short—and how to benchmark reviewers on your own code.

AI code reviewlocal LLM code reviewQwen3.6Claude SonnetAI code review benchmark
AI Code Review: Local Qwen vs. Claude in a Real PR

What a Real PR Reveals About Local AI Code Review

Running an AI code reviewer on your own machine sounds like an easy win: lower API costs and more privacy. But the real question isn't whether a local model can "read" a repo. It's whether it can reliably spot the bugs that actually matter - given your hardware and the way your review workflow is set up.

A small test put that to the test using the same historical pull request. In three runs on that PR, local Qwen3.6 missed the bug every time. Claude Sonnet 5 found it in all three runs, and Claude Haiku 5.5 found it in two. The bug wasn't hiding in the changed lines. To catch it, the reviewer had to trace an interruption through a function elsewhere in the codebase.

This isn't a universal ranking. It's one pull request, one local setup, and three attempts per configuration. Still, it points to a failure mode worth understanding: an agent can complete the review task, inspect the relevant code, and still walk away with the wrong conclusion.

Here's what the test covered: the setup, what went wrong, the time and cost trade-offs, and a practical way to benchmark AI code review against your own repository.

What did the code review test actually measure?

The test compared AI reviews of PR #1248 in the open-code-review project, an Alibaba code review tool. PR #1248 was submitted on September 17, 2026. A later change, PR #1745, fixed the defect the reviewers were supposed to catch.

The review tool was built from its main branch on November 11, 2026, at commit db5db6b. Each model got the same review task, and each configuration was run three times. The whole point was a "known bug" replay: instead of asking whether a model can find an unknown issue in any repo, it asks whether it can identify a specific defect that was later fixed.

The defect involved executeSubtask. An interruption reason had been added, but the function didn't record it as a token-budget overflow. The changed code introduced the relevant behavior, but catching the defect required looking past the diff and understanding how the review flow handled an interrupted conversation.

In this narrow test, the results looked like this:

  • Claude Sonnet 5 identified the bug in all three runs.
  • Claude Haiku 5.5 identified it in two of three runs; one finding was only partial.
  • Local Qwen3.6-35B-A3B, quantized to four bits, didn't identify it in any of three runs.
  • Haiku 4.5 missed the bug in all three runs.

This isn't a broad leaderboard, and three attempts on one PR can't tell you how models will perform across different repos or bug types. What it does show clearly is a consequential failure mode: the agent can process the task, inspect the right code, and still reach the wrong conclusion.

For engineering teams, that split matters. A model that never opens the relevant file likely has a search or orchestration problem. A model that opens the right function but misreads what it does has a reasoning problem. If you only record a single "pass/fail," you miss which category you're actually dealing with.

Why did Qwen3.6 miss a bug it was shown?

This test separated two steps that are easy to mix together: locating the relevant code and then evaluating what it means.

Across the three runs, Qwen3.6 didn't examine executeSubtask at all. It did reach related token-budget logic, but in one run it stopped adding new review comments before returning to the specific code path needed to establish the defect.

The tester then provided a list of six functions extracted from a code graph. That changed the navigation conditions. In two of three runs, Qwen3.6 did read executeSubtask, but it still didn't identify the bug. It concluded that checking the budget before starting the next file made the extra handling unnecessary.

That reasoning missed the key scenario. The budget check happened before another file was started. If the conversation for the current file was interrupted mid-file, the overflow wasn't recorded. The later fix in PR #1745 addressed that exact gap.

This is why "give the model more context" isn't always the whole answer. The function list helped Qwen3.6 reach the target function, but it didn't make it interpret the control flow correctly. In practice, code-review agents can fail for a bunch of different reasons - retrieval, navigation, tool use, context limits, or reasoning. A prompt tweak might fix some of those, but you shouldn't assume it will solve all of them.

The file counts underline that point. Haiku 4.5 examined 31 to 53 files per run and still missed the issue. Haiku 5.5 read only three to six files and found it in two runs. In this test, "how many files it looked at" didn't reliably map to "how good its review was." Broad scanning can look thorough while missing the specific branch that matters; focused inspection can work better when the agent makes the right connection.

So when you evaluate a code-review agent, capture more than the final comments. Track which files it opened, which tools it called, whether it went back to relevant code, and what conclusion it drew. That trace helps you separate a search failure from a reasoning failure - and prevents you from "fixing" the wrong thing.

How did local and hosted models compare on time and cost?

The test results weren't only about whether the models found the defect. They also differed in how long the runs took and what the costs looked like.

The local model ran on a computer with an RTX 4070 and 12 GB of VRAM. The quantized model file was about 22 GB, so it couldn't fit entirely on the GPU. The setup used llama.cpp with --cpu-moe to run mixture-of-experts computation across CPU and GPU.

Without the function list, Qwen3.6 took nine to 25 minutes per run; with the function list, it took 13 to 18 minutes. These runs didn't have per-call model API charges, but "no API charge" isn't the same as zero cost. Hardware time, electricity, and slower feedback loops all matter. If you're waiting on results before merging, those minutes become an operational cost even when inference is self-hosted.

Hosted models were faster in this test:

Model Bug found Time per run Cost per run
Claude Sonnet 5 3 of 3 About 4 minutes $0.70-$0.83
Claude Haiku 5.5 2 of 3 40-56 seconds $0.01-$0.02
Claude Haiku 4.5 0 of 3 About 2 minutes $0.28-$0.39
Local Qwen3.6 0 of 3 9-25 minutes without guidance; 13-18 minutes with it No model API charge

These figures are tied to this specific test. They shouldn't be treated as a general price forecast. But they do make one practical point: Haiku 5.5 managed two successful findings at a very low reported per-run cost, while Sonnet 5 was more consistent and cost more. Qwen3.6 avoided model API charges but didn't find the bug, even when it was guided to the relevant function.

There were also operational details that affected the local run. The tester used llama-server instead of Ollama because a previous test with another agent saw tool calls fail under Ollama - the model would write tool-call text instead of actually invoking the tool. The --jinja option let the server use the model's provided template to format tool calls. Tool calling isn't a small implementation detail in an agentic review workflow; if tool invocation breaks, the agent may not complete the task.

Context settings mattered as well. The server was configured with a context limit of 65,536 tokens, while the review tool's default max_tokens value was 200,000. The tester set the per-subtask input limit to 45,000, leaving room for an output limit of 16,384 tokens. The environment also needed Git 2.38 or newer because code search used git grep --max-count. With Git 2.34, searches failed without a clear review error.

What should teams take away from this test?

Don't take this as "local models can't review code," and don't take it as proof that one hosted model is always best. The reality is narrower: in this particular review, under these settings, local Qwen3.6 failed to find a known defect that Claude Sonnet 5 found consistently and Claude Haiku 5.5 found twice.

What it should change is how you assess a code-review system. Start with historical pull requests from your own repo where the fix is known. Replay the review task against those changes, then compare what the agent reported with what was later fixed. A useful test set has defects that require different kinds of work: mistakes in changed lines, issues that only show up once surrounding code is considered, edge cases in control flow, and failures that depend on behavior outside the diff.

For each run, track at least four things:

  1. Detection: Did the reviewer identify the real defect?
  2. Localization: Did it inspect the relevant code, and how much guidance did it need?
  3. Diagnosis: Did it explain the failure mechanism correctly, or just point at a nearby concern?
  4. Operations: How long did the run take, did tools work, and what did it cost in API fees or local resources?

Also keep false positives in your scorecard. A reviewer that flags lots of speculative issues can look productive while creating extra human work to separate signal from noise. And don't ignore consistency. Finding an issue once and missing it twice is usually less useful for a blocking review gate than for an optional second opinion.

Finally, test the workflow, not just the model name. Repo indexing, Git version, context limits, tool-call compatibility, and prompt design can all change outcomes. When you can, change one variable at a time. In this case, the function list improved localization but didn't reliably improve detection - strong evidence that search/navigation wasn't the only problem.

And then choose based on the cost of missing the bug you care about. If the advice is low-risk, a slower local model might be fine if privacy or predictable infrastructure costs matter. If the review is supposed to reliably catch expensive production defects, detection quality and failure visibility may matter more than API spend. In many teams, the most sensible setup ends up layered: deterministic automated checks, AI review for contextual analysis, and a human decision-maker for anything with real risk.

Key takeaways

  • Don't treat a single good demo as proof of reliability. Replay multiple known fixes and repeat each review.
  • Separate search from reasoning. In this test, the local model could reach the target function with guidance and still miss the defect.
  • Measure latency and integration failures. Tool-call behavior, Git compatibility, and context configuration shape the outcome.
  • Compare total operating cost, not just API fees. Hardware time, engineering time, and slower feedback loops count too.
  • Match the reviewer to the risk. The cheapest run isn't a bargain if it fails to catch the bug class you're trying to prevent.

Conclusion

This test is useful because it shows where an AI code review can fail in practice. Qwen3.6 struggled to reach the relevant function at first; with a function list, it did reach the code but still misread the key behavior. Meanwhile, Sonnet 5 found the defect in all three runs, and Haiku 5.5 found it in two at a much lower reported per-run cost.

Treat these results as a prompt to benchmark your own workflow, not as a universal verdict. Replay known bugs from your codebase, inspect the agent's work, and measure accuracy alongside latency, cost, and operational reliability. The best model is the one that performs acceptably on your risks - not the one that looks strongest in a single comparison.

Frequently Asked Questions

No. It compares three runs on one pull request, with one Qwen3.6 variant and a specific local configuration. The result shows a meaningful failure on this case, not a general ranking across repositories, programming languages, bug types, or model settings. Teams should replay their own historical fixes before drawing broader conclusions.
The list improved code navigation: in two runs, the model inspected the function containing the relevant behavior. But it still concluded that an existing budget check made extra handling unnecessary. The defect depended on an interruption occurring mid-file, so finding the code did not guarantee that the model would reason through the relevant edge case.
It had no model API charge in this test, but the run was not costless in the broader sense. It used a local computer, took nine to 25 minutes without guidance, and required configuration and troubleshooting. Hardware use, electricity, engineering time, and slower review feedback should be included when comparing local inference with hosted APIs.
Use historical pull requests with known fixes from your own repository. Run each configuration more than once, and record whether it found the bug, inspected the relevant code, explained the cause correctly, and completed the task within acceptable time and cost. Include false positives and tool failures, not just successful findings.

Related articles