ChengRang

CodeGraph

AI Coding Free

100% local pre-indexed code knowledge graph, optimizing token usage and privacy for Claude Code/Cursor/Codex, open source

Code IndexKnowledge GraphOpen SourceToken OptimizationLocal
Visit CodeGraph

Disclaimer: Review content represents our editorial team's views and experience, not commercial recommendation or investment advice. Product info and pricing may change; refer to official sources.

Overview

CodeGraph is a **local code knowledge graph tool** open-sourced by developer **colbymchenry in May 2026**, designed to optimize token consumption and code retrieval efficiency for AI coding tools such as Claude Code / Codex / Gemini / Cursor / OpenCode / AntiGravity / Kiro / Hermes Agent.

**Core problem to solve**: AI coding tools have a common flaw when handling large codebases—**a large number of tokens are wasted in the 'discovery phase'** (the agent repeatedly executes find/ls/grep to explore the project structure before finding the needed code), with actual code writing accounting for only a small portion. This leads to token explosion, slow response times, and easily spending tens of dollars a day on Claude Code.

**CodeGraph's solution**: **Pre-scan the entire codebase, use tree-sitter to parse all functions, classes, variables, and dependencies, build a code knowledge graph stored in SQLite**, then connect to the AI agent via the MCP protocol. When the agent needs to understand code, it **directly queries the graph** (one query returns precise results in seconds), eliminating the need to repeatedly execute file system commands.

**Key selling points**:

- **100% local operation**: All parsing, storage, and queries run on your machine; code is never uploaded to any third-party service, ensuring privacy and enterprise compliance

- **Significant token reduction**: Real-world feedback (from the Juejin community) shows token consumption can be reduced by 30-60% on large projects, especially for 'big spenders' like Claude Code, with immediate effect

- **Faster response times**: Graph queries are millisecond-level, much faster than the agent repeatedly running grep, resulting in a smoother overall coding experience

- **Zero compilation, zero dependencies**: CodeGraph comes with its own runtime, no native compilation needed, consistent experience on Windows/Mac/Linux

- **Standard MCP protocol integration**: Directly integrates with mainstream AI coding tools like Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, Hermes Agent via MCP configuration

- **Automatic code change synchronization**: The graph updates automatically after code modifications, no need for manual re-indexing

**Technical approach**: tree-sitter parsing (covering 40+ languages) + SQLite storage (no external database dependency) + MCP protocol integration. No black magic—just the simple yet highly effective idea of 'pre-paying the cost of the discovery phase'.

Key Features

Use Cases

Pros

Summary

CodeGraph is a local code knowledge graph tool designed specifically for AI programming tools, suitable for developers using AI coding assistants like Claude Code, Cursor, and Codex to handle large codebases. Its core advantage lies in pre-indexing code structures, significantly reducing token consumption (30-60%) and improving response speed, while running 100% locally to ensure privacy and security. It requires zero compilation and zero dependencies, supports 40+ languages, and automatically syncs code changes.

Category
AI Coding
Pricing
Free
Tags
Code Index · Knowledge Graph · Open Source
Website

Related Tools