Scripts2026年9月12日·1 分钟阅读

Code Review Graph — Local-First Code Intelligence for AI Agents

Build a persistent knowledge graph of your codebase so AI coding tools read only what matters, reducing context by up to 90%.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Code Review Graph Overview
直接安装命令
npx -y tokrepo@latest install 60043562-aecd-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Code Review Graph is a local-first code intelligence tool that builds a persistent map of your codebase as a knowledge graph. It indexes code structure, dependencies, and relationships so AI coding tools can query only the relevant context instead of processing entire repositories. The result is faster, more accurate AI-assisted code reviews and large-repo workflows.

What Code Review Graph Does

  • Indexes codebases into a persistent knowledge graph using tree-sitter parsing
  • Serves as an MCP server for AI agents to query code context
  • Reduces token consumption by surfacing only relevant code sections
  • Incrementally updates the graph as files change
  • Provides a CLI for querying code relationships directly

Architecture Overview

Code Review Graph uses tree-sitter for language-agnostic parsing and builds a graph database that captures functions, classes, imports, call sites, and type relationships. The graph is stored locally and updated incrementally on file changes. An MCP server layer exposes query tools that let AI agents traverse the graph to find relevant context without reading entire files.

Self-Hosting & Configuration

  • Install via pip and index your repository with a single command
  • Supports Python, TypeScript, JavaScript, Go, Rust, and more via tree-sitter grammars
  • Configure indexing scope with .crgignore patterns similar to .gitignore
  • Run the MCP server locally and register it with your AI coding CLI
  • Graph data is stored in a local SQLite database for portability

Key Features

  • Incremental indexing that re-parses only changed files
  • Multi-language support through tree-sitter grammar plugins
  • MCP-native server for seamless integration with AI coding agents
  • CLI tools for direct graph queries and exploration
  • Benchmarked context reductions on code review workflows

Comparison with Similar Tools

  • Sourcegraph — cloud-hosted code search; Code Review Graph is local-first and graph-based
  • ctags/LSP — symbol indexing without the relationship graph or MCP integration
  • Repomix — packs repos into single files; Code Review Graph provides selective context
  • GitIngest — converts repos to LLM prompts without persistent graph state
  • GraphRAG — general-purpose knowledge graph; Code Review Graph is purpose-built for codebases

FAQ

Q: Which programming languages are supported? A: Any language with a tree-sitter grammar. Python, TypeScript, JavaScript, Go, Rust, Java, and C/C++ are supported out of the box.

Q: How large a codebase can it handle? A: It is designed for large repositories. Incremental indexing means initial indexing is the only slow step; subsequent updates are fast.

Q: Does it send code to any external service? A: No. All indexing and graph storage happens locally. The MCP server runs on localhost.

Q: Can it work without an AI agent? A: Yes, the CLI provides direct query commands for exploring code relationships independently.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产