Updated 2026-11-16. Open Code Review is a code review CLI from Alibaba, installed as ocr, that reads a git diff, decides which rules apply to each changed file, then sends the work to a model you configure. It needs Git 2.41 or later. Rule selection happens without a model, and delegation mode needs no credentials.
ocr
# Copy-paste starter. Verify the release binary, then see what a review would cover. curl -sLO https://github.com/alibaba/open-code-review/releases/download/v1.13.10/opencodereview-linux-amd64 curl -sLO https://github.com/alibaba/open-code-review/releases/download/v1.13.10/sha256sum.txt sha256sum -c --ignore-missing sha256sum.txt # must print OK before you run it chmod +x opencodereview-linux-amd64 && mv opencodereview-linux-amd64 ocr cd your-project && ocr review --preview # file selection only, no model call
The project describes itself as a hybrid: deterministic pipelines plus an LLM agent, with line-level comments and a built-in multi-language ruleset covering null pointer exceptions, thread safety, cross-site scripting and SQL injection [1]. The useful half of that description is the order of operations. File selection and rule resolution run first, in code, and the model is called on a much smaller, already-classified set of files.
There are three ways to get a model, and the README is unusually clear about which one you are choosing [1]:
ocr review
/open-code-review:review
open-code-review
/open-code-review:delegate-review
open-code-review-delegate
ocr auth login
That third path appears in the command surface as auth, described as ChatGPT authentication, with login, logout, select and status subcommands. If your team already pays for one of these, knowing which row you are in decides whether you configure an API key at all.
auth
login
logout
select
status
The README gives the npm route as the primary install [1]:
npm install -g @alibaba-group/open-code-review
The release page publishes a static binary for each platform alongside a sha256sum.txt, so I took that route instead [3][4]. Downloading both, the published checksum matched before the binary ran:
sha256sum.txt
8a0cbf6dfaa1d8681ad3d854971623e34b3f51c4585d2c4ae352f1ff5eee5cb8 opencodereview-linux-amd64 opencodereview-linux-amd64: OK
The version banner confirms what is running:
open-code-review v1.13.10 (7e5ce06) linux/amd64 built at: 2026-11-15T02:44:01Z https://github.com/alibaba/open-code-review
One setup trap is worth naming because it costs time. The README's documentation links point at open-codereview.ai/docs/..., and on a direct fetch those paths return HTTP 404. The site root returns an HTML shell titled "Open Code Review" with no article text in it, so the deep pages are rendered in a browser and are not readable by a crawler or a curl. The sources that hold are the repository README and the plugin README [1][2], which is why this guide cites those and quotes the CLI's own help for everything else.
open-codereview.ai/docs/...
curl
The binary lists its own commands, and one line in it is the reason this tool is interesting:
Available Commands: auth Manage Sign in with ChatGPT authentication completion Generate shell completion scripts config Manage configuration settings delegate Output review spec for host-agent delegation (no LLM required) help Help about any command llm LLM utility commands review Start a diff-based code review rules Inspect and debug review rules scan Scan entire files (no diff required) session List and inspect saved review sessions version Show version information viewer Start the WebUI session viewer
review works on a diff, scan works on whole files when there is no history to diff against, and delegate produces a review specification for another agent. rules and session exist so you can debug what the tool decided and resume what it started, which is the difference between a review tool and a black box.
review
scan
delegate
rules
session
Start with --preview, which runs file selection without calling a model. On a scratch repository with one uncommitted edit, it prints the selection and the line counts:
--preview
Preview: 1 file(s) changed | +1 -1 Will review (1): [M] src/handler.js +1 -1
Then choose the scope. review defaults to the workspace, which is everything staged, unstaged and untracked, and the other modes narrow it [1]:
ocr review # workspace: staged, unstaged, untracked ocr review --from main --to feature-branch # merge-base range ocr review --commit abc123 # one commit against its parent ocr review --format json --output result.json # machine-readable, written to a file ocr review --format sarif --output results.sarif
The flags that matter for a team pipeline are the ones that control cost and noise before the model sees anything. --exclude takes gitignore-style patterns and merges with the rule file's own excludes, so generated code and fixtures stay out. --background takes a sentence of business context and --background-file takes a Markdown file, which is how you tell the reviewer what the change is supposed to do. --effort takes low, medium or high. --audience agent drops the progress lines and prints a summary, which is the mode to use when another program is reading the output.
--exclude
--background
--background-file
--effort
low
medium
high
--audience agent
The budget flag deserves a careful read because its failure behaviour is defined rather than implied. --max-tokens-budget caps total tokens for the run, is checked before every model round, and when a group is already over budget it gets one final round to submit findings and is then reported as failed(budget). Partial results are still published and the review exits 0, so a budget stop is not the same as a failed review, and it is the same shape as any agent that keeps buying work nobody asked for. It exits non-zero only when every selected item failed.
--max-tokens-budget
failed(budget)
Configuration can be interactive or scripted, and the non-interactive form is the one to put in a container image, in the same way a team decides who holds the model credential during a rollout [1]:
ocr config provider # interactive: provider, key, model, connectivity test ocr config set provider anthropic ocr config set model claude-opus-4-6 ocr config set providers.anthropic.api_key "$ANTHROPIC_API_KEY"
That last line is the one to treat carefully. Passing a key through the environment is the normal container pattern, and the CLI also accepts OCR_LLM_URL, OCR_LLM_TOKEN and OCR_LLM_MODEL, or the Anthropic equivalents, which its own error message names.
OCR_LLM_URL
OCR_LLM_TOKEN
OCR_LLM_MODEL
Delegation is the path for a team that already has a coding agent and does not want a second set of model credentials. The README's claim is that OCR handles file selection and rule resolution and the host agent performs the review, with no LLM configuration needed in OCR [1]. Running it confirms that on a machine with no provider configured at all:
# Files (1 reviewable / 1 total) - mode: workspace - total_insertions: 1 - total_deletions: 1 - `src/handler.js` [modified] +1/-1
The more useful output is delegate rule, which shows the exact instruction set the selected files resolve to. For a JavaScript file it is a built-in system group:
delegate rule
### Rule Group 1: system / **/*.{ts,js,tsx,jsx,mjs,cjs} Applies to: - src/handler.js #### Content #### Obvious Typos or Spelling Errors - Spelling errors in variable names, function names, component names, or Props property names #### Dead Code - Code blocks that will never be executed (e.g., branches where the condition is always false, code after a return statement) - Variables that are declared but never read or referenced #### Code Quality Checks - **Duplicate Code**: Check for common logic that can be extracted - **Variable Declarations**: Using `var` is strictly prohibited; use `let` or `const` - **Equality Comparisons**: Using `==` and `!=` is prohibited; use strict equality `===` and `!==` - **Null Checks**: Perform null checks when accessing values or destructuring to avoid null pointer exceptions - **Ternary Expressions**: Nested ternary expressions are not allowed
A Go file resolves to a different group, and its opening paragraph explains the design better than any summary could:
File: src/handler.go Source: System built-in Pattern: **/*.go #### Go Review Principles > Favor precision over recall: report only defects that are likely real in the changed code and its > reachable context. A false positive costs reviewer trust. Treat correctness and security findings > as blocking; style-only suggestions are non-blocking. Do not duplicate findings that `go vet`, > Staticcheck, `go test -race`, the compiler, or `gofmt` can determine reliably unless the diff shows > a concrete user-visible consequence those tools will not express.
That instruction to stay out of the way of go vet and staticcheck is the most useful sentence in the whole tool, because it is the rule most agent-written reviews break. A reviewer that repeats what the linter already said is how a team learns to ignore review comments, which is the failure mode that makes agent review worse than none.
go vet
staticcheck
If you want to see which rule applies to a path without running anything, rules check answers it in two lines:
rules check
ocr rules check src/handler.go
Four error paths, each reproduced here rather than described. They share a shape: a single Error: line and exit code 1.
Error:
Running a review with no provider configured anywhere:
Error: resolve LLM endpoint: no valid LLM endpoint configured; one of OCR_LLM_URL/OCR_LLM_TOKEN/OCR_LLM_MODEL, ~/.opencodereview/config.json, or ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN/ANTHROPIC_MODEL must be set
Passing a commit or a branch that does not resolve:
Error: --commit value "deadbeef" is not a valid commit ref: fatal: Needed a single revision Error: --from value "no-such-branch" is not a valid commit ref: fatal: Needed a single revision
Both git-backed messages carry the underlying git text, which is worth knowing when you script the tool: the wording after the colon comes from git, not from ocr, so a parser should match the prefix rather than the whole line. And review --preview prints No files changed. on a clean tree with exit 0, which is easy to mistake for a passing review when it only means there was nothing to look at.
review --preview
No files changed.
For a full-file pass with no git history, scan runs a different pipeline, and its flags expose the stages:
--batch string override BATCH_STRATEGY: none | by-language | by-directory --no-dedup skip the per-batch DEDUP_TASK --no-plan skip the per-file PLAN_TASK pre-pass --no-summary skip the post-run PROJECT_SUMMARY_TASK
A plan pass, a per-batch dedup and a project summary are three separate stages you can turn off, which tells you where the time and the tokens go when a scan feels expensive. --exclude and the token budget exist here too.
Do I need an API key to try it? No. delegate preview and delegate rule print the file selection and the resolved instructions without contacting a model, so you can evaluate the rule engine before you configure any provider.
delegate preview
Does it use my Claude Code subscription? Not through the ocr review path, which reads OCR's own provider configuration. The delegation path is the one that uses your host agent's model and authentication [1].
What Git version do I need? Git 2.41 or later, because the tool relies on Git for diff generation, code search and repository operations [1].
Can I get SARIF for an existing code scanning view? Yes, --format sarif --output results.sarif, and --format json for a pipeline that wants to read the findings itself.
--format sarif --output results.sarif
--format json
What happens when the token budget runs out mid-review? A group already over budget gets one final round to submit findings and is reported as failed(budget). Partial results are published and the review exits 0. It exits non-zero only if every selected item failed.
Where is the official documentation? The repository README and the plugin README are readable and accurate [1][2]. The website's deep documentation paths returned HTTP 404 to a direct fetch on 2026-11-16, so do not rely on them from a script.
[1] Alibaba, Open Code Review README, fetched 2026-11-16, 14 KB. Source of the hybrid architecture description, the built-in ruleset scope, the prerequisites, the npm install, the three model paths and which credentials each uses, the quick start commands and scope modes, and the configuration commands.
[2] Alibaba, Open Code Review Claude Code plugin README, fetched 2026-11-16, referenced for the Claude Code install steps, the /open-code-review:review and /open-code-review:delegate-review commands, and the two skill names that separate OCR-called models from host-agent-called models.
[3] Open Code Review release v1.13.10, fetched 2026-11-16. Source of the platform binaries, the version tag, and the asset list used for the install in this guide. The binary downloaded from here was run for every command, flag, payload and error quoted above.
[4] Open Code Review published checksums, fetched 2026-11-16 and used to verify the Linux binary before execution. The published digest for opencodereview-linux-amd64 is quoted in the install section.
opencodereview-linux-amd64
[5] Alibaba, Open Code Review repository, fetched 2026-11-16, referenced for the project description, the rule scope it claims for its built-in ruleset, and the release layout.
If you are putting a reviewer like this into a team's pipeline, the decisions that matter are the same ones behind a security scanner in CI and the credential placement around agent tooling: who owns the findings, what happens when the budget stops a run, and whether the tool repeats what the linter already said. The tool is the small part. If you want that pipeline running in your own repository, send a written intake and we will tell you what we would change first.
Maxpertise is an AI-native engineering company. We embed native AI engineers inside your team, live in about 10 days. Please enable JavaScript to view the site, or email contact@maxpertise.net.