Alibaba's Open Code Review pairs deterministic pipelines with an agent for code review
Open Code Review, Alibaba Group's internal AI code review assistant, is now an Apache-2.0 Go CLI that reviews Git diffs or whole files with line-level comments from a configurable LLM.
What the project is
alibaba/open-code-review is an AI-powered code review CLI tool. According to the README, it originated as Alibaba Group’s internal official AI code review assistant, which over the past two years served tens of thousands of developers and identified millions of code defects before it was incubated into an open source project. Getting started requires configuring a model endpoint.
The repository is written in Go, licensed under Apache-2.0 and was created on 2026-05-18. As a snapshot at the time of writing, it had 50487 stars, 206 of them gained in the last day on GitHub trending, and 3747 forks. The project description lists a built-in multi-language ruleset covering NPE, thread-safety, XSS and SQL injection, and says the tool is OpenAI and Anthropic compatible.
How a review works
The tool reads Git diffs, sends changed files to a configurable LLM via an agent with tool-use capabilities, and generates structured review comments with line-level precision. The agent can read full file contents, search the codebase and inspect other changed files for context. Beyond diff review, ocr scan reviews entire files, which is meant for auditing unfamiliar codebases or directories that have no meaningful diff.
Why not a general-purpose agent
The README names three pain points it sees when general-purpose agents with Skills are used for code review:
- Incomplete coverage: on larger changesets, agents tend to review only some files and miss others.
- Position drift: reported issues often do not match the actual code location.
- Unstable quality: review quality fluctuates significantly with minor prompt variations.
Its diagnosis is that a purely language-driven architecture lacks hard constraints on the review process. The response is a hybrid. Deterministic engineering handles the steps that must not go wrong: precise file selection, smart file bundling, fine-grained rule matching, and separate modules for comment positioning and comment reflection. Bundling groups related files, for example message_en.properties and message_zh.properties, into one review unit, and each bundle runs as a sub-agent with isolated context. That divide-and-conquer design is what the README credits for stability on very large changesets and for concurrent review.
The agent keeps the dynamic parts: decisions and context retrieval. Its prompt templates and toolset are tuned for code review, with the toolset distilled from tool-call traces in large-scale production data.
The benchmark claim
The README reports results on AACR-Bench, built from 50 popular open-source repositories, 200 real pull requests and 10 programming languages, with 1,505 annotated ground-truth issues cross-validated by 80+ senior engineers. Compared to Claude Code with the same underlying model, it says Open Code Review achieves significantly higher precision and F1 while consuming only about 1/9 of the tokens. It also states that recall is lower, a deliberate trade-off favoring precision over noise. The dataset is published on Hugging Face.
Trying it
The tool needs Git 2.41 or newer. Installation is through npm, after which the ocr command is available globally:
npm install -g @alibaba-group/open-code-review
ocr config provider
ocr config model
ocr review --from main --to feature-branch
Plain ocr review covers all staged, unstaged and untracked changes in the workspace, and --commit reviews a single commit. Interrupted reviews can be resumed by session ID, and --format json --output result.json saves results to a file. A delegation mode lets a host coding agent run the review with its own model while OCR handles file selection and rule resolution, so no separate LLM configuration is needed. The documentation also covers CI/CD integration for GitHub Actions, GitLab CI, GitFlic CI and Gerrit, an MCP server, a session viewer and OpenTelemetry telemetry.