Open Code Review
Open Code Review is a battle-tested AI code review CLI combining deterministic engineering with an LLM agent for precise, line-level comments. It supports multiple model providers, private data control, and built-in multi-language rules.
Visit alibaba/open-code-reviewOverview
Open Code Review is an AI-powered code review CLI that originated as Alibaba Group's internal AI code review assistant. It reads Git diffs, sends changed files to a configurable LLM through an agent with tool-use capabilities, and generates structured review comments with line-level precision. The agent can read full file contents, search the codebase, inspect other changed files for context, and perform deep reviews. It also provides ocr scan for reviewing entire files when there is no meaningful diff.
Key Features
- Hybrid architecture separating deterministic engineering from LLM agent reasoning for file selection, bundling, rule matching, comment positioning, and scheduling.
- Precise line-level comment positioning with a three-tier progressive LLM strategy and a separate reflection module to intercept hallucinations and knowledge drift.
- Multi-model protocol support for Anthropic Messages API, OpenAI Chat Completions API, and OpenAI Responses API, with presets including Anthropic, OpenAI, DashScope, DeepSeek, and Z.AI, plus custom endpoints.
- Effort-driven progressive review with low, medium, and high depth levels that converge when a pass surfaces no new risk.
- Smart memory compression using three-tier frozen, compress, and active context management for deep review.
- Built-in review rules covering 40+ languages and file types, including checks for NPE, thread safety, XSS, and SQL injection.
Use Cases
- Individual developers embedding code review into local AI-assisted development workflows for instant feedback.
- Platform teams integrating the tool into internal systems with control over data flow and review policies.
- ML researchers using it as a code quality verifier in RL training pipelines to provide reward signals for code generation models.
- Auditing unfamiliar codebases or directories through full-file scan when there is no meaningful diff.
Getting Started
- Install globally with npm i -g @alibaba-group/open-code-review.
- Verify installation with ocr version.
- Configure a provider and model with ocr config provider and ocr config model, or use Delegation Mode.
- Run ocr review for workspace, branch-range, or commit reviews, or ocr scan for full-file review.
Deployment & Requirements
- Git 2.41 or newer is required.
- An LLM must be configured before reviewing code unless Delegation Mode is used.
- The CLI is installed globally via npm.
Before You Adopt
- License: Apache-2.0. Review its terms before using, modifying, or distributing the project.
- The tool depends on Git for diff generation, code search, and repository operations.
- The project explicitly notes lower recall than general-purpose agents as a trade-off favoring precision over noise.