~5m9:02
Ray Codes

Alibaba's Open Code: 100% Local Claude Code & Cursor Skill That Cuts Tokens 9x!

Nov 25, 2026

Read: ~5m · You save: 4 min

Open Code Review from Alibaba: a local skill for Claude Code and Cursor that cuts tokens by 9x

Alibaba released the free Open Code Review skill: fewer false positives, 9x fewer tokens, and offline operation. We tested it on real tasks.

Open Code Review (OCR) from Alibaba is a tool for automated code review. It checks code in short, focused passes and uses roughly 9–15 times fewer tokens than general-purpose development agents. The tool is free and open source under the Apache 2.0 license. It can run without paid API keys, including fully offline on local models.

Alibaba's internal OCR (Optical Character Recognition) has been used by the company's engineers for about two years. Open Code Review is a separate tool for code review.

Проблема универсальных агентов

Универсальные агенты разработки, например Roo Code, выдают большое количество ложных срабатываний. По данным из материала, более 90% их комментариев не соответствуют реальным ошибкам. Агенты:

  • читают каждую папку проекта и расходуют миллионы токенов;
  • угадывают номера строк и указывают неверные места в коде;
  • публикуют в pull request замечания о форматировании и пробелах.

Open Code Review ориентирован на ошибки, которые действительно нарушают работу кода. По заявлению Alibaba, точность такого ревью почти в пять раз выше.

Installation

Installation is performed according to the official instructions from the GitHub repository:

  1. Open the official page of the tool and give the agent a prompt with a link to the repository.
  2. Run the skill installation commands via npx skills add.
  3. Launch the tool without paid API keys, using the current agent's authorization.

The demonstration used the Google Antigravity agent with the Gemini 4 model, which is available for free in this environment. The reasoning effort level was left at the default value — medium. The documentation in the repository contains commands for installation via the command line.

How It Works

The tool consists of several sequential stages:

  1. Grouping files into batches. The tool groups related files, such as a login script and its test script, into small chunks. The AI does not handle large sets of files correctly.
  2. Detecting file types. Before contacting the AI, the tool checks file types. For Python, rules for asynchronous code are loaded. For SQL files, tools for the project and queries are loaded.
  3. Analyzing batches. The AI checks only the files in the current batch, using focus tools. Memory is not spent on irrelevant files.
  4. Filtering with a second model. The second check works as a strict reviewer. Minor remarks, such as those about command style, are discarded. Only errors that break the application's operation are confirmed.
  5. Linking to code lines. The tool checks exact lines and binds each comment to the correct line number.

Key Features

  • Reflection module. Comments about minor details, such as variable names, are filtered out. Errors that cause crashes are confirmed immediately.
  • Delegation mode. The current agent performs the main analytical work, while the tool sets the constraints. No API payment is required for this.
  • Custom project rules. Rules can be defined for individual types of code. For example, all database queries and Python code can be checked, while test files are given full freedom.
  • Working with local models. For confidential projects, a local model such as Qwen can be connected. Data is not transmitted to external servers.

Performance Metrics

MetricOpen Code ReviewComparison
Precisionabout 34%Claude Code — 7%
Token consumption per pull request review385,000Simple agent — over 5 million
Cost of pull request review10 times lower—
Token consumption in development agents9–15 times lower—
Meaningful signals4–5 times more—
F1 score2 times higher—

Approximate token consumption for the full review cycle was about 300,000–385,000. The cost decreased roughly ninefold compared to the general-purpose agent on the same set of tasks.

Testing Results

Testing included three tasks.

Task 1: High-Confidence File Review

The tool found three high-confidence errors and identified the exact lines.

  • SQL injection. A user can pass the condition where 1=1 and bypass the token check. Database queries should be executed only after the token has been verified.
  • Session ID collisions. The session was generated from the user ID and the time. If the same user works from more than one session at the same moment, an error occurs. The fix is to generate a unique secret token for each user using the secrets library in Python.
  • Data race under parallel load. Under concurrent load, simple code can cause shared memory errors. The fix is to use async with with session locks.

The tool saved the results to a structured markdown report with exact lines and fixes.

Task 2: Legacy Service Audit

The tool was given the path to the legacy service folder. Three files were checked: request routing, billing data processing, and database connections.

  • Database connection. A high-risk error was found: the user ID is passed directly, without prior validation.
  • User IDs. IDs from router.py are passed into the SQL string in their original form in the database file.
  • Billing. The request.post call requires timeout error handling with the exact error written to the log.

The tool also prepared a summary of all connections and a list of required changes.

Task 3: Pull Request Review as a CI Gate

The tool reviewed a pull request before its integration into git.

  • The CI gate received the status "security error."
  • The inventory update was performed outside the database transaction block. The fix is to move the update inside the transaction.

The user also wanted to add exception handling and connection retries to the code, since the servers are sometimes busy. The tool did not add this logic because it was not in the original source code. It identifies errors but does not create new logic.

Limitations

  • The tool focuses on high-confidence errors. It may miss refactoring opportunities. In testing, it missed the proposed refactoring from the third task.
  • The tool serves as a safety net for code review. It does not replace the developer and does not write new code.
  • The AACR benchmark was created within Alibaba. External auditors have not verified it.

Conclusions

Open Code Review reduces the number of false positives, cuts token consumption, and works without additional API keys. When local models are used, data stays on the device. The main takeaway: intelligent constraints around the AI model produce more reliable results than simple prompts for general-purpose models.

Introduction and What Open Code Review Is

Alibaba released an open-source code review tool called OCR, which is designed to produce fewer false positives and use fewer tokens than typical coding agents.

  • The tool is called Open Code Review (OCR) from Alibaba, and it is not related to optical character recognition
  • Licensed under Apache 2.0, the tool is free and open source
  • Alibaba has used it internally for about two years
  • Typical agents such as Roo Code produce more than 90% false positives
  • Accuracy improves roughly fivefold because only bugs that actually break code are flagged

Installing the Skill

Installation is performed via npx skills add based on the official documentation and does not require paid API keys; you can use agent login or local models.

  • Installation: npx skills add commands from the official GitHub repository
  • Agent: Google Antigravity, model Gemini 4 Hydrogen, available for free, default thinking mode medium
  • Launch is possible without additional keys via agent login or fully offline on local models
  • Installation commands and CLI are also listed in the documentation linked in the description

How the Tool Works

The tool splits files into bundles, detects file types, gives the model only the relevant fragment, after which a second agent filters out noise and records line numbers.

  • Files are grouped into bundles, for example an entry script together with its test script, so as not to overload the AI with 50 files at once
  • File type detection: for Python, asynchronous rules are loaded; for SQL, project rules and query tools are loaded
  • The AI checks only a bundle of files, focusing on logic
  • A second AI agent acts as a nitpicky senior developer: minor remarks are discarded, real bugs are approved
  • Each remark is tied to the exact line of code

Three Test Tasks

The author launches three checks: searching for high-confidence bugs in files, auditing a legacy service, and a CI gate for pull requests, with results saved as Markdown reports.

  • Task 1: scanning a file with the OCR review command, outputting only high-confidence bugs with line numbers and patches in Markdown
  • Task 2: analyzing a legacy service folder via the path argument, searching for prompt injections, security issues, and network timeouts
  • Task 3: checking a pull request as a CI gate before integration into git, listing critical defects with line numbers and patches
  • The three prompts are executed sequentially in the agent's queue

Key Features and Metrics

Key features: a reflection module, delegation without API fees, custom project rules, and working with local models like Qwen without data leakage.

  • The reflection module discards style remarks, such as variable naming, and approves real failures
  • Delegation mode: no API payment is needed, since the current agent performs the heavy reasoning
  • Custom project rules, for example checking all database queries and Python code
  • Working with local models, such as Qwen, without sending data to external servers
  • Alibaba accuracy is about 34% versus about 7% for Claude Code; token usage is about 385,000 versus more than 5 million for a typical agent
  • Comparison: roughly five times more useful signals by precision, F1 about twice as good, and 9–15 times fewer tokens used

Task 1 Results: Bug Search

Task 1 identified three high-confidence bugs: a SQL injection, a collision of timestamps used to identify sessions, and a race condition under parallel load.

  • SQL injection: a condition like where one equal to 1 bypasses the token check; it is recommended to connect to the database only when a token is present
  • Session collision: identification by user and time may coincide; a unique secret token via the secrets library in Python is recommended
  • Parallel load: async with and session locks are recommended, since shared memory errors are possible
  • The tool found all three errors and indicated which changes need to be made

Results of Tasks 2 and 3: Audit and CI Gateway

The legacy service audit revealed a high risk in the database connection, missing timeout handling, and inventory updates moved outside the transaction.

  • Files reviewed: request routing, billing, and database connections
  • Database connection: high risk, because the user identifier is passed without validation
  • Billing file: the request.post timeout must be handled and the exact error logged
  • Identifiers from router.py are passed into the SQL string as raw text in the database file
  • CI gateway: marked as failing the security check, inventory updates run outside the transaction block

Conclusions on Pros and Limitations

The tool finds bugs and gives exact locations, but does not add missing logic, such as retry attempts and try/except. It is a safety net, not a replacement for the developer.

  • Pros: no subjective nitpicking, free setup without API keys, full offline privacy with local models
  • Limitations: the tool only looks for high-confidence bugs and skips refactoring
  • The tool does not add logic itself, such as try/except and retry attempts for connections to busy servers
  • The AACR benchmark was created inside Alibaba and has not been verified by external auditors