Building a better Bugbot
Source: Jon Kaplan, Cursor (vendor engineering blog; the vendor's own figures) · 2026-01-15
As coding agents became more capable, we found ourselves spending more time on review. To solve this, we built Bugbot, a code review agent that analyzes pull requests for logic bugs, performance issues, and security vulnerabilities before they reach production. By last summer, it was working so well that we decided to release it to users.
The process of building Bugbot began with qualitative assessments and gradually evolved into a more systematic approach, using a custom AI-driven metric to hill-climb on quality.
Since launch, we have run 40 major experiments that have increased Bugbot's resolution rate from 52% to over 70%, while lifting the average number of bugs flagged per run from 0.4 to 0.7. This means that the number of resolved bugs per PR has more than doubled, from roughly 0.2 to about 0.5.
We experimented with different configurations of models, pipelines, filters, and clever context management strategies, polling engineers internally along the way. If it seemed one configuration had fewer false positives, we adopted it.
One of the most effective quality improvements we found early on was running multiple bug-finding passes in parallel and combining their results with majority voting. Each pass received a different ordering of the diff, which nudged the model toward different lines of reasoning. When several passes independently flagged the same issue, we treated it as a stronger signal that the bug was real.
To solve this problem, we devised a metric called the resolution rate. It uses AI to determine, at PR merge time, which bugs were actually resolved by the author in the final code. When developing this metric, we spot-checked every example internally with the PR author and we found that the LLM correctly classified nearly all of them as resolved or not.
Defining resolution rate changed how we built Bugbot. For the first time, we could hill-climb on the basis of real signal, rather than just feel. We began evaluating changes online using actual resolution rates and offline using BugBench, a curated benchmark of real code diffs with human annotated bugs.
We ran dozens of experiments across models, prompts, iteration counts, validators, context management, category filtering, and agentic designs. Many changes, surprisingly, regressed our metrics. It turned out that a lot of our initial judgments from the early qualitative analyses were correct.
We saw the largest gains when, this fall, we switched Bugbot to a fully agentic design. The agent could reason over the diff, call tools, and decide where to dig deeper instead of following a fixed sequence of passes.
Today, Bugbot reviews more than two million PRs per month for customers like Rippling, Discord, Samsara, Airtable, and Sierra AI. We also run Bugbot on all internal code at Cursor.
Lines of inquiry this paper opens 24
Research framings built by reading the notes related to this paper — the questions it feeds into.
How reliably do benchmark metrics reflect actual model capability? Does AI assistance redirect workers toward higher-value tasks or amplify workload? Do AI coding tools meaningfully improve developer productivity and quality?- Do AI code suggestions fail because they are incorrect or because they miss simpler alternatives?
- Can project context and clarification tools help AI reviewers give understanding feedback?
- Do conversations with AI reviewers lead to fewer code changes than human reviews?
- Why do AI reviewers combine evaluation and fixes in single comments?
- Can AI agents improve accuracy by learning a project's style guide and review history?
- How often do developers reject functionally correct suggestions across all AI code review tools?
- What unstated coding conventions cause the most friction between agents and human reviewers?
- Why do developers prefer human-in-the-loop workflows with AI tools?
- Why do AI code reviewers produce so many false positive findings?
- Has CodeRabbit's acceptance rate improved since its initial release?
- What gap exists between AI test passage and human code review acceptance?
- How do project-specific conventions affect whether developers accept AI code suggestions?
- Do misconceptions about AI context actually degrade code suggestion quality?
- Why do long multi-line code suggestions disrupt programmer flow?
- Do programmers prefer partial hints or complete code solutions from AI?
- How does design-system onboarding from code differ across AI design tools?
- Why does AI accuracy preference in paper review not translate to code suggestion adoption?
- Does rising AI code volume require fundamentally different review approaches?