GitHub radar
XERJ: local search that cuts your AI agent's token usage
This is a free local program that builds a search index over your project: your agent gets the exact file and line it needs instead of reading whole files. The result is faster answers and far fewer tokens for the same work.
It's a program that indexes your files — code, docs, logs — and hands your agent the exact passage with file and line number, instead of the whole file.
When it helps
Useful when your agent works with large or unfamiliar code — your own project or obscure libraries — and burns tokens reading files. For popular libraries the model already knows well, there's barely any gain.
Pros
- Cuts agent token use — up to 26x in the authors' tests
- Runs offline, no GPU needed, one file with no dependencies
- Finds functions by file and line, not whole files
- Free and open source, uses Elasticsearch's query language
Cons
- Without a password and encryption it's local-only, not for a group
- Barely helps with popular libraries the model already knows
- Semantic search needs a separate ~90MB download
How to set it up — step by step
- 1Open a terminal in your project folder and start your AI agent (Claude Code) there.
- 2Send the agent the text from the block below.
- 3Wait while the agent installs XERJ and indexes your project.
- 4Ask the agent to show one search result from your own code.
- 5Check that the agent names a specific file and line, not the whole file.
Text for your agent
Copy this and send it to your agent — Claude Code, Codex, any of them:
Set up XERJ from https://github.com/xerj-org/xerj following its README, index my current project, and show me what xerj search returns for one query from my own code.
It's one static binary with no dependencies: no GPU needed, and by default search runs offline on a plain lexical index, not a neural one. A separate ~90 MB model download is needed only for the neural semantic search mode. The authors say directly that the no-password, no-TLS mode is only for one person on their own machine, not a shared server.
Open on GitHub▌ More finds