RSS
Tools

open-code-review: a Go CLI that reviews Git diffs with a model and line-level comments

alibaba/open-code-review is a command-line code review tool that reads a Git diff, sends the changed files to a model you choose, and returns comments tied to specific lines.

Two people working on code at monitors in a bright office, illustrating the open-code-review ocr CLI
Photo by Compagnons on Unsplash

alibaba/open-code-review gives a working developer a second pair of eyes on a change before it merges. You run one command in a repository, the tool works out which files changed, asks a language model to read them with the surrounding code for context, and hands back findings placed against the lines they concern.

Quick facts

The tool is a command-line program called ocr, written mainly in Go. Its licence is Apache-2.0. The newest release is v1.13.10, published on November 15, 2026, and the repository had about 52,800 GitHub stars as of November 17, 2026.

  • Platforms: Windows, macOS and Linux, with release binaries for Intel and Arm machines.
  • Requirements: Git 2.41 or later, plus Node.js 18 or later only if you install through npm.
  • Language: mainly Go.
  • Cost: Apache-2.0 licence; the model calls go through a provider account of your own.
  • Latest release: v1.13.10, published November 15, 2026.

How to install

Install the newest release, since only that one gets security fixes. The documentation recommends npm; Homebrew works on macOS and Linux, and a shell installer or a release binary covers machines without Node.js.

npm install -g @alibaba-group/open-code-review
brew install open-code-review
curl -fsSL https://open-codereview.ai/install.sh | sh

The shell installer covers macOS and Linux on Intel and Arm processors. On Windows, use the PowerShell installer instead, which needs PowerShell 5.1 or later.

irm https://open-codereview.ai/install.ps1 | iex

The releases page also offers a static binary for each platform, with names such as opencodereview-darwin-arm64 or opencodereview-windows-amd64.exe, plus a sha256sum.txt checksum file. Rename the binary to ocr and put it on your PATH. Whichever route you used, check the install with the command below.

ocr version

The npm wrapper also checks for a newer version in the background, with an 18-minute cooldown between checks, and upgrades on its own unless you turn that off with the command below.

export OCR_NO_UPDATE=1

Building from source needs Go 1.26.10 or later, Git and Make.

git clone https://github.com/alibaba/open-code-review.git
cd open-code-review
make build

The build writes dist/opencodereview, or dist/opencodereview.exe on Windows. Copy it to a directory on your PATH under the name ocr.

First setup

A review needs a model, so connect one first. The interactive setup below lets you pick a provider, enter an API key and choose a model, then saves them and runs one connection test.

ocr config provider

Later, the first command below switches models and the second re-checks the connection.

ocr config model
ocr llm test

Settings live in ~/.opencodereview/config.json. Built-in providers include Anthropic, OpenAI, OpenRouter, DeepSeek, Gemini and DashScope. Most need an API key, which can come from an environment variable, and ANTHROPIC_ variables already set for Claude Code, or the tool's own OCR_LLM_ variables, are picked up without a config file. A Claude Code subscription login is not used, except in delegation mode, described below, where your coding agent reviews with its own model and subscription.

What stands out

Five things set this tool apart from asking a general coding agent to look at a diff.

  • Fixed steps stay in code, not in a prompt. Code decides which files need review and which rule applies to each one. Grouping related files into review units is a single model call that sees only paths, status and line counts, never the code; with fewer than four changed files, grouping happens locally without that call. The model then reads, judges what matters and fetches extra context.
  • Comments are checked for position as well as content. Separate positioning and reflection steps work on the findings after the model produces them, so a comment is more likely to land on the line it describes.
  • Rules are built in and can be replaced per project. The main branch holds 66 rule documents, from Go, Java and Python to Rust, Move and configuration files. A project can add rules in .opencodereview/rule.json, a user can add wider ones in ~/.opencodereview/rule.json, and a single run can load a rule file with --rule. A matching user rule replaces the built-in one unless the entry sets merge_system_rule to true; merging works only with the built-in layer, not between your own files.
  • It covers more than one diff. It can review the workspace (staged, unstaged and untracked changes), a branch range since the branches diverged, a single commit, or, with a scan, whole files that have no useful diff. A preview lists the files that would be reviewed without any model call. An interrupted review can be resumed only if the mode, the resolved input and the selected files are unchanged, and for a workspace review the worktree too; otherwise the resume is rejected before any model call.
  • Delegation mode turns the tool into scaffolding for another agent. The tool handles file selection and rule lookup, while the host agent, such as Claude Code or Codex, reviews with its own model and subscription. ocr delegate preview lists the files, and ocr delegate rule takes one or more of those paths, as in ocr delegate rule src/main.go src/handler.go, and returns their rules.

The project also publishes its own benchmark, built from 50 open-source repositories, 200 real pull requests and 10 programming languages, with 1,505 annotated issues cross-checked by 80-plus senior engineers. Against Claude Code using the same model, it reports higher precision and F1 at about one ninth of the tokens, and lower recall, which it calls a deliberate choice of precision over noise. These are the project's own numbers, not an independent test.

How it was built with Claude

The repository has a short rule file for AI assistants. CLAUDE.md contains only a reference to AGENTS.md, and AGENTS.md requires a contributor to say in the first issue or pull request that AI was used, and which tools and models. It also asks contributors to understand every AI-written line, requires them to explain a change in their own words, and forbids crediting a commit to an AI system through a trailer such as Assisted-by or Co-developed-by.

The recent history fits that rule. In the latest 100 commits, covering September 22 to November 15, 2026 and 52 distinct author names, 69 carry Co-authored-by lines, but they name individual GitHub accounts and, once, dependabot; none names Claude or another AI model. Earlier, across all 861 commits up to November 15, 2026, 13 commits made between June 2 and August 25, 2026 carry Co-Authored-By trailers for Claude models, six more name Cursor or Copilot, and one of the Claude commits also credits Codex. AGENTS.md also tells contributors to run this tool on their change before committing.

ocr review --audience agent --background "briefly summarize the background requirements"

Try it with your AI. Paste this into your own AI assistant to set up project review rules like the ones this tool uses, for a repository of your own.

Help me set up code review rules for my own repository, modelled on the review rules in
alibaba/open-code-review. First check that I have Git 2.41 or later and the ocr command
installed; check for Node.js 18 or later only if I tell you I installed ocr through npm.
Tell me what is missing before doing anything else. I will give you the repository path
in [repository path], the languages and file types I care about in [languages and file
types], and one representative file in [file path]. Use only these official commands:
ocr review --preview to see which files would be reviewed and why others are left out,
ocr rules check [file path] to show which rule applies to that file, ocr review for a
workspace review, ocr scan for a whole-file scan, and, if I say I want delegation mode,
ocr delegate preview followed by ocr delegate rule with the file paths that preview
listed. Model setup is my job: I will run ocr config provider, enter my API key myself,
and run ocr llm test to check it, so do not run those for me. Draft a project rule file
at [repository path]/.opencodereview/rule.json with exclude patterns, include patterns
only where a built-in default exclusion must be bypassed (include is a bypass, not a
whitelist), and a small set of rules for [languages and file types]. Follow the
four-layer priority order: the --rule flag, the project file, the global file at
~/.opencodereview/rule.json, and the built-in system rules. Set merge_system_rule to
true only where a rule should add to the built-in rule instead of replacing it. Show me
the draft file and the risky steps first, and wait for me to confirm before you write,
change, or run anything. Do not install anything from unknown sources, do not touch
credential files, do not delete anything, and do not ask for or use any API key or
token.

Known limits

A review sends your changed code to the model provider you configured, so the code leaves your machine. Do not review code you are not allowed to share, and read the provider terms for your account. There is no built-in secret redaction, so keep secrets out of commits and exclude files that hold them. The project states that API keys are never written to review output files or sent beyond the configured endpoint, and that telemetry is off by default.

The model must support native tool calling, since reviews run entirely through tool calls. The documentation gives deepseek-r1 as an example that fails, since it narrates tool calls in text instead of making them, and qwen3 as one that works. A model without that support loops through retries and ends with no comments.

Very large changes can be skipped in part. Each review group has a prompt ceiling of 200,000 tokens by default for ocr review and 58,888 for ocr scan, changeable with --max-tokens or a saved max_tokens setting, and a group whose opening prompt passes 80 percent of it is skipped while the rest continue. Output is capped separately at 16,384 tokens. Each group also gets 100 tool-use rounds by default, or 60 in a scan, which --max-tools can raise for a review; a group that runs out without a completion call keeps the comments it collected, and the other groups carry on.

Some files are never reviewed. Binary files have no text to review, deleted files have no new content, and files under dependency directories such as vendor and node_modules at the repository root cannot be made reviewable, even with an include rule. Comments can also lose their exact position, with both line numbers at zero, when the model paraphrases the code instead of copying it from the diff, or when CRLF line endings or mixed tabs and spaces break the match.

Two smaller points. Version v1.13.8 removed the --tools override, so old invocations fail with an unknown flag error; project guidance now goes through review rules or --background. And if the shell installer downloads through a GitHub mirror, the mirror serves both the binary and its checksum, so a dishonest mirror could serve a changed binary with a matching checksum; check the file against sha256sum.txt on the releases page when you cannot trust the mirror.

Problems and feedback

Report bugs and feature requests through GitHub issues at https://github.com/alibaba/open-code-review/issues, with the steps you ran and the full output; blank issues are disabled, so pick a template. Questions and ideas go to the matching Discussions categories. Report a security vulnerability privately at https://github.com/alibaba/open-code-review/security/advisories/new, not in a public issue, and expect an acknowledgement within three business days.

Source: alibaba/open-code-review repository, README, Releases, Installation documentation, Quickstart documentation, Configuration documentation, Review rules documentation, FAQ, Telemetry documentation, Delegation mode documentation, Security policy, Security assurance case, AGENTS.md

This story first appeared in the claudefox daily briefing for November 16, 2026.