Codebase Memory MCP: Graph-based code exploration for Claude Code

A developer has created an MCP server called codebase-memory-mcp that addresses a common issue with Claude Code: inefficient token usage when exploring codebase structure. Instead of having Claude grep through files one at a time for questions like "what calls this function?" or "find dead code," this tool builds a persistent knowledge graph of the codebase.
How it works
The server uses Tree-sitter to parse 64 languages (including Python, Go, JavaScript, TypeScript, Rust, Java, and C++) into a SQLite-backed graph that captures functions, classes, call chains, HTTP routes, and cross-service links. When Claude Code asks structural questions, it queries this graph instead of scanning files individually.
Performance improvements
In one comparison, 5 structural questions consumed approximately 412,000 tokens via traditional file-by-file exploration versus only about 3,400 tokens via graph queries—a 120x reduction. The developer reports average savings of around 20x fewer tokens in regular usage, plus significant time savings.
Key features
- 64 language support via Tree-sitter parsing
- Call graph tracing: "what calls ProcessOrder?" returns full chain in <100ms
- Dead code detection with smart entry point filtering
- Cross-service HTTP linking (finds REST calls between services)
- Cypher-like query language for ad-hoc exploration
- Architecture overview with Louvain community detection
- Architecture Decision Records that persist across sessions
- 14 MCP tools (also works with Codex CLI, Cursor, Windsurf and other integrations)
- CLI mode for direct terminal use without an MCP client
Setup and usage
The tool is a single Go binary with no Docker, external databases, or API keys required. Installation is via codebase-memory-mcp install which auto-configures Claude Code. Users simply say "Index this project" to begin, and the graph auto-syncs when files are edited to stay current.
Benchmarks and licensing
The developer benchmarked across 35 real open-source repositories ranging from 78 to 49,000 nodes, including the Linux kernel. The project is open source under MIT license.
📖 Read the full source: r/ClaudeAI
👀 See Also

Claude Code vs. Codex: Real-World Build Test – 36 Files vs. 28, Infinite Loop, and $0.46 Cost Difference
A developer pits Claude Code against Cursor's Codex on two real tasks: a PR triage bot and a WebSocket code review UI. Claude built 36 files in 12 minutes with zero TypeScript errors; Codex produced a working UI but hit an infinite React loop. Cost difference: ~$0.46.

OpenClaw as Infrastructure-as-Code Interface for Home Lab Management
OpenClaw transforms from AI gadget to primary computer interface for home lab management, executing tasks like configuring Traefik containers, creating Dashy configurations, and setting up Tailscale access with direct machine access.

Building a Programming Language with Claude Code: The Cutlet Experiment
Ankur Sethi built a complete programming language called Cutlet using Claude Code over four weeks, with the AI generating every line of code while he focused on guardrails and testing. The language features dynamic typing, vectorized operations, and a REPL, running on macOS and Linux.

Snip tool enables visual communication with AI coding agents
Snip is a free tool that lets developers screenshot, annotate, and draw to show AI agents what they mean visually, while agents can generate diagrams or load images directly through CLI or MCP. Currently runs on Apple Silicon Macs with Mermaid diagram support and HTML support in progress.