Open Code Review (OCR) is an open‑source CLI tool that performs AI‑assisted code reviews by combining deterministic engineering steps with a language‑model‑driven agent. It reads Git diffs, bundles related files, and sends each bundle to a configurable LLM via an agent equipped with tool‑use capabilities, producing line‑level structured comments. The agent can also read full file contents, search the codebase, and inspect other changed files for context, enabling deep reviews beyond surface‑level diff feedback; a separate ocr scan mode audits entire files or directories without requiring a diff. Benchmarks on a real‑world dataset comprising 50 popular open‑source repositories, 200 pull requests, and 10 programming languages—validated by over 80 senior engineers against 1,505 annotated ground‑truth issues—show that OCR achieves significantly higher precision and F1 scores than general‑purpose agents such as Claude Code when using the same underlying model, while consuming only about one‑ninth of the tokens and completing reviews faster. This efficiency comes at the cost of lower recall, a deliberate trade‑off favoring fewer false alarms. Deterministic components ensure precise file selection, smart bundling, fine‑grained rule matching, and external positioning/reflection modules, whereas the agent supplies scenario‑tuned prompts and a purpose‑built toolset distilled from production tool‑call traces. OCR requires Git ≥ 2.41 and can be installed globally via npm install -g @alibaba-group/open-code-review.

Read original