Open Code Review: Alibaba open-sourced the code reviewer it validated on a million real tasks

1 month ago

Same model, same two hundred pull requests. Run through Claude Code, it scores 11.6. Run through Open Code Review, it scores 25.1, on a fifteenth of the tokens. This is Alibaba's code review tool, the one that reviewed code for tens of thousands of developers inside Alibaba for two years before they open sourced it in May. It is written in Go, Apache licensed, and it runs on every desktop.

Ask about this presentation

Chapters

  1. 0:00Open Code Review · doubles Claude Code's score on the same model
  2. 0:29What you will know by the end
  3. 0:45You point it at a diff and get comments pinned to lines
  4. 1:11Three ways a general agent gets a review wrong
  5. 1:40The model gets the wheel in two places
  6. 2:06Five gates before a token is spent
  7. 2:31Related files are reviewed in one conversation
  8. 3:03Each sub-agent plans, loops, and goes around again
  9. 3:35Position is computed, so it does not drift
  10. 4:03Fifty-two file types arrive with a rulebook
  11. 4:37The benchmark behind the number
  12. 5:06What the 25 hides: Claude Code finds more of the real defects
  13. 5:37Claude Code has a review command. CodeRabbit posts on every PR.
  14. 6:13The catch, from the FAQ
  15. 6:48One in five defects, and one in three comments is real
  16. 7:15Where it sits among the other reviewers
  17. 7:42Should you install it
  18. 8:13One line installs it
  19. 8:35Doubles the score by filing a third of the comments
Show transcript
  1. Same model, same two hundred pull requests. Run through Claude Code, it scores 11.6. Run through Open Code Review, it scores 25.1, on a fifteenth of the tokens. This is Alibaba's code review tool, the one that reviewed code for tens of thousands of developers inside Alibaba for two years before they open sourced it in May. It is written in Go, Apache licensed, and it runs on every desktop.

    Slide text

    Open Code Review

    Open Code Review: Alibaba open-sourced the code reviewer it validated on a million real tasks
    Go Apache 2.0 macOS, Linux, Windows
  2. By the end of this, you'll know how a pipeline with hard-coded gates gets that score out of the same model, why Claude Code still finds more of the real defects, and whether you should put this in your pull request pipeline this week. I'll also say where I would not use it.

    Slide text
    By the end you will know how a pipeline with hard-coded gates gets that score out of the same model, why Claude Code still finds more of the real defects, and whether this belongs in your pull request pipeline this week.
    and where I would not use it
  3. Here's what it does. You point ocr at a diff: everything you have changed, one commit, or a branch against main. It reads the changes, sends them to whichever model you configured, and hands back comments. Each one is pinned to a file and a line range, and carries the existing code and a suggestion. Ask for JSON and it writes a file your own tooling can read.

    Slide text
    every comment carries a file, a start and end line, the existing code, and a suggestion
  4. If you've asked a general coding agent to review a pull request, you know the three ways it goes wrong. On a large change it cuts corners and skips files. The line numbers drift, so a real finding points at the wrong place. And a small change to the prompt swings the whole result. Alibaba's diagnosis is that a purely language-driven reviewer has no hard constraints, so they built the constraints in code and left the model two jobs.

    Slide text

    Three ways a general coding agent gets a review wrong

    it cuts corners
    on a large change it reviews some files and skips the rest
    the position drifts
    a real finding points at the wrong line or the wrong file
    the quality swings
    a small prompt change moves the whole result
  5. The whole thing is a pipeline, and the model only gets the wheel in two places. Go code loads the diff from git, decides which files are reviewable, and picks a rulebook per file. Then one model call groups related files. Each group gets its own sub-agent with its own context, up to eight running in parallel. And Go code, not the model, pins every comment back to its lines before anything is written out.

    Slide text

    The model gets the wheel in two places. Go code drives the rest.

    load the diffgit, in Go five gateswhich files, which rule group filesone model call one sub-agent per groupplan, loop, roundsup to 8 in parallel pin every commentto its lines, in Go text or JSON
    deterministic, in Go the model
  6. Every changed file passes five gates before a token is spent. Binary files drop first. Your own exclude list wins next. A file on your include list is kept no matter what follows. Then an extension allowlist, then a built-in list of test file patterns. And you can run the preview and see the verdict for every file, with the reason, without calling a model at all. I like that a lot.

    Slide text

    Every changed file passes five gates before a token is spent

    1
    binary files drop first
    2
    your exclude list wins
    3
    a file on your include list is kept, whatever follows
    4
    an extension allowlist
    5
    built-in test-file patterns
    $ ocr review --preview --from HEAD~6 --to HEAD
    Preview: 26 file(s) changed | +697 -504
    Will review (12):
    [M] …/src/build.ts +57 -79
    [A] …/src/darken.ts +21 -0
    [A] …/thumbnail/candidate-e.html +32 -0
    Excluded from review (14):
    [M] …/STATUS.md (unsupported_ext)
    [A] …/thumbnail/chosen.png (unsupported_ext)
  7. Then the files get grouped, so a handler, its service and its test are reviewed in one conversation. That grouping is one model call, and it only sees file paths and line counts, never the code. Three guards keep it sane. Ten files a group at most. A group that would blow the token budget splits back to single files. And if the model's answer is garbage, every file gets its own group. The grouping can fail. The review cannot.

    Slide text

    Related files are reviewed together, and the grouping is allowed to fail

    one model call sees file paths and line counts, never the code
    ten files a group at most
    over the token budget, back to one file per group
    a bad answer, and every file gets its own group
  8. Each group's sub-agent runs a loop. If any file changed fifty lines or more, or the group changed a hundred, it plans first with read-only tools, and that plan becomes a checklist. Small changes skip the plan. Then the main loop runs, up to a hundred tool calls: search the code, read a file, file a comment. And it goes around again with the confirmed findings pinned, one to three rounds depending on the effort you set, stopping early when a round finds nothing new.

    Slide text

    Each sub-agent plans, loops up to a hundred tool calls, and goes around again

    plan if a file changed 50+ lines, or a group 100+
    read-only tools, returns a checklist
    loop up to 100 tool calls
    code_search · file_read · file_read_diff
    file_find · code_comment · task_done
    rounds effort low 1 · medium 2 · high 3
    confirmed findings pinned, plan dropped
    the plan phase is skipped for small changes, so it costs nothing there
    rounds stop early when one adds nothing new, or the token budget runs out
  9. This is the part that fixes position drift. A comment quotes the existing code, and Go code slides that quote across the diff to find the exact lines. If it can't match, one more model call re-anchors it. Then a filter pass reads every comment against the diff and throws out the ones it can prove wrong, and a second line pass runs over the whole set. The position is computed, so it does not drift.

    Slide text
    a comment quotes the existing code, and Go slides that quote across the diff to find the exact lines
    no match, and one more model call re-anchors it
    a filter pass drops comments it can prove wrong
    a second line pass runs over the whole set
  10. Each file also arrives with a rulebook for its type, and there are fifty-two of them, from Java and Go to Terraform and Solidity. The Java one tells the model when to flag a thread safety issue: a check-then-act race, an unsafe lazy singleton, a HashMap written from several threads. And it says when to stay quiet: local variables, read-only access, code that is already synchronized. The do-not-report list is half the rule. That is where the precision comes from.

    Slide text

    Fifty-two file types arrive with a rulebook, and half of each rule says when to stay quiet

    52
    built-in rulebooks: Java, Go, Python, TypeScript, Rust, Swift, Terraform, Solidity, SQL mappers, GitHub workflows
    Thread safety, flag only:
    a check-then-act race
    a non-atomic compound operation
    unsafe lazy initialization
    writes to a HashMap from several threads
    Do not report:
    local variables · read-only use
    immutable objects · code already synchronized
  11. Now the number from the title. Alibaba built a benchmark from fifty open source repos, two hundred real pull requests in ten languages, with 1,505 defects annotated by more than eighty senior engineers. The dataset is public on Hugging Face. The top row of their table is Open Code Review driving Claude Opus 4.6: an F1 of 25.1, on 385 thousand tokens a review.

    Slide text

    Alibaba's benchmark: real pull requests, defects marked by eighty senior engineers

    top row: Open Code Review driving Claude Opus 4.6, F1 25.1, on 385K tokens a review
    Alibaba’s own benchmark, AACR-Bench, published on Hugging Face
  12. Same model, through Claude Code: 11.6. So what does the 25 hide? Recall. Open Code Review finds one in five of the real defects. Claude Code finds 28.9 percent, more of them. It also files nearly six thousand comments to get there, and one in fourteen is right. Open Code Review files 889, and one in three is right, on a fifteenth of the tokens. The score measures signal, and this tool buys signal by staying quiet.

    Slide text
    Open Code Review
    June build, Claude Opus 4.6
    25.1
    F1
    33.9%
    precision · 301 of 889 comments
    20.0%
    recall · 301 of 1,505 defects
    385K
    tokens a review
    Claude Code
    June build, Claude Opus 4.6
    11.6
    F1
    7.2%
    precision · 435 of 5,980 comments
    28.9%
    recall · 435 of 1,505 defects
    5,664K
    tokens a review
    the score measures signal, and this tool buys signal by staying quiet
    Alibaba’s benchmark table, both rows on Claude Opus 4.6 over the same 200 pull requests
  13. The obvious pushback: Claude Code already has a review command, and CodeRabbit will comment on every pull request for a subscription. True. What those don't give you is a filter you can preview for free, a guard that skips a monster diff before the request is sent, and a JSON envelope you own end to end. One caveat cuts the other way. That benchmark ran a June build of Alibaba's tool against a June build of Claude Code. Both have shipped dozens of releases since, and the table has not been rerun.

    Slide text

    Claude Code has a review command and CodeRabbit posts on every pull request. What is left?

    a file filter you can preview for free
    a token guard that skips a monster diff before the request is sent
    a JSON envelope your own pipeline owns end to end
    the table compares a June build of each tool. Both have shipped dozens of releases since, and the table has not been rerun.
  14. Here's the catch, and it is in the FAQ. The model has to make real tool calls. A model that writes them out as text, the way some reasoning models do, loops and returns zero comments. You need Git 2.41 or newer. When the model paraphrases a quote instead of copying it, the comment lands at line zero and you find the spot yourself. And a finding in a file outside the group is off limits, so a bug that spans two groups can go unreported. That is the recall number, explained.

    Slide text

    The catch, straight from the FAQ

    the model must make native tool calls. One that writes them out as text loops and returns zero comments.
    Git 2.41 or newer
    a paraphrased quote lands the comment at line 0, and you find the spot yourself
    a finding in a file outside the group is off limits
  15. So how do you read one in five? Not as a scanner. A security scanner is judged on recall. This is judged on your attention: every third comment is a real defect, which means you read them, instead of scrolling past forty false alarms to find one. And at 385 thousand tokens, that is a review you can afford on every pull request, on your own key, with whichever model you already pay for.

    Slide text
    One in five defects found, and one in three comments is real. That is a review you read, not one you scroll past.
  16. Where does it sit? Qodo's PR-Agent is the open source one that lives in the pull request. CodeRabbit is the hosted one. Claude Code and Copilot each ship a review of their own. Open Code Review is the one that is a deterministic pipeline you run yourself, with a rulebook per file type, and a track record: twenty thousand active users inside Alibaba, by their own count.

    Slide text

    Where it sits

    Qodo's PR-Agent
    open source, lives in the pull request
    CodeRabbit
    hosted, a subscription
    Claude Code's review
    inside the agent you already run
    Copilot code review
    inside GitHub
  17. Should you install it? Depends which of these is you. If you're on a team with a pull request pipeline and a model key, yes, this week. The GitHub Action posts the findings on the reviewed commit. If you're solo on Claude Code or Cursor, install the skill and use delegation mode. Your agent runs the review with its own model, and you need no second key. If what you need is recall, an audit, a security pass, I'd run it beside your scanner and not instead of it.

    Slide text

    Should you install it? Depends which of these is you.

    a team with a pull request pipeline and a model key
    yes, this week. The GitHub Action posts findings on the reviewed commit.
    solo, on Claude Code or Cursor
    install the skill and use delegation mode: your agent runs the review with its own model, no second key
    you need recall: an audit, a security pass
    run it beside your scanner, not instead of it
  18. One line installs it from npm, and the command is ocr. A new release shipped today, and that makes 125 since May 21, about one a day. The licence is Apache 2.0, so it is fine at work. Plugins for Claude Code, Codex, Cursor and OpenCode ship in the repo.

    Slide text

    One line installs it, and a new release lands about once a day

    npm install -g @alibaba-group/open-code-review
    Go
    Apache 2.0
    125 releases since May 21
    macOS, Linux, Windows
    plugins: Claude Code, Codex, Cursor, OpenCode
  19. So: a pipeline with hard gates, a model that only gets the wheel twice, and a score that comes from staying quiet. Are you running this on your own key, or handing the review to your coding agent? Tell me which, and what it caught. That is alibaba slash open dash code dash review, on GitHub. New repo tomorrow.

    Slide text
    Open Code Review doubles Claude Code's score on the same model by filing a third of the comments
    github.com/alibaba/open-code-review
    Go · Apache 2.0

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York