Skip to content
ATAI Today Brief
HomeNewsConceptsGuidesToolbox
AboutSubscribeUA
Subscribe

AI Today Brief

The daily AI-engineering brief. Built in public. EN · UA.

XTelegramLinkedInYouTubeRSS

Follow AI Today Brief on LinkedIn for daily AI-engineering updates and the weekly “5 shifts that changed how developers work” PDF.

Explore

NewsDigestsConceptsGuides

Company

SubscribeAdvertiseAbout

Legal

Editorial policyAI disclosurePrivacyTerms

© 2026 AI Today Brief. All rights reserved.

  1. Home/
  2. News/
  3. Token & cost optimization/
  4. Code Review Graph Cuts AI Token Consumption in PR Reviews by 82x
Token & cost optimization

Code Review Graph Cuts AI Token Consumption in PR Reviews by 82x

July 23, 2026· 5 min read
OKCurated by Oleksandr Kuzmenko, AI Product Engineer·Updated July 23, 2026·Sources cited on every story
AI-assisted · editor-reviewed·How we use AI
Code Review Graph Cuts AI Token Consumption in PR Reviews by 82x

Open-source tool code-review-graph uses Tree-sitter AST parsing to build localized structural code maps for AI coding assistants. By querying only impacted call graphs during code reviews, it achieves a median 82x token reduction across supported platforms.

Impact: High

Why it matters

Developers can reduce context window waste and lower API costs by feeding AI review agents precise Tree-sitter dependency graphs instead of entire codebases.

TL;DR

  • 01Install code-review-graph via pip or pipx to auto-configure MCP tools
  • 02Cut PR review token consumption by ~82x using localized AST dependency graphs
  • 03Run risk-scored PR checks locally in CI via the provided GitHub Action

Key facts

Median Token Reduction
82x (range 38x–528x)
Re-index Speed
<2s for 2,900 files
Parsing Engine
Tree-sitter AST

Structural AST Parsing with Tree-sitter

code-review-graph builds a local-first structural map of a codebase using Tree-sitter. It parses functions, classes, imports, and test coverage into a graph database. Initial indexing takes ~10 seconds for a 500-file project, while incremental updates for changed files complete in under 2 seconds on a 2,900-file project.

82x Median Token Savings

Instead of loading full file trees into LLM context windows, code-review-graph queries neighboring graph nodes to calculate the 'blast radius' of changes. Automated evaluation across 6 real open-source repositories demonstrated a median per-question token reduction of ~82x (ranging from 38x up to 528x on large codebases like FastAPI).

Multi-Platform MCP Support

The tool configures MCP integrations automatically across major platforms using code-review-graph install. Supported platforms include Claude Code, Cursor, Codex, Gemini CLI, Copilot, and Kiro. It also offers a local-first GitHub Action for risk-scored PR reviews in CI.

Try it in 2 minutes

pip install code-review-graph && code-review-graph install

bash

✓ When to use

  • When conducting automated AI code reviews on large codebases or monorepos
  • When looking to drastically cut token costs for Claude Code or Cursor context windows

✕ When NOT to use

  • When working on single-file scripts where full context easily fits in memory

What to do today

  • →Install code-review-graph locally using pip install code-review-graph
  • →Run code-review-graph install to configure Cursor, Claude Code, or Codex
  • →Add the code-review-graph GitHub Action to pull request workflows
#code-review-graph#Tree-sitter#Claude Code#Cursor#Codex#Gemini CLI#Model Context Protocol

Sources

  • code-review-graph GitHub Repository
ShareShare on XShare on LinkedIn
← Previous storyMoonshot AI Releases Kimi Code CLI Terminal Agent with Agent Client Protocol SupportNext story →Cursor Releases Cursor Router Request Classifier Cutting Token Costs by 30 to 50 Percent

Related stories

  • Token & cost optimizationUnderstanding MLIR: The Multi-Level Intermediate Representation Dialect Stack Powering Machine Learning Compilers
  • Token & cost optimizationCursor Releases Cursor Router Request Classifier Cutting Token Costs by 30 to 50 Percent
  • Token & cost optimizationDeep Dive: Comparing Trillion-Scale Open-Weight Mixture-of-Experts Models
  • Token & cost optimizationOptimizing Context Windows with OpenAI Server-Side Compaction

Email digest

Get the morning AI brief

One email a day — the stories that matter for engineers, founders and tech leads. Human-edited, with links to primary sources.

  • ✓120+ sources scanned daily
  • ✓Edited by a human
  • ✓1 email per day
  • ✓EN + UA

By subscribing you agree to the privacy policy.