Alibaba's Open Code Review: a hybrid CLI review agent that uses 9x fewer tokens and runs on Claude Code or CursorArticle · digest for December 5
Studio still life of a hybrid CLI code-review agent: a precise mechanical ruler with diff markings beside a compact optical model unit in a graphite and warm palette
Article4 sections≈ 7 min

Alibaba's Open Code Review: a hybrid CLI review agent that uses 9x fewer tokens and runs on Claude Code or Cursor

When you hand a large pull request to a general coding agent like Claude Code or OpenAI Codex, you almost always get back a neat, confident report. It looks solid. The catch shows up later: the agent never even opened some changed files, and line numbers in its comments are off by half a screen.

Alibaba engineers tested their own AI reviewer internally for two years across tens of thousands of developers, then open-sourced it under Apache-2.0 in May 2026. Open Code Review (command ocr, latest release v1.14.9 on December 4, 2026) is written in Go and has passed 58,000 GitHub stars. The idea is simple: anything you can't trust to an LLM's imagination should be handled by deterministic code.

Why general agents stumble on large PRs

General coding agents review code by following text prompts. When a diff has three files and a hundred lines, that works fine. On a big pull request, three issues show up right away.

First is incomplete coverage. The model starts cutting corners: it reads the first few files closely, then skims or silently skips the rest. Even so, the final report makes it look like the entire PR was checked.

Second is position drift. The agent spots a real bug, but posts the comment on a nearby line or even the wrong file. On GitHub's web UI, you have to hunt down what the model actually meant.

Third is inconsistent quality and a flood of noise. Tweak the prompt slightly, and the bot complains about totally different things. A general agent also loops over extra read and search calls, burns millions of tokens, and buries PRs in false alarms. Teams quickly get tired of the spam and turn the bot off.

The hybrid setup: strict Go code and a focused agent

Open Code Review splits the job in two. Every step that needs 100% predictability is handled by a deterministic Go pipeline with no LLM involved.

First, the CLI selects files to review and filters out noise like auto-generated lockfiles. No important file gets dropped just because the model 'lost patience'.

Next comes smart file bundling. Related files, like two localization files message_en.properties and message_zh.properties or an interface and its implementation, are grouped into one bundle. A separate sub-agent checks each bundle in a clean, isolated context, and bundles run in parallel. Quality stays steady even across a hundred files.

Then a template engine selects targeted rules. Instead of one huge wall of instructions, the CLI checks the language and file type and gives the agent only relevant checks. Built-in multi-language rules cover null pointers (NPE), thread safety, XSS, and SQL injection.

The model itself only steps in where real reasoning is needed: reading a full file, searching the repo, and checking neighboring edits. Its toolset is trimmed and tuned on Alibaba's production traces, so it doesn't wander in circles. After analysis, two external modules take over: one pins comments to exact diff lines, and a reflection module double-checks findings to filter out noise.

What AACR-Bench numbers show

To back the architecture with data, the team released AACR-Bench and a Hugging Face dataset (details in preprint arXiv:2601.19494). It covers 50 open-source repos, 200 real pull requests, and 10 languages including Go, Python, TypeScript, C++, Java, and Rust. Over 80 senior engineers verified the labels: v1 has 1,505 confirmed bugs and 640 false-positive comments for filter testing, while v2 has 944 high-value comments across 151 PRs.

In comparisons, the same models ran through Open Code Review and general agents. The difference in token hunger was huge.

Average tokens per PR on AACR-Bench

On the exact same models, the hybrid pipeline uses roughly nine times fewer tokens on average and finishes several times faster. Isolated bundles keep context small, and a trimmed toolset stops the model from re-reading files endlessly.

Open Code Review results on AACR-Bench compared to Claude Code and Codex (Source: Alibaba / open-code-review)

If you look closely at the chart, Open Code Review trails Claude Code on Recall (the share of all real bugs found). That trade-off is intentional to boost Precision (the share of bot comments that point to real bugs).

One test on Claude-4.6-Opus makes this clear. To find 435 real bugs across 200 PRs, Claude Code posted 5,980 comments (nearly 30 per PR), and over 92% were noise. Open Code Review on the same model left 889 comments (just over four per PR) and caught 301 real bugs. Less spam means developers actually read the review. Just keep one detail in mind: Alibaba's own team built the benchmark, even though the evaluation code and dataset are fully open.

Install, run, and choose between Native and Delegation

You need Git 2.41 or higher, so older LTS systems like Ubuntu 22.04 (with Git 2.34) will need a Git upgrade. You can install via npm (requires Node.js 14+), Homebrew, a standalone binary without Node.js, GitHub Releases, or building from source. If you want to trigger reviews inside Claude Code, Cursor, Codex, Google Antigravity, or Kimi Code, install the Agent Skills (SKILL.md instructions) as well.

# Install CLI via npm (requires Git >= 2.41 and Node.js >= 14)
npm install -g @alibaba-group/open-code-review

# Or native binary without Node.js (Linux / macOS)
curl -fsSL https://open-codereview.ai/install.sh | sh

# Add skills for Claude Code, Cursor, Codex, and other agents
npx skills add alibaba/open-code-review

After installing, you get the global ocr command and editor skills. If you installed via npm and run it in CI, set OCR_NO_UPDATE=1: the npm wrapper quietly checks for updates every 18 minutes in the background, which you don't want in reproducible builds.

Next, pick between Native Mode and Delegation Mode. The difference is who calls the LLM and whose key pays for it.

SettingNative ModeDelegation Mode
Agent skillopen-code-reviewopen-code-review-delegate
Who calls the LLMocr CLI itselfYour host agent (Claude Code, Cursor, etc.)
Separate API keyRequired (or ocr auth login)Not needed; uses your editor subscription
Full pipeline (bundles, positioning, reflection)Yes, plus --effort high and --analysisNo, only file selection and rule matching

A Claude Team or Pro subscription doesn't act as an API key for Native Mode. If you don't have a separate key and want to try it today, pick Delegation Mode. In that mode, ocr doesn't call any LLM: it hands the host agent a file list and matching rules, and your editor runs the review under your current subscription.

If you do have an API key (it supports 26 built-in providers including Anthropic, OpenAI, Gemini, DeepSeek, OpenRouter, DashScope, and custom endpoints), Native Mode unlocks the full pipeline. A basic terminal workflow looks like this:

# Set provider and model (Native Mode only)
ocr config provider
ocr config model

# Review current branch changes against main
ocr review --from main

# Export JSON output for CI or a host agent
ocr review --format json --output result.json

# Delegation Mode without an API key: file list and rule matching
ocr delegate preview --from main --format json
ocr delegate rule --from main --format json src/main.go src/handler.go

For tricky changes in Native Mode, add --effort high (three review rounds) or --analysis to check impact on callers. You can resume an interrupted session with --resume <session-id> and inspect results in the browser with ocr viewer.

Auditing existing code without a git diff

If you want to audit an unfamiliar folder or an old module without a fresh PR, run ocr scan --path internal/agent. It reads whole files without relying on commit history and applies the same rules.

Keep two limits in mind: ocr review acts as an MCP client to call external tools, but it doesn't act as an MCP server itself. Also, in GitHub Actions, the built-in PR comment helper requires OCR_HOME to remain unset. Other settings and CI templates are in the official docs.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 5