elara-labs/code-context-engine

Save 94% on AI coding tokens. Index your codebase, agents search instead of reading files. Works with Claude Code, Codex, Copilot, Cursor, Gemini CLI. Local MCP server, free, open source.

What it solves

Code Context Engine (CCE) reduces the high cost and latency of AI coding assistants by preventing them from re-reading entire files. Instead of feeding massive amounts of raw code into the LLM's context window, CCE indexes the codebase locally and allows the AI to search for and retrieve only the most relevant snippets, significantly reducing input token usage.

How it works

  1. Indexing: The engine uses Tree-sitter to parse code into semantic chunks (classes, functions, modules) and stores them as vector embeddings locally using sqlite-vec.
  2. Search: When an AI agent calls the context_search tool, CCE performs a hybrid search (combining vector similarity and BM25 keyword matching) and uses a code graph to pull in related files via imports and calls.
  3. Compression: Retrieved chunks are compressed into signatures and docstrings to further save tokens before being sent to the LLM.
  4. Memory: It persists decisions and worked-on code areas across sessions using a local SQLite database, allowing the AI to recall previous architectural choices.
  5. Integration: It integrates with various AI editors and agents (Claude Code, Cursor, VS Code, Gemini CLI, etc.) via the Model Context Protocol (MCP).

Who it’s for

Developers using AI coding agents (like Claude Code or Cursor) who want to lower their API costs, improve response speed, and keep their codebase indexing entirely local and private.

Highlights

  • Massive Token Savings: Benchmarked at 94% retrieval savings on projects like FastAPI.
  • Local-First: Zero cloud indexing; all data stays on the machine.
  • Cross-Session Memory: Remembers architectural decisions and specific code areas across restarts.
  • Broad Compatibility: Supports multiple editors and agents through MCP and a portable Agent Plugin standard.
  • Built-in Analytics: Includes a dashboard and CLI tool to track actual dollar savings based on provider pricing.
  • Secure by Default: Automatically scrubs PII and ignores secret files like .env or credentials.

Related

  • Project
  • Project
  • Project
  • Project
  • Project