code-review-graph 2.0.0__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/.claude-plugin/marketplace.json +2 -2
  2. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/.claude-plugin/plugin.json +1 -1
  3. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/PKG-INFO +62 -61
  4. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/README.md +61 -60
  5. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/__init__.py +1 -1
  6. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/cli.py +59 -34
  7. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/embeddings.py +5 -1
  8. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/incremental.py +37 -0
  9. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/parser.py +851 -3
  10. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/search.py +4 -2
  11. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/skills.py +85 -39
  12. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/query.py +6 -2
  13. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/FEATURES.md +1 -1
  14. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/LLM-OPTIMIZED-REFERENCE.md +1 -1
  15. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/USAGE.md +1 -1
  16. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/pyproject.toml +1 -1
  17. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/.gitignore +0 -0
  18. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/LICENSE +0 -0
  19. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code-review-graph-vscode/LICENSE +0 -0
  20. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code-review-graph-vscode/README.md +0 -0
  21. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/__main__.py +0 -0
  22. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/changes.py +0 -0
  23. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/communities.py +0 -0
  24. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/constants.py +0 -0
  25. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/__init__.py +0 -0
  26. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/__init__.py +0 -0
  27. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/build_performance.py +0 -0
  28. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/flow_completeness.py +0 -0
  29. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/impact_accuracy.py +0 -0
  30. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/search_quality.py +0 -0
  31. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/benchmarks/token_efficiency.py +0 -0
  32. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/express.yaml +0 -0
  33. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/fastapi.yaml +0 -0
  34. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/flask.yaml +0 -0
  35. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/gin.yaml +0 -0
  36. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/httpx.yaml +0 -0
  37. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/configs/nextjs.yaml +0 -0
  38. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/reporter.py +0 -0
  39. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/runner.py +0 -0
  40. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/eval/scorer.py +0 -0
  41. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/flows.py +0 -0
  42. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/graph.py +0 -0
  43. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/hints.py +0 -0
  44. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/main.py +0 -0
  45. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/migrations.py +0 -0
  46. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/prompts.py +0 -0
  47. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/refactor.py +0 -0
  48. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/registry.py +0 -0
  49. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/__init__.py +0 -0
  50. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/_common.py +0 -0
  51. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/build.py +0 -0
  52. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/community_tools.py +0 -0
  53. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/docs.py +0 -0
  54. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/flows_tools.py +0 -0
  55. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/refactor_tools.py +0 -0
  56. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/registry_tools.py +0 -0
  57. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tools/review.py +0 -0
  58. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/tsconfig_resolver.py +0 -0
  59. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/visualization.py +0 -0
  60. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/code_review_graph/wiki.py +0 -0
  61. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/COMMANDS.md +0 -0
  62. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/INDEX.md +0 -0
  63. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/LEGAL.md +0 -0
  64. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/ROADMAP.md +0 -0
  65. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/TROUBLESHOOTING.md +0 -0
  66. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/architecture.md +0 -0
  67. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/docs/schema.md +0 -0
  68. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/hooks/hooks.json +0 -0
  69. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/hooks/session-start.sh +0 -0
  70. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/skills/build-graph/SKILL.md +0 -0
  71. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/skills/review-delta/SKILL.md +0 -0
  72. {code_review_graph-2.0.0 → code_review_graph-2.1.0}/skills/review-pr/SKILL.md +0 -0
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Persistent incremental knowledge graph for token-efficient, context-aware code reviews with Claude Code",
9
- "version": "2.0.0"
9
+ "version": "2.1.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "code-review-graph",
14
14
  "source": "./",
15
15
  "description": "Persistent incremental knowledge graph for token-efficient, context-aware code reviews with Claude Code",
16
- "version": "2.0.0",
16
+ "version": "2.1.0",
17
17
  "category": "development",
18
18
  "keywords": ["code-review", "knowledge-graph", "incremental", "tree-sitter", "mcp", "claude-code"]
19
19
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "code-review-graph",
3
3
  "description": "Persistent incremental knowledge graph for token-efficient, context-aware code reviews with Claude Code",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "author": {
6
6
  "name": "Tirth Kanani",
7
7
  "email": "tirthkanani18@gmail.com",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-review-graph
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: Persistent incremental knowledge graph for token-efficient, context-aware code reviews with Claude Code
5
5
  Project-URL: Homepage, https://github.com/tirth8205/code-review-graph
6
6
  Project-URL: Repository, https://github.com/tirth8205/code-review-graph
@@ -59,17 +59,18 @@ Description-Content-Type: text/markdown
59
59
  </p>
60
60
 
61
61
  <p align="center">
62
+ <a href="https://code-review-graph.com"><img src="https://img.shields.io/badge/website-code--review--graph.com-blue?style=flat-square" alt="Website"></a>
62
63
  <a href="https://github.com/tirth8205/code-review-graph/stargazers"><img src="https://img.shields.io/github/stars/tirth8205/code-review-graph?style=flat-square" alt="Stars"></a>
63
64
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="MIT Licence"></a>
64
65
  <a href="https://github.com/tirth8205/code-review-graph/actions/workflows/ci.yml"><img src="https://github.com/tirth8205/code-review-graph/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
65
66
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10%2B-blue.svg?style=flat-square" alt="Python 3.10+"></a>
66
67
  <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-green.svg?style=flat-square" alt="MCP"></a>
67
- <a href="#"><img src="https://img.shields.io/badge/version-2.0.0-purple.svg?style=flat-square" alt="v2.0.0"></a>
68
+ <a href="#"><img src="https://img.shields.io/badge/version-2.1.0-purple.svg?style=flat-square" alt="v2.1.0"></a>
68
69
  </p>
69
70
 
70
71
  <br>
71
72
 
72
- Claude Code re-reads your entire codebase on every task. `code-review-graph` fixes that. It builds a structural map of your code with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), tracks changes incrementally, and gives Claude precise context so it reads only what matters.
73
+ AI coding tools re-read your entire codebase on every task. `code-review-graph` fixes that. It builds a structural map of your code with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), tracks changes incrementally, and gives your AI assistant precise context via [MCP](https://modelcontextprotocol.io/) so it reads only what matters.
73
74
 
74
75
  <p align="center">
75
76
  <img src="diagrams/diagram1_before_vs_after.png" alt="The Token Problem: 8.2x average token reduction across 6 real repositories" width="85%" />
@@ -80,12 +81,16 @@ Claude Code re-reads your entire codebase on every task. `code-review-graph` fix
80
81
  ## Quick Start
81
82
 
82
83
  ```bash
83
- pip install code-review-graph
84
+ pip install code-review-graph # or: pipx install code-review-graph
84
85
  code-review-graph install # auto-detects and configures all supported platforms
85
86
  code-review-graph build # parse your codebase
86
87
  ```
87
88
 
88
- One command sets up everything. `install` detects which AI coding tools you have and writes the correct MCP configuration for each one. Restart your editor/tool after installing.
89
+ One command sets up everything. `install` detects which AI coding tools you have, writes the correct MCP configuration for each one, and injects graph-aware instructions into your platform rules. It auto-detects whether you installed via `uvx` or `pip`/`pipx` and generates the right config. Restart your editor/tool after installing.
90
+
91
+ <p align="center">
92
+ <img src="diagrams/diagram8_supported_platforms.png" alt="One Install, Every Platform: auto-detects Claude Code, Cursor, Windsurf, Zed, Continue, OpenCode, and Antigravity" width="85%" />
93
+ </p>
89
94
 
90
95
  To target a specific platform:
91
96
 
@@ -94,18 +99,7 @@ code-review-graph install --platform cursor # configure only Cursor
94
99
  code-review-graph install --platform claude-code # configure only Claude Code
95
100
  ```
96
101
 
97
- Requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).
98
-
99
- ### Supported Platforms
100
-
101
- | Platform | Config file | Auto-detected |
102
- |----------|-------------|:---:|
103
- | **Claude Code** | `.mcp.json` | Yes |
104
- | **Cursor** | `.cursor/mcp.json` | Yes |
105
- | **Windsurf** | `.windsurf/mcp.json` | Yes |
106
- | **Zed** | `.zed/settings.json` | Yes |
107
- | **Continue** | `.continue/config.json` | Yes |
108
- | **OpenCode** | `.opencode/config.json` | Yes |
102
+ Requires Python 3.10+. For the best experience, install [uv](https://docs.astral.sh/uv/) (the MCP config will use `uvx` if available, otherwise falls back to the `code-review-graph` command directly).
109
103
 
110
104
  Then open your project and ask your AI assistant:
111
105
 
@@ -119,27 +113,25 @@ The initial build takes ~10 seconds for a 500-file project. After that, the grap
119
113
 
120
114
  ## How It Works
121
115
 
122
- Your repository is parsed into an AST with Tree-sitter, stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage), then queried at review time to compute the minimal set of files Claude needs to read.
116
+ <p align="center">
117
+ <img src="diagrams/diagram7_mcp_integration_flow.png" alt="How your AI assistant uses the graph: User asks for review, AI checks MCP tools, graph returns blast radius and risk scores, AI reads only what matters" width="80%" />
118
+ </p>
119
+
120
+ Your repository is parsed into an AST with Tree-sitter, stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage), then queried at review time to compute the minimal set of files your AI assistant needs to read.
123
121
 
124
122
  <p align="center">
125
123
  <img src="diagrams/diagram2_architecture_pipeline.png" alt="Architecture pipeline: Repository to Tree-sitter Parser to SQLite Graph to Blast Radius to Minimal Review Set" width="100%" />
126
124
  </p>
127
125
 
128
- <details>
129
- <summary><strong>Blast-radius analysis</strong></summary>
130
- <br>
126
+ ### Blast-radius analysis
131
127
 
132
- When a file changes, the graph traces every caller, dependent, and test that could be affected. This is the "blast radius" of the change. Claude reads only these files instead of scanning the whole project.
128
+ When a file changes, the graph traces every caller, dependent, and test that could be affected. This is the "blast radius" of the change. Your AI reads only these files instead of scanning the whole project.
133
129
 
134
130
  <p align="center">
135
131
  <img src="diagrams/diagram3_blast_radius.png" alt="Blast radius visualization showing how a change to login() propagates to callers, dependents, and tests" width="70%" />
136
132
  </p>
137
133
 
138
- </details>
139
-
140
- <details>
141
- <summary><strong>Incremental updates in &lt; 2 seconds</strong></summary>
142
- <br>
134
+ ### Incremental updates in < 2 seconds
143
135
 
144
136
  On every git commit or file save, a hook fires. The graph diffs changed files, finds their dependents via SHA-256 hash checks, and re-parses only what changed. A 2,900-file project re-indexes in under 2 seconds.
145
137
 
@@ -147,22 +139,30 @@ On every git commit or file save, a hook fires. The graph diffs changed files, f
147
139
  <img src="diagrams/diagram4_incremental_update.png" alt="Incremental update flow: git commit triggers diff, finds dependents, re-parses only 5 files while 2,910 are skipped" width="90%" />
148
140
  </p>
149
141
 
150
- </details>
142
+ ### The monorepo problem, solved
151
143
 
152
- <details>
153
- <summary><strong>18 supported languages</strong></summary>
154
- <br>
144
+ Large monorepos are where token waste is most painful. The graph cuts through the noise — 27,700+ files excluded from review context, only ~15 files actually read.
145
+
146
+ <p align="center">
147
+ <img src="diagrams/diagram6_monorepo_funnel.png" alt="Next.js monorepo: 27,732 files funnelled through code-review-graph down to ~15 files — 49x fewer tokens" width="80%" />
148
+ </p>
155
149
 
156
- Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl
150
+ ### 19 languages + Jupyter notebooks
157
151
 
158
- Each language has full Tree-sitter grammar support for functions, classes, imports, call sites, inheritance, and test detection.
152
+ <p align="center">
153
+ <img src="diagrams/diagram9_language_coverage.png" alt="19 languages organized by category: Web, Backend, Systems, Mobile, Scripting, plus Jupyter/Databricks notebook support" width="90%" />
154
+ </p>
159
155
 
160
- </details>
156
+ Full Tree-sitter grammar support for functions, classes, imports, call sites, inheritance, and test detection in every language. Plus Jupyter/Databricks notebook parsing (`.ipynb`) with multi-language cell support (Python, R, SQL), and Perl XS files (`.xs`).
161
157
 
162
158
  ---
163
159
 
164
160
  ## Benchmarks
165
161
 
162
+ <p align="center">
163
+ <img src="diagrams/diagram5_benchmark_board.png" alt="Benchmarks across real repos: 4.9x to 27.3x fewer tokens, higher review quality" width="85%" />
164
+ </p>
165
+
166
166
  All numbers come from the automated evaluation runner against 6 real open-source repositories (13 commits total). Reproduce with `code-review-graph eval --all`. Raw data in [`evaluate/reports/summary.md`](evaluate/reports/summary.md).
167
167
 
168
168
  <details>
@@ -230,6 +230,30 @@ The blast-radius analysis never misses an actually impacted file (perfect recall
230
230
 
231
231
  ---
232
232
 
233
+ ## Features
234
+
235
+ | Feature | Details |
236
+ |---------|---------|
237
+ | **Incremental updates** | Re-parses only changed files. Subsequent updates complete in under 2 seconds. |
238
+ | **19 languages + notebooks** | Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl, Lua, Jupyter/Databricks (.ipynb) |
239
+ | **Blast-radius analysis** | Shows exactly which functions, classes, and files are affected by any change |
240
+ | **Auto-update hooks** | Graph updates on every file edit and git commit without manual intervention |
241
+ | **Semantic search** | Optional vector embeddings via sentence-transformers, Google Gemini, or MiniMax |
242
+ | **Interactive visualisation** | D3.js force-directed graph with edge-type toggles and search |
243
+ | **Local storage** | SQLite file in `.code-review-graph/`. No external database, no cloud dependency. |
244
+ | **Watch mode** | Continuous graph updates as you work |
245
+ | **Execution flows** | Trace call chains from entry points, sorted by criticality |
246
+ | **Community detection** | Cluster related code via Leiden algorithm or file grouping |
247
+ | **Architecture overview** | Auto-generated architecture map with coupling warnings |
248
+ | **Risk-scored reviews** | `detect_changes` maps diffs to affected functions, flows, and test gaps |
249
+ | **Refactoring tools** | Rename preview, dead code detection, community-driven suggestions |
250
+ | **Wiki generation** | Auto-generate markdown wiki from community structure |
251
+ | **Multi-repo registry** | Register multiple repos, search across all of them |
252
+ | **MCP prompts** | 5 workflow templates: review, architecture, debug, onboard, pre-merge |
253
+ | **Full-text search** | FTS5-powered hybrid search combining keyword and vector similarity |
254
+
255
+ ---
256
+
233
257
  ## Usage
234
258
 
235
259
  <details>
@@ -268,10 +292,10 @@ code-review-graph serve # Start MCP server
268
292
  </details>
269
293
 
270
294
  <details>
271
- <summary><strong>MCP tools</strong></summary>
295
+ <summary><strong>22 MCP tools</strong></summary>
272
296
  <br>
273
297
 
274
- Claude uses these automatically once the graph is built.
298
+ Your AI assistant uses these automatically once the graph is built.
275
299
 
276
300
  | Tool | Description |
277
301
  |------|-------------|
@@ -303,30 +327,6 @@ Claude uses these automatically once the graph is built.
303
327
 
304
328
  </details>
305
329
 
306
- ---
307
-
308
- ## Features
309
-
310
- | Feature | Details |
311
- |---------|---------|
312
- | **Incremental updates** | Re-parses only changed files. Subsequent updates complete in under 2 seconds. |
313
- | **18 languages** | Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl |
314
- | **Blast-radius analysis** | Shows exactly which functions, classes, and files are affected by any change |
315
- | **Auto-update hooks** | Graph updates on every file edit and git commit without manual intervention |
316
- | **Semantic search** | Optional vector embeddings via sentence-transformers, Google Gemini, or MiniMax |
317
- | **Interactive visualisation** | D3.js force-directed graph with edge-type toggles and search |
318
- | **Local storage** | SQLite file in `.code-review-graph/`. No external database, no cloud dependency. |
319
- | **Watch mode** | Continuous graph updates as you work |
320
- | **Execution flows** | Trace call chains from entry points, sorted by criticality |
321
- | **Community detection** | Cluster related code via Leiden algorithm or file grouping |
322
- | **Architecture overview** | Auto-generated architecture map with coupling warnings |
323
- | **Risk-scored reviews** | `detect_changes` maps diffs to affected functions, flows, and test gaps |
324
- | **Refactoring tools** | Rename preview, dead code detection, community-driven suggestions |
325
- | **Wiki generation** | Auto-generate markdown wiki from community structure |
326
- | **Multi-repo registry** | Register multiple repos, search across all of them |
327
- | **MCP prompts** | 5 workflow templates: review, architecture, debug, onboard, pre-merge |
328
- | **Full-text search** | FTS5-powered hybrid search combining keyword and vector similarity |
329
-
330
330
  <details>
331
331
  <summary><strong>Configuration</strong></summary>
332
332
  <br>
@@ -379,6 +379,7 @@ MIT. See [LICENSE](LICENSE).
379
379
 
380
380
  <p align="center">
381
381
  <br>
382
+ <a href="https://code-review-graph.com">code-review-graph.com</a><br><br>
382
383
  <code>pip install code-review-graph && code-review-graph install</code><br>
383
- <sub>Works with Claude Code, Cursor, Windsurf, Zed, Continue, and OpenCode</sub>
384
+ <sub>Works with Claude Code, Cursor, Windsurf, Zed, Continue, OpenCode, and Antigravity</sub>
384
385
  </p>
@@ -5,17 +5,18 @@
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
+ <a href="https://code-review-graph.com"><img src="https://img.shields.io/badge/website-code--review--graph.com-blue?style=flat-square" alt="Website"></a>
8
9
  <a href="https://github.com/tirth8205/code-review-graph/stargazers"><img src="https://img.shields.io/github/stars/tirth8205/code-review-graph?style=flat-square" alt="Stars"></a>
9
10
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="MIT Licence"></a>
10
11
  <a href="https://github.com/tirth8205/code-review-graph/actions/workflows/ci.yml"><img src="https://github.com/tirth8205/code-review-graph/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
12
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10%2B-blue.svg?style=flat-square" alt="Python 3.10+"></a>
12
13
  <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-green.svg?style=flat-square" alt="MCP"></a>
13
- <a href="#"><img src="https://img.shields.io/badge/version-2.0.0-purple.svg?style=flat-square" alt="v2.0.0"></a>
14
+ <a href="#"><img src="https://img.shields.io/badge/version-2.1.0-purple.svg?style=flat-square" alt="v2.1.0"></a>
14
15
  </p>
15
16
 
16
17
  <br>
17
18
 
18
- Claude Code re-reads your entire codebase on every task. `code-review-graph` fixes that. It builds a structural map of your code with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), tracks changes incrementally, and gives Claude precise context so it reads only what matters.
19
+ AI coding tools re-read your entire codebase on every task. `code-review-graph` fixes that. It builds a structural map of your code with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), tracks changes incrementally, and gives your AI assistant precise context via [MCP](https://modelcontextprotocol.io/) so it reads only what matters.
19
20
 
20
21
  <p align="center">
21
22
  <img src="diagrams/diagram1_before_vs_after.png" alt="The Token Problem: 8.2x average token reduction across 6 real repositories" width="85%" />
@@ -26,12 +27,16 @@ Claude Code re-reads your entire codebase on every task. `code-review-graph` fix
26
27
  ## Quick Start
27
28
 
28
29
  ```bash
29
- pip install code-review-graph
30
+ pip install code-review-graph # or: pipx install code-review-graph
30
31
  code-review-graph install # auto-detects and configures all supported platforms
31
32
  code-review-graph build # parse your codebase
32
33
  ```
33
34
 
34
- One command sets up everything. `install` detects which AI coding tools you have and writes the correct MCP configuration for each one. Restart your editor/tool after installing.
35
+ One command sets up everything. `install` detects which AI coding tools you have, writes the correct MCP configuration for each one, and injects graph-aware instructions into your platform rules. It auto-detects whether you installed via `uvx` or `pip`/`pipx` and generates the right config. Restart your editor/tool after installing.
36
+
37
+ <p align="center">
38
+ <img src="diagrams/diagram8_supported_platforms.png" alt="One Install, Every Platform: auto-detects Claude Code, Cursor, Windsurf, Zed, Continue, OpenCode, and Antigravity" width="85%" />
39
+ </p>
35
40
 
36
41
  To target a specific platform:
37
42
 
@@ -40,18 +45,7 @@ code-review-graph install --platform cursor # configure only Cursor
40
45
  code-review-graph install --platform claude-code # configure only Claude Code
41
46
  ```
42
47
 
43
- Requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).
44
-
45
- ### Supported Platforms
46
-
47
- | Platform | Config file | Auto-detected |
48
- |----------|-------------|:---:|
49
- | **Claude Code** | `.mcp.json` | Yes |
50
- | **Cursor** | `.cursor/mcp.json` | Yes |
51
- | **Windsurf** | `.windsurf/mcp.json` | Yes |
52
- | **Zed** | `.zed/settings.json` | Yes |
53
- | **Continue** | `.continue/config.json` | Yes |
54
- | **OpenCode** | `.opencode/config.json` | Yes |
48
+ Requires Python 3.10+. For the best experience, install [uv](https://docs.astral.sh/uv/) (the MCP config will use `uvx` if available, otherwise falls back to the `code-review-graph` command directly).
55
49
 
56
50
  Then open your project and ask your AI assistant:
57
51
 
@@ -65,27 +59,25 @@ The initial build takes ~10 seconds for a 500-file project. After that, the grap
65
59
 
66
60
  ## How It Works
67
61
 
68
- Your repository is parsed into an AST with Tree-sitter, stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage), then queried at review time to compute the minimal set of files Claude needs to read.
62
+ <p align="center">
63
+ <img src="diagrams/diagram7_mcp_integration_flow.png" alt="How your AI assistant uses the graph: User asks for review, AI checks MCP tools, graph returns blast radius and risk scores, AI reads only what matters" width="80%" />
64
+ </p>
65
+
66
+ Your repository is parsed into an AST with Tree-sitter, stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage), then queried at review time to compute the minimal set of files your AI assistant needs to read.
69
67
 
70
68
  <p align="center">
71
69
  <img src="diagrams/diagram2_architecture_pipeline.png" alt="Architecture pipeline: Repository to Tree-sitter Parser to SQLite Graph to Blast Radius to Minimal Review Set" width="100%" />
72
70
  </p>
73
71
 
74
- <details>
75
- <summary><strong>Blast-radius analysis</strong></summary>
76
- <br>
72
+ ### Blast-radius analysis
77
73
 
78
- When a file changes, the graph traces every caller, dependent, and test that could be affected. This is the "blast radius" of the change. Claude reads only these files instead of scanning the whole project.
74
+ When a file changes, the graph traces every caller, dependent, and test that could be affected. This is the "blast radius" of the change. Your AI reads only these files instead of scanning the whole project.
79
75
 
80
76
  <p align="center">
81
77
  <img src="diagrams/diagram3_blast_radius.png" alt="Blast radius visualization showing how a change to login() propagates to callers, dependents, and tests" width="70%" />
82
78
  </p>
83
79
 
84
- </details>
85
-
86
- <details>
87
- <summary><strong>Incremental updates in &lt; 2 seconds</strong></summary>
88
- <br>
80
+ ### Incremental updates in < 2 seconds
89
81
 
90
82
  On every git commit or file save, a hook fires. The graph diffs changed files, finds their dependents via SHA-256 hash checks, and re-parses only what changed. A 2,900-file project re-indexes in under 2 seconds.
91
83
 
@@ -93,22 +85,30 @@ On every git commit or file save, a hook fires. The graph diffs changed files, f
93
85
  <img src="diagrams/diagram4_incremental_update.png" alt="Incremental update flow: git commit triggers diff, finds dependents, re-parses only 5 files while 2,910 are skipped" width="90%" />
94
86
  </p>
95
87
 
96
- </details>
88
+ ### The monorepo problem, solved
97
89
 
98
- <details>
99
- <summary><strong>18 supported languages</strong></summary>
100
- <br>
90
+ Large monorepos are where token waste is most painful. The graph cuts through the noise — 27,700+ files excluded from review context, only ~15 files actually read.
91
+
92
+ <p align="center">
93
+ <img src="diagrams/diagram6_monorepo_funnel.png" alt="Next.js monorepo: 27,732 files funnelled through code-review-graph down to ~15 files — 49x fewer tokens" width="80%" />
94
+ </p>
101
95
 
102
- Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl
96
+ ### 19 languages + Jupyter notebooks
103
97
 
104
- Each language has full Tree-sitter grammar support for functions, classes, imports, call sites, inheritance, and test detection.
98
+ <p align="center">
99
+ <img src="diagrams/diagram9_language_coverage.png" alt="19 languages organized by category: Web, Backend, Systems, Mobile, Scripting, plus Jupyter/Databricks notebook support" width="90%" />
100
+ </p>
105
101
 
106
- </details>
102
+ Full Tree-sitter grammar support for functions, classes, imports, call sites, inheritance, and test detection in every language. Plus Jupyter/Databricks notebook parsing (`.ipynb`) with multi-language cell support (Python, R, SQL), and Perl XS files (`.xs`).
107
103
 
108
104
  ---
109
105
 
110
106
  ## Benchmarks
111
107
 
108
+ <p align="center">
109
+ <img src="diagrams/diagram5_benchmark_board.png" alt="Benchmarks across real repos: 4.9x to 27.3x fewer tokens, higher review quality" width="85%" />
110
+ </p>
111
+
112
112
  All numbers come from the automated evaluation runner against 6 real open-source repositories (13 commits total). Reproduce with `code-review-graph eval --all`. Raw data in [`evaluate/reports/summary.md`](evaluate/reports/summary.md).
113
113
 
114
114
  <details>
@@ -176,6 +176,30 @@ The blast-radius analysis never misses an actually impacted file (perfect recall
176
176
 
177
177
  ---
178
178
 
179
+ ## Features
180
+
181
+ | Feature | Details |
182
+ |---------|---------|
183
+ | **Incremental updates** | Re-parses only changed files. Subsequent updates complete in under 2 seconds. |
184
+ | **19 languages + notebooks** | Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl, Lua, Jupyter/Databricks (.ipynb) |
185
+ | **Blast-radius analysis** | Shows exactly which functions, classes, and files are affected by any change |
186
+ | **Auto-update hooks** | Graph updates on every file edit and git commit without manual intervention |
187
+ | **Semantic search** | Optional vector embeddings via sentence-transformers, Google Gemini, or MiniMax |
188
+ | **Interactive visualisation** | D3.js force-directed graph with edge-type toggles and search |
189
+ | **Local storage** | SQLite file in `.code-review-graph/`. No external database, no cloud dependency. |
190
+ | **Watch mode** | Continuous graph updates as you work |
191
+ | **Execution flows** | Trace call chains from entry points, sorted by criticality |
192
+ | **Community detection** | Cluster related code via Leiden algorithm or file grouping |
193
+ | **Architecture overview** | Auto-generated architecture map with coupling warnings |
194
+ | **Risk-scored reviews** | `detect_changes` maps diffs to affected functions, flows, and test gaps |
195
+ | **Refactoring tools** | Rename preview, dead code detection, community-driven suggestions |
196
+ | **Wiki generation** | Auto-generate markdown wiki from community structure |
197
+ | **Multi-repo registry** | Register multiple repos, search across all of them |
198
+ | **MCP prompts** | 5 workflow templates: review, architecture, debug, onboard, pre-merge |
199
+ | **Full-text search** | FTS5-powered hybrid search combining keyword and vector similarity |
200
+
201
+ ---
202
+
179
203
  ## Usage
180
204
 
181
205
  <details>
@@ -214,10 +238,10 @@ code-review-graph serve # Start MCP server
214
238
  </details>
215
239
 
216
240
  <details>
217
- <summary><strong>MCP tools</strong></summary>
241
+ <summary><strong>22 MCP tools</strong></summary>
218
242
  <br>
219
243
 
220
- Claude uses these automatically once the graph is built.
244
+ Your AI assistant uses these automatically once the graph is built.
221
245
 
222
246
  | Tool | Description |
223
247
  |------|-------------|
@@ -249,30 +273,6 @@ Claude uses these automatically once the graph is built.
249
273
 
250
274
  </details>
251
275
 
252
- ---
253
-
254
- ## Features
255
-
256
- | Feature | Details |
257
- |---------|---------|
258
- | **Incremental updates** | Re-parses only changed files. Subsequent updates complete in under 2 seconds. |
259
- | **18 languages** | Python, TypeScript/TSX, JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++, Dart, R, Perl |
260
- | **Blast-radius analysis** | Shows exactly which functions, classes, and files are affected by any change |
261
- | **Auto-update hooks** | Graph updates on every file edit and git commit without manual intervention |
262
- | **Semantic search** | Optional vector embeddings via sentence-transformers, Google Gemini, or MiniMax |
263
- | **Interactive visualisation** | D3.js force-directed graph with edge-type toggles and search |
264
- | **Local storage** | SQLite file in `.code-review-graph/`. No external database, no cloud dependency. |
265
- | **Watch mode** | Continuous graph updates as you work |
266
- | **Execution flows** | Trace call chains from entry points, sorted by criticality |
267
- | **Community detection** | Cluster related code via Leiden algorithm or file grouping |
268
- | **Architecture overview** | Auto-generated architecture map with coupling warnings |
269
- | **Risk-scored reviews** | `detect_changes` maps diffs to affected functions, flows, and test gaps |
270
- | **Refactoring tools** | Rename preview, dead code detection, community-driven suggestions |
271
- | **Wiki generation** | Auto-generate markdown wiki from community structure |
272
- | **Multi-repo registry** | Register multiple repos, search across all of them |
273
- | **MCP prompts** | 5 workflow templates: review, architecture, debug, onboard, pre-merge |
274
- | **Full-text search** | FTS5-powered hybrid search combining keyword and vector similarity |
275
-
276
276
  <details>
277
277
  <summary><strong>Configuration</strong></summary>
278
278
  <br>
@@ -325,6 +325,7 @@ MIT. See [LICENSE](LICENSE).
325
325
 
326
326
  <p align="center">
327
327
  <br>
328
+ <a href="https://code-review-graph.com">code-review-graph.com</a><br><br>
328
329
  <code>pip install code-review-graph && code-review-graph install</code><br>
329
- <sub>Works with Claude Code, Cursor, Windsurf, Zed, Continue, and OpenCode</sub>
330
+ <sub>Works with Claude Code, Cursor, Windsurf, Zed, Continue, OpenCode, and Antigravity</sub>
330
331
  </p>
@@ -1,3 +1,3 @@
1
1
  """Code Review Graph - MCP server for persistent incremental code knowledge graphs."""
2
2
 
3
- __version__ = "2.0.0"
3
+ __version__ = "2.1.0"
@@ -104,6 +104,8 @@ def _handle_init(args: argparse.Namespace) -> None:
104
104
 
105
105
  dry_run = getattr(args, "dry_run", False)
106
106
  target = getattr(args, "platform", "all") or "all"
107
+ if target == "claude-code":
108
+ target = "claude"
107
109
 
108
110
  print("Installing MCP server config...")
109
111
  configured = install_platform_configs(repo_root, target=target, dry_run=dry_run)
@@ -117,28 +119,35 @@ def _handle_init(args: argparse.Namespace) -> None:
117
119
  print("\n[dry-run] No files were modified.")
118
120
  return
119
121
 
120
- # Handle --skills, --hooks, --all flags
121
- install_all = getattr(args, "install_all", False)
122
- want_skills = getattr(args, "skills", False) or install_all
123
- want_hooks = getattr(args, "hooks", False) or install_all
124
-
125
- if want_skills or want_hooks:
126
- from .skills import generate_skills, inject_claude_md, install_hooks
122
+ # Skills and hooks are installed by default so Claude actually uses the
123
+ # graph tools proactively. Use --no-skills / --no-hooks to opt out.
124
+ skip_skills = getattr(args, "no_skills", False)
125
+ skip_hooks = getattr(args, "no_hooks", False)
126
+ # Legacy: --skills/--hooks/--all still accepted (no-op, everything is default)
127
+
128
+ from .skills import (
129
+ generate_skills,
130
+ inject_claude_md,
131
+ inject_platform_instructions,
132
+ install_hooks,
133
+ )
127
134
 
128
- if want_skills:
129
- skills_dir = generate_skills(repo_root)
130
- print(f"Generated skills in {skills_dir}")
131
- inject_claude_md(repo_root)
132
- print("Updated CLAUDE.md with MCP tools reference")
135
+ if not skip_skills:
136
+ skills_dir = generate_skills(repo_root)
137
+ print(f"Generated skills in {skills_dir}")
138
+ inject_claude_md(repo_root)
139
+ updated = inject_platform_instructions(repo_root)
140
+ if updated:
141
+ print(f"Injected graph instructions into: {', '.join(updated)}")
133
142
 
134
- if want_hooks:
135
- install_hooks(repo_root)
136
- print(f"Installed hooks in {repo_root / '.claude' / 'settings.json'}")
143
+ if not skip_hooks:
144
+ install_hooks(repo_root)
145
+ print(f"Installed hooks in {repo_root / '.claude' / 'settings.json'}")
137
146
 
138
147
  print()
139
148
  print("Next steps:")
140
149
  print(" 1. code-review-graph build # build the knowledge graph")
141
- print(" 2. Restart Claude Code # to pick up the new MCP server")
150
+ print(" 2. Restart your AI coding tool to pick up the new config")
142
151
 
143
152
 
144
153
  def main() -> None:
@@ -162,21 +171,22 @@ def main() -> None:
162
171
  help="Show what would be done without writing files",
163
172
  )
164
173
  install_cmd.add_argument(
165
- "--skills", action="store_true",
166
- help="Generate Claude Code skill files in .claude/skills/",
167
- )
168
- install_cmd.add_argument(
169
- "--hooks", action="store_true",
170
- help="Install Claude Code hooks in .claude/settings.json",
174
+ "--no-skills", action="store_true",
175
+ help="Skip generating Claude Code skill files",
171
176
  )
172
177
  install_cmd.add_argument(
173
- "--all", action="store_true", dest="install_all",
174
- help="Install skills, hooks, and CLAUDE.md integration",
178
+ "--no-hooks", action="store_true",
179
+ help="Skip installing Claude Code hooks",
175
180
  )
181
+ # Legacy flags (kept for backwards compat, now no-ops since all is default)
182
+ install_cmd.add_argument("--skills", action="store_true", help=argparse.SUPPRESS)
183
+ install_cmd.add_argument("--hooks", action="store_true", help=argparse.SUPPRESS)
184
+ install_cmd.add_argument("--all", action="store_true", dest="install_all",
185
+ help=argparse.SUPPRESS)
176
186
  install_cmd.add_argument(
177
187
  "--platform",
178
188
  choices=[
179
- "claude", "cursor", "windsurf", "zed",
189
+ "claude", "claude-code", "cursor", "windsurf", "zed",
180
190
  "continue", "opencode", "antigravity", "all",
181
191
  ],
182
192
  default="all",
@@ -192,21 +202,21 @@ def main() -> None:
192
202
  help="Show what would be done without writing files",
193
203
  )
194
204
  init_cmd.add_argument(
195
- "--skills", action="store_true",
196
- help="Generate Claude Code skill files in .claude/skills/",
205
+ "--no-skills", action="store_true",
206
+ help="Skip generating Claude Code skill files",
197
207
  )
198
208
  init_cmd.add_argument(
199
- "--hooks", action="store_true",
200
- help="Install Claude Code hooks in .claude/settings.json",
201
- )
202
- init_cmd.add_argument(
203
- "--all", action="store_true", dest="install_all",
204
- help="Install skills, hooks, and CLAUDE.md integration",
209
+ "--no-hooks", action="store_true",
210
+ help="Skip installing Claude Code hooks",
205
211
  )
212
+ init_cmd.add_argument("--skills", action="store_true", help=argparse.SUPPRESS)
213
+ init_cmd.add_argument("--hooks", action="store_true", help=argparse.SUPPRESS)
214
+ init_cmd.add_argument("--all", action="store_true", dest="install_all",
215
+ help=argparse.SUPPRESS)
206
216
  init_cmd.add_argument(
207
217
  "--platform",
208
218
  choices=[
209
- "claude", "cursor", "windsurf", "zed",
219
+ "claude", "claude-code", "cursor", "windsurf", "zed",
210
220
  "continue", "opencode", "antigravity", "all",
211
221
  ],
212
222
  default="all",
@@ -432,6 +442,21 @@ def main() -> None:
432
442
  print(f"Files: {stats.files_count}")
433
443
  print(f"Languages: {', '.join(stats.languages)}")
434
444
  print(f"Last updated: {stats.last_updated or 'never'}")
445
+ # Show branch info and warn if stale
446
+ stored_branch = store.get_metadata("git_branch")
447
+ stored_sha = store.get_metadata("git_head_sha")
448
+ if stored_branch:
449
+ print(f"Built on branch: {stored_branch}")
450
+ if stored_sha:
451
+ print(f"Built at commit: {stored_sha[:12]}")
452
+ from .incremental import _git_branch_info
453
+ current_branch, current_sha = _git_branch_info(repo_root)
454
+ if stored_branch and current_branch and stored_branch != current_branch:
455
+ print(
456
+ f"WARNING: Graph was built on '{stored_branch}' "
457
+ f"but you are now on '{current_branch}'. "
458
+ f"Run 'code-review-graph build' to rebuild."
459
+ )
435
460
 
436
461
  elif args.command == "watch":
437
462
  watch(repo_root, store)
@@ -62,7 +62,11 @@ class LocalEmbeddingProvider(EmbeddingProvider):
62
62
  if self._model is None:
63
63
  try:
64
64
  from sentence_transformers import SentenceTransformer
65
- self._model = SentenceTransformer(self._model_name)
65
+ self._model = SentenceTransformer(
66
+ self._model_name,
67
+ trust_remote_code=True,
68
+ model_kwargs={"trust_remote_code": True},
69
+ )
66
70
  except ImportError:
67
71
  raise ImportError(
68
72
  "sentence-transformers not installed. "