GitHub - alibaba/open-code-review: Fast, efficient, battle-tested at Alibaba's scale. Hybrid architecture code review tool: deterministic pipelines + LLM Agent, precise line-level comments, built-in multi-language ruleset (NPE, thread-safety, XSS, SQL injection), OpenAI & Anthropic compatible.
Open Code Review is an open-source CLI tool that uses LLMs to review code diffs and full files with higher precision than general-purpose AI agents while using 9x fewer tokens. It combines deterministic engineering (file selection, rule matching, positioning) with an agent for dynamic decisions, and has been validated across 200 real pull requests from 50 open-source projects.
- Achieves significantly higher precision and F1 scores than Claude Code with the same underlying model, consuming only ~1/9 of the tokens and completing reviews faster
- Uses hard constraints (precise file selection, smart bundling, fine-grained rule matching, external positioning modules) to eliminate common AI agent failures like incomplete coverage and position drift
- Built on production data from Alibaba's internal use across two years serving tens of thousands of developers and identifying millions of defects
Open Code Review is an AI-powered code review tool that Alibaba built internally, validated across millions of defects over two years, then open-sourced. It works by reading Git diffs, sending changed files to an LLM with tool-use capabilities, and generating line-level review comments. Unlike surface-level diff feedback, it can read full file contents, search the codebase, and inspect other changed files for context. It also has a full-file scan mode for auditing unfamiliar codebases when there's no meaningful diff to work with.
The tool trades recall for precision — it catches fewer total issues than general-purpose agents like Claude Code, but the issues it does catch are real defects, not false alarms. On their benchmark (built from 50 open-source repos, 200 pull requests, 10 languages, validated by 80+ senior engineers), Open Code Review achieves significantly higher precision and F1 scores while using only about 1/9 of the tokens and running faster. This matters because general-purpose agents tend to cut corners on large changesets, report issues at wrong line numbers, and produce unstable results depending on prompt wording.
The architecture splits responsibilities: deterministic engineering handles what must not fail — precise file selection, smart bundling of related files into isolated review units, rule matching based on file type, and independent positioning modules that fix location accuracy. The agent handles dynamic decisions where it excels — scenario-tuned prompts optimized for code review, a distilled toolset built from production data rather than generic tools, and context retrieval. You install via npm, configure an LLM endpoint (or skip that with delegation mode), then run commands like `ocr review` for staged changes or `ocr review --from main --to feature-branch` for a commit range. It integrates with Claude Code, Cursor, and other coding agents, and supports CI/CD platforms including GitHub Actions and GitLab CI.