Reduce AI Coding Session Costs by 90% with Graph-Based Code Indexing

A Reddit user reports spending $2-6 per query on Claude Code due to the model re-reading dozens of files every session. Even with caching (70% of tokens from cache at 90% discount), cache resets per session. The fix: a local server that indexes the codebase into a graph database, queried via the Model Context Protocol (MCP) instead of raw file reads.
How It Works
- Instead of AST parsing or vector embeddings, the tool uses an LLM to generate a purpose, summary, and business context for each file, plus links to its functions, classes, and imports.
- The graph is exposed through an MCP server; Claude queries the graph for targeted lookups (2-4 nodes per question) instead of dumping the entire repo into context.
- Session costs dropped from dollars to cents. The approach works equally well with open-source models like DeepSeek-V4 and Kimi-2.6 because retrieval (not model size) does the heavy lifting.
Setup Details
Everything runs locally, single-tenant, no cloud dependency. The project is open-sourced on GitHub: github.com/ByteBell/bytebell-oss. The user notes they aren't using AST parsing or vectors — the graph is LLM-generated file analyses.
Who This Is For
Developers using Claude Code (or any token-cost AI agent) on large codebases who want to slash costs by caching structural context across sessions.
📖 Read the full source: r/ClaudeAI
👀 See Also

Exploring Clawe: Open-source Multi-agent Coordination System
Clawe is an open-source tool allowing for efficient multi-agent coordination, offering features like scheduling, task management, and real-time notifications.

Using OpenAI Codex IDE with Local Ollama Models in VSCodium
OpenAI Codex IDE can be configured to work with local Ollama models in VSCodium using specific configurations in the config.toml file.

CLI Tools with AI Agent Compatibility: Skills Directory Approach
A Reddit user shares a method for making CLI tools work with AI coding agents like Claude Code by creating SKILL.md files that teach agents installation, authentication, and usage. The approach addresses common issues like interactive prompts, JSON output, and authentication methods.

TUI Studio: Visual Terminal UI Design Tool in Alpha
TUI Studio is a Figma-like visual editor for designing terminal user interfaces with drag-and-drop components, real-time ANSI preview, and planned export to six frameworks including Ink, BubbleTea, and Textual. Currently in alpha with non-functional exports, it's available for macOS, Windows, and Docker.