Autonomous Reviewer for Coding Agents: How OpenQodex Scans Diffs and Builds a Codebase GraphArticle · digest for November 17
Engineer's workstation with a split-screen diff view and a glowing OpenQodex codebase dependency graph.
Article3 sections≈ 7 min

Autonomous Reviewer for Coding Agents: How OpenQodex Scans Diffs and Builds a Codebase Graph

How do you protect a repository from silent bugs, broken contracts, and leaked keys when a coding agent rewrites a dozen files in thirty seconds — without spending your entire evening line-reviewing every commit? Say you ask an agent in Cursor to change the signature of a charge function in your payment gateway on the feature/payment-gateway branch. The payment module tests are green, the diff looks clean, and the AI reports everything is ready to push. Meanwhile, an internal subscription controller in a neighboring directory is still calling the old contract or skipping the zero-amount check.

OpenQodex, an open-source local code review tool under the Apache-2.0 license from the Qodex team, closes that blind spot. It runs your uncommitted edits and unpushed commits through two independent layers: deterministic static scanners scoped strictly to changed lines, and a separate model-reviewer process armed with a call graph of your project.

Why the same agent misses its own mistakes

When working with Claude Code, Cursor, Codex, Cline, or Goose, teams often walk into two traps back-to-back. The first is attention overload: when an agent drops a multi-hundred-line diff across several modules, your eyes glaze over and you approve changes almost on autopilot. The second trap looks like a fix, but only papers over the problem: asking the same chat window to "check your own code for bugs and vulnerabilities."

That self-review runs straight into confirmation bias. The model is still anchored inside its own reasoning history, remembers why it chose that implementation, and happily rationalizes its own assumptions — missing a forgotten caller like our subscription controller. Bare linters don't save you either: in OpenQodex's benchmarks on a codebase with planted bugs, static scanners without an LLM caught only 32 out of 51 bugs (62.7%). They're great at flagging a hardcoded token, but blind to logic mismatches across files.

Code graph, scanners, and an isolated verification loop under the hood

To eliminate self-justification, OpenQodex splits the audit into three connected stages.

The first layer is 22 built-in static scanners with no language models involved. The CLI picks analyzers to match your changed files: gitleaks hunts for secrets, semgrep catches vulnerability patterns, osv-scanner checks lockfiles against osv.dev, while stack-specific tools like ruff, shellcheck, golangci-lint, cargo-deny, kubeconform, and SQL migration checks kick in as needed. A key detail here is strict noise filtering: findings are kept only on changed lines, test fixtures and disabled rules are stripped out, and dependency vulnerabilities outside the diff are shown purely as context rather than blocking the review.

The second piece is the codebase graph (openqodex graph). It's a local relationship map of your project that answers "who calls this function, and from where." During setup, OpenQodex wires a local MCP server (Model Context Protocol — the standard tool interface for LLMs) into your coding agent so the model can query call sites on demand instead of stuffing the whole repo into context. The reviewer gets that same call context: in our payment gateway example, the graph immediately surfaces the forgotten subscription controller, even if that controller's file never appeared in the diff.

The third layer is an independent LLM reviewer launched in a fresh, isolated process of Claude Code or Codex CLI using your local auth — no separate API key or OpenQodex website account required. What I liked most about this setup is its two-stage verification instead of a generic list of AI suggestions:

  1. Finder sessions read each chunk of the diff alongside its callers and propose bug candidates with exact line quotes. A script then verifies every quote against the actual file on disk, immediately discarding hallucinated references.
  2. Verifier sessions check the Finder candidates plus every static scanner signal, confirming or refuting each item with evidence. Control scripts ensure no scanner finding goes unanswered and every changed line is reviewed. Style notes are reported as observations and never block a push.

Terminal setup, push gates, and honest limitations

The tool requires Node.js 22+, Git, and macOS or Ubuntu Linux (Windows and WSL aren't tested in CI). Running the setup wizard at your repo root detects installed agent environments, downloads scanners, and installs a local launcher at ~/.openqodex/bin/openqodex, since npx doesn't add the package to PATH:

# Interactive developer setup
npx openqodex init

# Non-interactive setup for Cursor
npx -y openqodex@0.18.0 init --yes --agent cursor

Watch out for Codex CLI's sandbox: it blocks network requests from commands by default, so run the initial setup from your regular terminal. If you want to see the mechanics in action without touching a real project, npx openqodex demo spins up a sample repo with planted bugs and scans it right away.

Once your agent finishes editing the payment gateway, you can audit uncommitted changes, a specific branch, or a pull request with one command:

# Check uncommitted and unpushed changes
npx openqodex review

# Review the payment gateway branch or pull request #42
npx openqodex review feature/payment-gateway
npx openqodex review '#42'

The run outputs report.html, report.md, report.json, and report.sarif (SARIF is the standard JSON report format for CI/CD) and prints a concise verdict receipt to the console. A built-in skill instructs your agent to show that receipt and ask whether to fix everything or only the items you pick — without rewriting the project unprompted.

It helps to keep hooks and agent roles straight. The local pre-commit hook runs scanners only, while the full graph-and-model audit is tied to pre-push. Claude Code and Codex CLI can both trigger reviews and act as the reviewer (except spawning a second Codex process inside its own sandbox). Cursor, Cline, and Goose can't act as the reviewer themselves, so you need an authenticated Claude Code or Codex CLI alongside them; otherwise the review exits with code 2, saves raw findings to unchecked-candidates.json, and suggests a fallback review --agent command.

Also, by default both agent rules and the pre-push git hook only warn about issues. To make a broken subscription controller actually block a push, set a severity threshold (critical, major, minor, nitpick, or info) in .openqodex/config.yaml:

review:
  block_on_severity: major

With that threshold, major and critical findings will block git push (with --no-verify available as an emergency escape hatch). Keep the 0.18.0 caveats in mind too: flags and config may shift before 1.0; Ruby (brakeman, rubocop), Go (golangci-lint), and Rust (cargo-deny) scanners need local language runtimes; and --offline disables network scanners (semgrep, osv-scanner, kubeconform, cargo-deny), though the LLM reviewer still sends your diff to your Claude or Codex provider. And keep a level head about the authors' benchmarks: on planted bugs, claude-opus-5-5 with the graph caught 98.0% of issues (150 of 153) at roughly $0.4371 per review, whereas on complex real-world PRs in AACR-Bench, gpt-6.1-sol hit 5.2% semantic recall with 77.2% noise. For more on code graphs and multi-agent terminal workflows, see our breakdown of the Gortex graph over MCP and our overview of the codeg UI for parallel Claude Code and Codex sessions.

No tool guarantees bug-free code or replaces engineering judgment. What OpenQodex does take off your plate is the exhausting job of acting as a human linter, squinting at a massive diff before every push for a missed caller or leaked key — leaving you a clear head for architecture and real product work.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 3