XERJ: A Single Rust Binary That Stops Your Coding Agent From Burning Tokens on grep
Your coding agent has an expensive habit: when it needs to understand a codebase, it reads files. One by one. grep here, open-the-whole-file there, dump it all into the context window, pay for every token. On a large repo, that’s where your bill — and your context budget — quietly evaporates.
XERJ (GitHub’s #1 Repository of the Day) is a direct answer: give the agent a real search engine so it pulls the exact code it needs instead of reading everything around it.
One Binary, No Infrastructure
XERJ is a single static Rust binary — no JVM, no Docker, no services to babysit. Point it at a folder and it autoindexes everything with zero config: code, docs, logs, JSONL, CSV, PDFs, even SQLite. It then serves:
- BM25 full-text search (lexical, offline, no embeddings required)
- Vector search (opt-in neural embedder, ~90 MB download)
- Hybrid search (BM25 + kNN)
- Code search without grep —
xerj def "euler_to_rotationmatrix"returns a go-to-definition with file:line and signature - Agent memory via
/_memorynamespaces - An Elasticsearch-compatible API, so existing clients and tools just work
- Native MCP, so Claude Code, Cursor, and friends wire in with one
xerj init
The whole loop looks like this:
curl -fsSL https://xerj.org/get | sh
xerj --insecure --data-dir ./data &
xerj init # wire into Claude Code / Cursor (MCP + skill)
xerj autoindex ~/my-project
xerj search "how do we rotate the WAL segment" # ranked passages, file:line
xerj def "euler_to_rotationmatrix" # file:line + signature
xerj gain # what it saved you — counted, not estimated
The Real Trick: Reference Coding
The most interesting use isn’t searching your code — it’s searching other people’s. XERJ calls it reference coding: point an agent at a task, and it clones and indexes the open-source repos closest to the problem, then searches how they solved it before writing a single line.
This is the opposite of letting a model improvise from memory. Instead of hoping GPT-5 remembers how to implement a rotation matrix or a WAL segment rotation, the agent reads how three real projects actually did it, then adapts. The claim — backed by a controlled study in the README — is that this lets a smaller, cheaper model out-code a pricier one working from memory, while you spend less time in fix loops.
The numbers they report: 2.7x fewer output tokens at the same 16/16 solve rate in a controlled study, and roughly 5x in everyday field reports.
Where It Fits — And a Word of Caution
We’ve covered this whole “stop grepping, start indexing” shift before: codebase-memory’s graph approach, GitNexus’s precomputed dependency intelligence, and jevgrep’s semantic code search. XERJ’s differentiator is breadth in one binary: lexical + vector + hybrid, Elasticsearch-compatible, offline by default, and that reference-coding workflow baked in.
Two honest caveats worth flagging:
- The
--insecureflag is a loaded gun. XERJ’s own README says it plainly: turning off TLS and API-key auth makes every caller that can reach the port a superuser who can read and delete every index, including your agent’s memory. Fine on a trusted laptop; never on an exposed port. - The badges are candid. The screenshot making the rounds shows
CI failing,release v1.0.0-rc.96, andstars invalid— it’s early, fast-moving, and release-candidate. Treat it as promising-but-young.
If your agents are hemorrhaging tokens reading files, XERJ is one of the cleaner bets to try — one binary, one autoindex, and a gain command that counts what it saved you instead of estimating.
Repo: github.com/xerj-org/xerj · Site: xerj.org