skip to content
Active

Aleph Zero

Local code search for coding agents. It indexes a repository on your machine and answers what an agent asks before it edits code: where something is handled, where a name is defined, who calls it, and what the project has decided about it. A Claude Code plugin, an MCP server and a command line.

4 min read

Why it exists

Before a coding agent changes anything, it has to find where to change it. Most of the time it does that with grep: guess a word, read the hits, guess another. On a large repository that burns tokens and turns, and a wrong first guess sends the whole edit to the wrong file.

Hosted code-search tools answer these questions well, but they send the code off the machine, and they index a commit, not the working tree the agent is editing right now. I wanted an index that is always current, uncommitted edits included, that never sends code anywhere, and that answers in milliseconds, so asking it costs less than one more grep.

How it works

  • Search. Hybrid retrieval over code and documentation: full-text search (BM25) with identifiers split from camelCase and snake_case, a lookup of definitions by name, a match on file paths and, optionally, search by meaning with a local embedding model. The four are fused into one ranking, and results are file and line ranges sized to a token budget.
  • Code structure and call graph. Definitions and outlines for eight languages, read with tree-sitter. Who calls a function and what it calls, resolved through imports, classes, inheritance and stated types, each edge marked certain or candidate. A compiler’s SCIP index, when imported, replaces the guesses with exact answers for the files it still matches.
  • Architecture facts. What the code states about the system: HTTP routes and where routers are mounted, models and tables, environment variables, background tasks, queues and gRPC services, each with its file and line. When a prompt, or a pattern the agent greps for, names a route or an environment variable, or a prompt’s words point to a route, the plugin adds where the code handles it, once its tools are allowed. Where a server is generated from an OpenAPI document, each operation leads to its handler.
  • Module summaries. In a Python project, a question about a whole area puts first the files of the modules that match it best, from summaries made without a model, so they are never stale.
  • Linked sources and a side chat. Documentation or code from another repository is searched beside your own and cited as name:path, and /aleph opens a side chat about the repository whose answers cite path:line.
  • Decisions and memory. It ranks a repository’s ADRs for a task, so the agent sees what was already decided. Answers and notes are kept per repository and recalled later, each citing code by content, so a recall says whether that code has changed since. Recall works by words and recency, and also by meaning when my Aeon memory store is installed.

Design decisions

  • Always current, no rebuild. Every answer reflects the working tree as it is now. Edits, pulls and branch switches are picked up at the next question; only what changed is read again.
  • Local only. Code, index, vectors and memories stay on the machine. The network is used only to fetch what it needs: a language’s grammar the first time that language is read, and, when asked, the optional embedding model and its build tools, or a repository linked by URL.
  • A feature ships only if it is measured. Search by meaning is on by default only for the languages where it gained at least 5 points of file recall@10 on issue titles, with a 95% interval that excludes zero (JavaScript, TypeScript, C, C++, Rust), and off for Python, Go and Java, where it did not, even though on whole issue texts it gains 5 to 20 points in every language. The changelog records what was measured and not shipped as carefully as what was.
  • Honest about what is not proven. The plugin can steer the agent to search before it greps, but measured sessions have not yet shown that this saves tokens, and the README says so instead of claiming it.
  • Fast enough to be the first move. 25 to 160 ms a warm question (median) on repositories of 4,000 to 90,000 chunks, on an M4 Max.
  • Works with oxn. With an oxn.yaml, it also answers which layer a file belongs to and what that layer may depend on.

Status

Active, at 0.1.20. Developed and measured on macOS on Apple Silicon; Linux is expected to work but untested. MIT licensed.

Click any figure or table to zoom.