alibaba /
open-code-review
Command-line AI code reviewer that checks Git diffs and leaves line-level comments
- 48.1k stars
- 4.8k stars since 3 Oct
- Go
- Updated yesterday
- Some experience
- Coding agents & dev tools
Open Code Review (the ocr command) is an AI code review tool that began as Alibaba's internal review assistant. It reads a Git diff, sends the changed files to an LLM you configure, and returns structured comments pointing at exact lines. The agent can open whole files, search the codebase and look at other changed files, so the feedback goes beyond the diff itself.
The README says general-purpose agents used for review tend to skip files on big changes, report wrong line numbers, and give uneven quality. This tool answers that with a hybrid design. Plain code decides which files get reviewed, groups related files into bundles that each run as a sub-agent, matches review rules to each file, and runs separate modules that check where comments land and whether they hold up. The LLM agent handles the judgment calls and fetching extra context.
The README compares it with Claude Code used for review. On the authors' own benchmark of 200 real pull requests, they report higher precision and F1 with the same model, about one ninth of the tokens, and lower recall. Treat those numbers as the project's own claims.
What it does
Several ways to pick what to review
ocr reviewcovers your working changes, a branch range or a single commit, and interrupted reviews can be resumed from a session.ocr scanreviews whole files or directories when there is no useful diff.Deterministic file handling
Code, not the model, selects files, bundles related ones (such as paired translation files) and runs each bundle as a sub-agent with its own context. This is meant to keep very large changesets stable.
Rule matching and comment checks
Review rules are matched to each file's characteristics, and separate modules check comment position and content. The README mentions a built-in multi-language ruleset and custom rules with path filtering.
Delegation mode
Your own coding agent can do the review with its own LLM while OCR handles file selection and rules, so no OCR API key is needed. Plugins exist for Claude Code, Codex, Cursor, Kimi Code and OpenCode.
CI and session viewer
It documents integration with GitHub Actions, GitLab CI, GitFlic CI and Gerrit. A browser viewer lets you replay sessions and mark comments as fixed or ignored.
What you could build
- Review a feature branch against main before opening a pull request.
- Add automated review comments to a CI pipeline on GitHub or GitLab.
- Scan an unfamiliar codebase or directory to audit it when there is no diff to review.
- Give Claude Code, Codex or Cursor a review command that uses the agent's own model.
- Write custom review rules so checks match your team's conventions.
Get started
You need Git 2.41 or newer. Install the package, run the provider setup to enter an API key and pick a model (or use delegation mode with a coding agent), then run the review command inside a Git project.
npm install -g @alibaba-group/open-code-reviewocr config providerocr reviewCommands are copied from the project's README. Read it on GitHub for the full setup.
More in Coding agents & dev tools
rea
MCP server that lets AI agents reverse engineer apps, binaries and websites locally