Open Code Review CLI: Try Alibaba’s Tool on One Pull Request

Updated
8 min read
Open Code Review cover with two Git diff sheets and a review comment.
TL;DR

Run Alibaba’s Open Code Review on a small Git diff and decide which comments are worth a human reviewer’s time.

Alibaba’s Open Code Review CLI gives you a way to ask for a second look at a Git diff before you open a pull request. Start with a small branch you already understand. If the review points to a real issue and you can explain it from the code, you have learned more than you would from a long list of comments on an unfamiliar repo.

The upstream repository describes a review pipeline that selects the code and rules, then asks a model to inspect the change and relevant context. The project’s authors explain their design in the OpenCodeReview preprint. Treat its results as evidence from the authors’ evaluation. The number worth measuring for your team is how often a comment survives your own review.

Set up one provider on a small repository

Check the official releases and choose a release your team is comfortable installing. Alibaba documents Git 2.41 or newer. If you use npm, the package name includes the organisation scope:

sh
npm install -g @alibaba-group/open-code-review
ocr config provider
ocr config model

These are the native review commands. The model you configure there receives the request, so start with a non-sensitive project and confirm where the provider sends data. The CLI runs in your terminal, while inference depends on the provider. For teams that use the delegation skill, the host coding agent handles the review using its own model and authentication.

Give the review an explicit Git range

In your feature branch, compare against the base branch. This example assumes your local repository has a current remote-tracking branch named origin/main. Check that it matches the target of your pull request.

sh
git diff --stat origin/main...HEAD
ocr review --from origin/main --format json --output review.json

The first command tells you whether you have the right comparison. The second asks OCR to review the branch relative to that base. A bare review command also considers staged, unstaged and untracked changes, which makes it useful for some local tasks. For a pilot, an explicit base keeps the comparison reproducible. Keep the JSON file out of the commit unless your team has a reason to store it.

If the tool needs repository guidance or you want it to focus on a particular area, record the test commands and project boundaries your team already uses. The Pristren AGENTS.md guide has examples of those instructions for coding agents.

Decide which comments earn a place in a PR

Take a small change to a tag importer. A useful finding might point out that the new blank-value branch returns early after the first row, leaving valid rows behind it unprocessed. Read the loop and reproduce the condition with two rows. If the finding holds, attach the test to the review comment. Our test-first skill guide shows a small way to turn the claim into a durable test.

Prepare a branch with one finding you already know

A useful trial branch has a change whose behavior you understand. Start from a demo repository or a project whose use has been approved. Add a small patch with one known issue and, if you can, one nearby change that is correct. Write down the known issue before running the review. Otherwise it is easy to mistake a plausible explanation for a result you would have predicted from the code.

For the tag importer example, add a blank line before two valid rows. The service is meant to skip the blank row and continue. The changed loop returns early. A focused fixture can demonstrate the problem by checking that both valid rows are still imported. Keep the fixed version and any existing regression tests nearby so you can review the tool’s claims even if it points to the wrong line.

Make a note of the boundaries for this experiment. Which source files were changed? Does the tool need to inspect an adjacent validation helper? Can it read anything outside the project root? If a settings file or a fixture contains personal data, choose a different test repository. An ordinary review prompt can unintentionally add sensitive files to the analysis if you begin with an unbounded workspace. Confirm the relevant access and provider controls before supplying a real project.

Read the findings from strongest evidence to weakest

Open the JSON report next to the patch. Match each finding to the file and line it references, then read the nearby control flow. In the importer example, a statement about a premature return should be traceable to a concrete input and an observable result. If the tool mentions a dependency or code path, confirm that it exists and that the modified code reaches it.

A useful team note can be very short:

Click any column to sort
4 rows
FindingThe change the tool says is wrong, using the application’s own language
EvidenceThe input, line, or test that reproduces the behavior
DecisionConfirmed, already covered, or unsupported by the patch
Next stepFix, keep a test, or leave the PR unchanged

Keep each decision attached to one finding. “The review seemed good” is difficult to use when comparing versions. A confirmed finding plus its reproducer survives a change of model, branch, or review tool. An unsupported finding with a reason can help you choose what to ignore the next time.

A report may include advice that would be reasonable in a different implementation. If the tool suggests deduplicating tags while the feature explicitly preserves duplicates, the rule for the current ticket controls the decision. If it flags style issues already covered by your linter, note that duplication. A review tool earns its place by finding useful behavior the team can verify, not by repeating every issue the existing pipeline already reports.

Compare native review with delegation on the same scope

The upstream project documents a native mode that uses OCR’s configured provider and a delegated mode in which a host coding agent does the analysis. Try the mode your team can support, then keep the commit range fixed if you evaluate the other. Without that common range, differences in report length can be caused by the set of files the reviewer saw.

Record the reviewer’s inputs and the interface you actually ran. If the host agent had access to extra tools or repository instructions, include that in the notes. Plan for how each mode authenticates, which model endpoint gets the context, and what your organization permits the workspace to read. The data-flow guide for Claude Code offers a way to separate local tool activity from network requests when another agent is involved.

If you do not need to compare both modes, a small native test is sufficient to learn whether the tool fits the team. Install an approved version, point it at one well-understood change, and review the report together. Run with a single configuration long enough to recognize what a useful result looks like before changing more than one settings file.

Pilot the report before making CI depend on it

A local review leaves the developer free to inspect the report before sharing anything. When you move to pull requests, run it on a small set of diffs with a reviewer assigned to read the output. Use the same version and the same comparison base during that period. Decide what happens when the provider is unavailable. A failed model request, a malformed report, and a rejected pull request are different states.

For CI, decide how to store or discard review artifacts, which account can run the job, and which branches can see its output. Keep credential handling within the team’s established CI controls. Be careful with contributions from forks, where the code under review may be outside the organization’s trust boundary. The provider and repository owners should be able to describe which files are visible to the review process.

Run the usual unit tests, static checks, and human review alongside the pilot. The report can point to an overlooked case. The focused test and diff help decide whether that case blocks the PR. The AI agent TDD skill example shows how to turn one confirmed finding into a check that keeps running after the review is over.

Track the result the team cares about

After a handful of reviews, count results in terms the maintainers understand. Record how many findings were confirmed, how much work they took to verify, and how many important issues a human found first. Store the model and release with those numbers so a future comparison uses known inputs.

One practical decision rule is to keep the pilot going if reviewers regularly take useful action from the report and can dismiss low-value comments quickly. If most comments are reminders covered by other checks, narrow the scope or keep the tool local for particular kinds of change. Start with the smallest workflow where it can help, then use the evidence you collected to decide what should become routine.

For the first few reviews, log the release, model, commit range, confirmed findings, and false alarms. Add anything a human found that the CLI missed. If you later move it into CI, start by collecting findings for a reviewer to triage. Keep the team’s existing approval rules and use the pull request verification checklist to decide what evidence belongs with a change.

Frequently Asked Questions

Which npm package installs Alibaba’s Open Code Review CLI?

Alibaba’s repository documents @alibaba-group/open-code-review as the npm package. Verify the package and release from the upstream project before installing.

What changes does ocr review inspect by default?

The project documents workspace mode for the bare command, covering staged, unstaged, and untracked changes. Use an explicit comparison or commit for a narrower review.

Can I use OCR without giving it a separate model key?

The delegation skill uses the host coding agent’s configured model and authentication. Native OCR review uses the model provider configured in OCR.

#developer-tools#code-review#git#open-source

One AI engineering post, weekly

LLM benchmarks, prompt techniques, and token-cost breakdowns, delivered to your inbox.

What should we test or explain next?

Comments

Have a question or something to add? Sign in to join the discussion.

Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

Software architect, full-stack engineer, and machine learning practitioner. Founder & CEO of Pristren, CTO at Venture Kick-backed PIN Sport Application GmbH (Basel, Switzerland), Software Development Lead at DailyFrame GmbH (building Dimetra patient transport software), and creator of Zlyqor. Focused on custom workflow automation, scalable web and mobile applications, and production AI/ML systems.