# AI use cases for Open Code Review (alibaba/open-code-review)

Repo: [alibaba/open-code-review](https://github.com/alibaba/open-code-review) | Use cases: 3 | Page: https://dedupedai.com/use-cases/alibaba-open-code-review/

Open Code Review is an AI-powered code review CLI that began as Alibaba's internal code review assistant. It reads Git diffs, sends changed files to a configurable LLM through an agent that can read files and search the codebase, and writes structured review comments with line-level precision. Its ocr scan command reviews whole files, and Delegation Mode lets your own coding agent do the review.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Review your branch with ocr before opening a pull request: https://dedupedai.com/use-cases/alibaba-open-code-review/review-your-changes-before-a-pull-request/
- Audit an unfamiliar codebase with ocr scan: https://dedupedai.com/use-cases/alibaba-open-code-review/audit-an-unfamiliar-codebase-with-ocr-scan/
- Use delegation mode so your coding agent does the review: https://dedupedai.com/use-cases/alibaba-open-code-review/let-your-coding-agent-do-the-review-with-delegation-mode/

## How to review your branch with ocr before opening a pull request with Open Code Review

Repo: [alibaba/open-code-review](https://github.com/alibaba/open-code-review) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Install the ocr CLI, pick a model and get line-level review comments on your uncommitted or branch changes.

**Who it is for:** A developer who wants a second pair of eyes on a diff before a human reviewer sees it.

**The problem:** Reviewing your own changes is slow, and general agents tend to skip files on larger changesets.

**The outcome:** Structured review comments pointing at exact lines in your changed files.

### Steps

1. Run `npm install -g @alibaba-group/open-code-review`
2. Run `ocr config provider` to select a provider and enter your API key
3. Run `ocr config model` to pick a model for the active provider
4. In your project, run `ocr review` to review all staged, unstaged and untracked changes
5. Run `ocr review --from main --to feature-branch` to review a whole branch since it diverged from main
6. Run `ocr review --format json --output result.json` if you want the results saved to a file

### Prompt to paste into your agent

```text
Install alibaba/open-code-review with `npm install -g @alibaba-group/open-code-review`, then run `ocr review` in this repository and summarize every comment it produces, grouped by file. Do not change any code until I choose which comments to fix.
```

### Caveat

The README says you must configure an LLM before reviewing, unless you use Delegation Mode.

Risk, credentials: Review sends your changed files to the LLM provider you configure, so use a provider you trust with your code and keep the API key private.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/alibaba-open-code-review/review-your-changes-before-a-pull-request/

## How to audit an unfamiliar codebase with ocr scan with Open Code Review

Repo: [alibaba/open-code-review](https://github.com/alibaba/open-code-review) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Review whole files or a directory when there is no diff to look at.

**Who it is for:** A developer who inherited a repository and wants a first pass at its defects.

**The problem:** A diff review is no help when the code you worry about has no recent changes.

**The outcome:** Review comments covering whole files or the directory you point it at.

### Steps

1. Install the CLI with `npm install -g @alibaba-group/open-code-review` and configure a model with `ocr config provider` and `ocr config model`
2. Run `ocr scan` in the repository to scan the entire repository
3. Run `ocr scan --path internal/agent` to scan just a directory or specific files
4. If a scan is interrupted, run `ocr scan --resume`
5. Run `ocr session list` to see earlier sessions

### Prompt to paste into your agent

```text
Using alibaba/open-code-review, run `ocr scan --path <directory>` on this repository and list the most serious findings first, with file and line. Resume with `ocr scan --resume` if it is interrupted.
```

### Caveat

The README notes recall is lower than general-purpose agents by design, favoring precision over noise.

Risk, credentials: A full scan sends many files to your LLM provider, which can cost tokens and expose code, so scope it with --path first.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/alibaba-open-code-review/audit-an-unfamiliar-codebase-with-ocr-scan/

## How to use delegation mode so your coding agent does the review with Open Code Review

Repo: [alibaba/open-code-review](https://github.com/alibaba/open-code-review) | Difficulty: Intermediate | Time: 20 minutes | Basis: From the README

Let ocr pick the files and rules while your own agent supplies the model, with no separate API key.

**Who it is for:** A developer already paying for a coding agent who does not want to configure another provider.

**The problem:** Setting up another model endpoint and key just for reviews is extra work.

**The outcome:** A review run by your coding agent's own LLM, with ocr handling file selection and rule resolution.

### Steps

1. Install the CLI with `npm install -g @alibaba-group/open-code-review`
2. Run `ocr delegate preview` to see what will be reviewed
3. Run `ocr delegate rule src/main.go src/handler.go` with your own file paths to resolve the rules for those files
4. Have your agent review each file against those rules
5. For Claude Code, Codex or Cursor, install the matching plugin described in the plugins/open-code-review README

### Prompt to paste into your agent

```text
Install alibaba/open-code-review, run `ocr delegate preview`, then run `ocr delegate rule <files>` for the files it lists and review them yourself against the rules it returns. Report findings by file and line.
```

### Caveat

Plugin install steps live in the repository's plugins README rather than the main README, so read them for your agent.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/alibaba-open-code-review/let-your-coding-agent-do-the-review-with-delegation-mode/
