Skip to main content
Back to timeline
xerj-org/xerjSource publication:

Coding agents stop reading files one by one: local index searches open-source repos first, cutting output tokens 2.7x

Synopsis

XERJ is a community-trusted local AI search that automatically indexes any folder, so a coding agent stops reading files one by one and pulls the exact code it needs. Its main use is reference coding: point an agent at a task, and it downloads the closest open-source repos, indexes them, and reuses how they solved the problem before writing its own code. In a controlled study this cut a coding agent's output tokens by 2.7x at the same 16/16 solve rate, with users reporting roughly 5x in everyday work; the gain is gated by memorisation, being neutral to harmful on popular public libraries the model already knows.

Source-provided article image: xerj-org / xerj
GitHub Trending

Interpretation

How a coding agent obtains code changes from reading whole files to retrieving passages by query, with any local folder as the indexed corpus. The prior path was to let the agent grep whole files into context, reaching up to 1.06M input tokens on one corpus in the project's measurements, and it still had to read them. Measured end to end on code the model had not memorised: 8 tasks, 4 languages, 16 runs per arm, using real claude -p token counts.

The tool turns a folder into a searchable corpus that the agent queries before writing. Reference coding is one use of the same primitive: xerj autoindex <folder> makes an agent know a corpus instead of grepping it. One command indexes code, docs, logs, PDFs and SQLite among other sources, and search returns ranked passages with file:line, while go-to-definition returns file:line plus signature.

The benefit depends on whether the model has already memorised the target code. It wins on private, internal, niche or post-cutoff code, and is neutral to harmful on popular public libraries the model already knows. The controlled study reports 2.7x fewer output tokens than grep and 26x fewer than memory alone at the same solve rate, up to 278x fewer on a single Java task, with users reporting roughly 5x in real development.

Perspective

The demonstrated scope is local indexing plus retrieval-based reference coding: one command indexes code, docs, logs, PDFs and SQLite among other sources, search returns ranked passages with file:line, and it wires into Claude Code or Cursor through MCP and a skill. The intended reader is an engineer who needs a coding agent to work on private or niche code, where the gain is clearest on code the model has not memorised.

The value is gated by memorisation: it is neutral to harmful on popular public libraries the model already knows. The case study holds the detailed limits, and this report read only the summary rather than the complete paper.