code-context
Local code search for AI coding agents: a CLI and MCP server with hybrid keyword + semantic search and SQL relevance-ranked aggregation over an index in plain files. No accounts, no keys, no server.
A local, file-based code search index and MCP server that helps AI coding agents find code without reading every file.
code-context builds a local search index over your codebase so an AI coding agent like Claude Code can find relevant code by asking questions instead of reading through files one by one. It ships as both a command line tool and an MCP server, and the index itself is stored as plain files inside your own repository rather than in a database or a cloud account.
The core idea is that the more a question spans the whole codebase, such as which files contain the most code related to a topic, the more this approach saves compared to an agent pulling files into context one at a time. Search combines exact keyword matching with semantic similarity in a single ranked pass, and results include the matching code along with the exact file path and line numbers. Search can also be used inside SQL queries, so an agent can ask something like which files have the most code about a given topic and get a ranked, grouped answer in one query rather than reading through the repo manually.
Indexing happens in stages. The keyword index builds first and is ready in seconds, even before an embedding model has finished downloading. Semantic vector search fills in afterward in the background, and edits to the codebase are re-synced incrementally, so only changed files are reprocessed. Everything runs locally: there are no accounts, no API keys, and no external server involved, aside from downloading a small embedding model once.
The tool is built on top of infino, the authors' own retrieval engine, which stores data as Parquet files and supports full text search, vector search, and SQL over the same copy of the data. It installs easily as a Claude Code plugin or as a generic MCP server for other coding agents. According to the authors' own benchmark against standard file search tools, code-context reduced token usage by around 30 to 40 percent and tool calls by around 50 percent on their own codebase, with the biggest gains on questions that require aggregating information across many files rather than looking up a single symbol.
The project is written in TypeScript and released under the Apache 2.0 license.
Where it fits
- Speed up an AI coding agent by giving it a searchable index instead of raw file reads.
- Ask aggregate questions like which files have the most code about a topic, answered via SQL.
- Add code search to Claude Code or another MCP-compatible agent with a one-line install.
- Keep a private, offline index of a codebase with no accounts or API keys involved.