MCP Server Indexes Codebases into Knowledge Graph for 10x Token Reduction

codebase-memory-mcp is an MCP server that replaces file-by-file code exploration with graph queries for AI coding assistants. It parses codebases with tree-sitter into a persistent knowledge graph stored in SQLite, containing functions, classes, call relationships, HTTP routes, and cross-service links as nodes and edges.
Key Features and Specifications
- Single Go binary with zero infrastructure requirements (no Docker, no databases, no API keys)
- Supports 35 programming languages
- Sub-millisecond query performance
- Auto-syncs on file changes via background polling
- Cypher-like query language for complex graph patterns
- MIT licensed
Performance Benchmarks
The server was benchmarked across 35 real-world repositories, showing at least 10x fewer tokens for structural questions compared to traditional file-by-file exploration. Example: A query like "what calls ProcessOrder?" returns a precise call chain in one graph query (~500 tokens) instead of reading dozens of files (~80K tokens).
Tested repositories ranged from 78 to 49,000 nodes. The Linux kernel stress test handled 20,000 nodes and 67,000 edges with zero timeouts.
Use Case for Local LLM Setups
This is particularly valuable for local LLM setups with smaller context windows (8K-32K), where every token counts. The graph returns exactly the structural information needed without dumping entire file contents into context.
The server works with any MCP-compatible client or via CLI mode for direct terminal use.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Claude Code protocol file reduces repetitive questioning
A developer created a single .md file for ~/.claude/rules/ that infers task type and risk from the first message, eliminating Claude Code's typical three-question sequence before starting work.

Open-source Claude Code plugin captures books and converts them to structured Markdown
A developer has open-sourced a Claude Code plugin that automatically captures book pages via screenshots, performs OCR with macOS Vision, and generates structured Markdown files organized by theme rather than chapter order. The tool supports Kindle, Apple Books, Kindle Cloud Reader, and scanned PDFs on macOS.

Handoffs Pattern in Claude Workflows: Two-File Split vs One-Doc Summary
Long Claude sessions break on context decay. Handoffs compress what matters and start fresh. Two approaches: Matt Pocock's single-doc handoff skill vs a two-file split with persistent narrative and ephemeral prompt.

Integrating Local LLM Agents with ComfyUI for Natural Language Batch Image Generation
A developer shares how they wired their local OpenClaw agent to ComfyUI, enabling natural language commands for batch image generation workflows. The integration uses a custom agent skill that maps English requests to ComfyUI workflow JSON and handles API communication.