Codebase Memory
by DeusData
Codebase Memory indexes a repository into a persistent graph of functions, classes, and call chains, so an agent queries structure directly instead of reading files one by one.
Install (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
About
Codebase Memory ships as a single static binary with no runtime dependencies, using vendored tree-sitter grammars to parse 158 languages and, for 12 of them (Python, TypeScript, Go, Java, Rust, C++, and others), a 'Hybrid LSP' layer that resolves types semantically rather than by pattern-matching. It builds all of that into a persistent knowledge graph (functions, classes, call chains, HTTP routes, cross-service links) and claims to index something the size of the Linux kernel (28M LOC, 75K files) in about 3 minutes, with structural queries answered in under a millisecond afterward.
The pitch is token economy: instead of an agent grepping and opening files to reconstruct 'what calls what,' it runs a graph query and gets a direct answer, at what the project describes as roughly 99% fewer tokens for structural questions. A background watcher keeps previously indexed projects current via git-based change detection, and a detect_changes tool maps a git diff straight to the graph nodes it affects, with a rough risk classification attached.
Key features
- Parses 158 languages via vendored tree-sitter grammars, no external runtime required
- Semantic type resolution ('Hybrid LSP') for 12 major languages including Python, TypeScript, Go, Rust, and Java
- Persistent graph of functions, classes, call chains, HTTP routes, and cross-service links
- detect_changes maps a git diff to the graph nodes it touches, with a basic risk classification
- Background watcher keeps indexed projects current automatically via git-based change detection
- Built-in Architecture Decision Record (ADR) management alongside the code graph
Use cases
- Letting an agent answer 'what calls this function' or 'what would this change break' without reading every file
- Onboarding an agent onto a large, unfamiliar codebase quickly via get_architecture and search_graph
- Reviewing the blast radius of a pending change before merging, using detect_changes against a git diff
- Keeping lightweight architecture decision records alongside the same graph the agent already queries
Available tools
index_repository
Indexes a repository into the persistent code knowledge graph.
search_graph
Searches the graph by label, name pattern, file pattern, or connectivity (degree) filters.
trace_path
Runs a breadth-first traversal to show call chains between two points, up to 5 levels deep.
detect_changes
Maps a git diff to the graph nodes it affects, with a rough risk classification.
get_architecture
Returns a codebase overview: languages, packages, routes, and structural hotspots.
Frequently asked questions
Does it need a language runtime like Node or Python installed?
No. It ships as a single static C binary with vendored tree-sitter grammars, so there's nothing else to install for parsing 158 languages.
What happens when I change code after indexing?
A background watcher tracks previously indexed projects with git-based change detection, and detect_changes can map a specific diff to the exact graph nodes it affects.