Your coding agent finds code the way programmers did in 1974: grep, then read whole files into its context window and burn tokens on all of it. XERJ is a free search engine that indexes the codebase once, so the agent pulls the exact passage it needs. The measured result: 2.7x fewer output tokens at the same solve rate.
The problem: ask a coding agent to work in a large codebase and it does what grep forces it to do: find candidate files, read them whole into the context window, and pay tokens for every line, relevant or not. The XERJ project's own measurements put that at up to 1.06 million input tokens on a single corpus, and the agent still has to read them. The alternative, working from memory, is worse: the model retry-loops on any API it has not memorised.
The one free thing: XERJ, a local-first search engine and MCP server in a single static Rust binary. One command, xerj autoindex, points it at a folder and it indexes code, docs, logs, PDFs, CSV, JSONL and SQLite into typed, queryable indices, code arriving with its symbols and line numbers through tree-sitter, not as flat text. It speaks the Elasticsearch API, so existing clients and dashboards work against it unchanged. One more command, xerj init, wires it into Claude Code or Cursor as an MCP server, and the agent starts querying instead of reading.
The measured study (the project's own, published in its README: 8 tasks, 4 languages, 16 runs per arm, real token counts, on code the model had not memorised). Working from memory only: 260,916 output tokens, $11.18, solved 11 of 16. A grep-driven agent: 26,477 output tokens, $3.27, solved 16 of 16. The same agent with XERJ: 9,982 output tokens, $1.58, solved 16 of 16. That is 2.7x fewer output tokens than grep and 26x fewer than memory at the same solve rate, 2.1x cheaper than grep, and up to 278x fewer tokens on a single Java task. Users report roughly 5x fewer tokens in everyday work; that part is field reports, not a controlled run, and I am keeping it labelled that way.
Step 1: install. One line on Linux or macOS (curl -fsSL https://xerj.org/get | sh), a PowerShell equivalent on Windows, or build from source. No JVM, no dependencies, no account.
Step 2: start it and index. Start the server with a data directory outside the tree you are about to index, run xerj init to wire your agent, then xerj autoindex on your project. After that the agent searches: ranked passages with file and line, go-to-definition, and an agent-memory namespace. A built-in xerj gain command reports what it saved, counted, not estimated.
Step 3: point it at reference code. The sharpest use case is reference coding: clone the open-source projects closest to what you are building, index them, and let the agent retrieve how they solved the problem before it writes its own code. That is where the measured win comes from: private, internal, niche or post-cutoff code the model cannot have memorised.
The catches, stated by the project itself: it is still a release candidate, not a 1.0. The win is gated by memorisation: on popular public libraries the model already knows, retrieval is neutral to harmful, and the README says so. The local start mode disables TLS and authentication, which makes every caller that can reach the port a superuser; a fresh node binds 127.0.0.1 only, and that boundary is the whole security model. An optional reranker can send result text to an outside service; it is off by default.
My read: GOOD, genuinely, for private and internal codebases, big monorepos, and reference coding against unfamiliar projects: the token waste there is real and the fix is one binary. AVERAGE as a blanket grep replacement on popular open-source stacks the model already knows cold. As a daily driver it earns its place the first week xerj gain shows you a number bigger than the hour you spent setting it up.
The seatbelt: this is release-candidate software that indexes your entire codebase into a searchable store. Keep it bound to localhost, never expose the port, and log what you point it at. An unauthenticated index of everything you own is not a productivity tool, it is a breach waiting for a port scan. Cheap is a strategy. Untraceable is a liability.