open-code-review

Repo

A Go CLI that reviews Git diffs with an LLM agent and returns line-level comments, with built-in rules.

55.2k4.6kGoApache-2.0

Claim this listing

Made open-code-review? Claim it to edit the listing and see how many people view it. Sign in to claim

open-code-review is a command-line code reviewer from Alibaba that reads your Git diff and posts structured, line-level comments using a model you choose. It is for developers who want AI review without a hosted service.

It is written in Go, uses the Apache-2.0 license, and has about 55,000 stars. The README says it began as Alibaba's internal code review assistant before being released as open source.

Table of contents

  1. What open-code-review does
  2. Key features
  3. How to get started
  4. Who should use it, and when to skip it
  5. open-code-review alternatives
  6. License and cost
  7. FAQs

What open-code-review does

The tool, invoked as ocr, reads the changes in a Git repository, splits them into review units, and sends them to a configurable LLM through an agent that can use tools. The agent can read full files, search the codebase and look at other changed files for context before it writes a comment.

The design idea in the README is a hybrid. Steps that must not go wrong are handled by ordinary code, and the model handles the judgment calls. Deterministic code picks which files to review, bundles related files together (a pair of translated .properties files is the README's example), matches rules to each file, and runs separate modules that check comment position and content. The agent then decides what context to fetch and what to say.

The README argues this fixes common problems with general-purpose agents used for review: skipping files on large changesets, comments pointing at the wrong line, and quality that shifts with small prompt changes. It publishes a benchmark of 200 pull requests from 50 open-source repositories across 10 languages, and says open-code-review beats Claude Code on precision and F1 with the same model while using about one ninth of the tokens. It also says recall is lower, and calls that deliberate. Fewer false alarms and a few more missed issues is the trade.

Key features

  • Review modes for your working tree, a branch against main, a branch range, or a single commit.
  • A full-file scan command for reviewing whole files rather than a diff.
  • Sessions you can list and resume after an interrupted review.
  • Built-in multi-language rules covering null pointer errors, thread safety, XSS and SQL injection.
  • JSON output to a file, which the README recommends when another AI agent calls the tool.
  • Delegation mode, where your own coding agent does the reviewing and OCR only handles file selection and rules.
  • Agent skills for Claude Code, Codex, Cursor, Kimi Code and other agents that run local commands.
  • Compatibility with OpenAI and Anthropic style model endpoints.

How to get started

You need Git 2.41 or newer. Install the skills into the project you want to review and pick your agent in the installer:

npx skills add alibaba/open-code-review

Or install the CLI globally:

npm install -g @alibaba-group/open-code-review

Then set up a provider and model with the interactive prompts:

ocr config provider
ocr config model

Review your current changes, or a branch against main:

ocr review
ocr review --from main

If you have no separate API key, the README suggests starting with delegation mode, which uses your host agent's own model and login. It notes this skips OCR provider setup but not the host agent's costs or usage limits.

Who should use it, and when to skip it

It suits solo developers and small teams who want a second reviewer on every change, and who are comfortable choosing and paying for an LLM endpoint. The CLI shape makes it easy to run before a push or inside CI, and the JSON output suits scripts.

Skip it if you want a hosted bot that comments on pull requests with no setup, since this is a local CLI that you configure. Skip it if maximum recall matters more than noise, because the README says recall is lower than general-purpose agents. Benchmark numbers come from the maintainers, so run it on a few of your own pull requests before relying on it.

open-code-review alternatives

The README compares itself to general-purpose coding agents with review skills, such as Claude Code. Beyond that, compare against hosted AI pull request reviewers that comment inside GitHub, and against plain static analysis tools and linters, which are deterministic but do not reason about intent. A reasonable setup often combines a linter with an AI reviewer. See open-code-review alternatives and the wider AI repos directory.

License and cost

The code is Apache-2.0, so you can use it commercially. The tool is free, but in native mode you pay your model provider per token. Delegation mode uses whatever your host agent already costs you.

FAQs

What languages does open-code-review support?

The README says its benchmark covers 10 programming languages and that it ships a multi-language ruleset. It does not list every supported language in the part of the README reviewed here.

Do I need an API key?

In native mode, yes, you configure a provider and model with ocr config. In delegation mode you do not, because your coding agent reviews the code.

Can I use it with Claude Code or Cursor?

Yes. The skills work in Claude Code, Codex, Cursor, Kimi Code and other agents that support Agent Skills and can run local commands.

How is it different from asking Claude Code to review a diff?

It adds engineering guardrails for file selection, bundling, rule matching and comment positioning. The README says this gives higher precision and lower token use, at the cost of lower recall.

Can I resume a long review?

Yes. Use ocr session list, then pass --resume with the session id on the same review command.

Topics

agent
agent-skills
code-review
code-review-assistant
harness
repository-level-context

Reviews (0)

No reviews yet.

Sign in to write a review.

Similar Repos

Open Source

LangChain

Agent engineering platform for building LLM applications from composable parts

Reviewed by hand · Jun 2026
Free

ECC

Agent harness optimisation for Claude Code, Codex, OpenCode and Cursor

Reviewed by hand · May 2026
Free

Hermes Agent

Self-improving agent from Nous Research that learns across sessions

Reviewed by hand · May 2026
Free

Skills for Real Engineers

Small, composable agent skills from Matt Pocock's daily .agents directory

Reviewed by hand · Apr 2026