Convert Your Remaining Cost Into Coffee ☕
Reduce repository exploration costs, shrink context windows by up to 45.9%, and help AI coding agents find deterministic codebase answers faster.
100% Local-First
All index calculations, SQLite queries, and AST compiles execute locally. No code telemetry egress.
MCP Compatible
Plugs seamlessly into Claude Code, Cursor, Codex, VS Code, and any client supporting the stdio protocol.
8ms Sync Watchdog
Incremental watchdog captures file modifications on-save and updates only changed checksums instantly.
Context Compress
Returns compressed, semantic code definitions instead of bloated files, preserving LLM context size.
Quality Benchmarks
Direct measurements of context efficiency and API footprint comparing CostAffective against CodeGraph on large repositories.
Featured Case Study: Continue OSS (3,203 Files)
CostAffective vs CodeGraph| Evaluation Metric | CostAffective | CodeGraph | Winner |
|---|---|---|---|
| Total Tokens | 4,708,835 | 8,707,328 | 🏆 CostAffective |
| Subagent Calls (Exploration Loops) | 43 | 94 | 🏆 CostAffective |
| API Calls (Tool Interactions) | 89 | 134 | 🏆 CostAffective |
| Deliverables Generated | 4 | 4 | Tie |
How It Works
CostAffective indexes codebases statically using compilers to map declarations. Experience it live inside our AST compiler simulator.
class="ast-keyword">import tree_sitterclass Parser: def __init__(self, language): self.language = language def parse_file(self, filepath): """Extract functions and calls from path""" print(f"Parsing AST for: {filepath}") tree = self.language.parse(filepath) return self.extract_symbols(tree.root_node)Extracted AST Nodes
Architectural Overview
Hover or click components inside the relational flow diagram to examine operational modules.
AST Relational Parser & Watcher
Parses files statically using tree-sitter compiler definitions to extract symbols, implementations, and call relationships. Monitored by a background fsnotify watchdog.
Relevant Repository Files
- internal/watcher/watcher.go
- internal/watcher/watchdog.go
- internal/parser/ast.go
Codebase Inspector
Browse through directories of the actual CostAffective local codebase to verify its architecture.
internal/retriever
Semantic Search EnginesImplements the core 9 indexing algorithms (treesitter, grep, fts, auto, naive) used to measure benchmark scores.
Compiled AST Symbols
Editor Configurator
Select your IDE platform below to generate setup profiles.
{
"mcpServers": {
"costaffective": {
"command": "costaffective",
"args": ["serve"]
}
}
}CostAffective vs Alternatives
See how CostAffective outperforms legacy dependency graphs and simple file search tools.
CodeGraph
Saves 43.8% token context compared to heavy code-graph pointer files.
Serena
Restores offline security and local parsing without cloud data egress.
Graphify
Opt for optimized symbol arrays instead of complex spatial coordinates.
ripgrep
Retrieves logical scopes rather than noisy, generic text lines.
Frequently Asked Questions
Find answers to common questions about indexing, token optimization, and IDE integrations.
How does CostAffective save prompt tokens?
Instead of piping full files to LLMs during coding tasks, CostAffective extracts only structural declarations and scopes, trimming down input contexts by up to 45.9%.
Does it send my codebase to external cloud APIs?
No. CostAffective operates fully local. All compilation and SQLite index writes are done locally on your computer.
Developed by Yash Gajjar
Connect with the developer of CostAffective-MCP.
⭐ Support the Project
CostAffective is open-source (MIT). Star the repo on GitHub to help others discover local-first repository intelligence.
Save Context. Write Code.
Install the local-first repository intelligence server now and enjoy sub-millisecond, token-efficient semantic retrievals.