What is CodeGraphX?
CodeGraphX (CGX) is a local, token-efficient codebase graph engine for AI coding agents and human developers. It parses source code with Tree-sitter, stores a bi-temporal semantic graph in SQLite, and serves it over a CLI and an MCP server.
How to use CodeGraphX?
Install with npm install -g codegraphx, then run cgx init to index the codebase. Query symbols with cgx query <symbol> or trace impact with cgx impact. The MCP server (cgx-mcp) exposes six tools for AI agents, with zero-config auto-indexing on first start.
Key features of CodeGraphX
- Persistent, queryable graph of code symbols and relationships
- O(1) symbol lookup via Bloom filter
- Recursive upstream/downstream impact tracing
- Cross-language call graph linking (frontend to backend routes)
- Bi-temporal history: query codebase as of any commit
- Token-optimized output in TOON format for AI agents
Use cases of CodeGraphX
- Identifying blast radius of a function change before refactoring
- Providing structural context to AI agents without scanning files
- Detecting dead imports, circular dependencies, and syntax errors
- Comparing task descriptions against actual code changes for verification
- Understanding cross-language API contracts between frontend and backend
Comments