UCSD-led CodeNib cuts coding-agent tokens 50–87% on five models
TL;DR
- CodeNib pre-computes lexical (BM25), dense (FAISS), and structural (typed graph) views per commit and serves them through one runtime.
- Eager and eager+compact policies cut trajectory tokens 50–87% versus grep/read across Claude Haiku 4.5, Qwen 3.5, Gemma 4, and Gemini 2.5 Flash.
- Symbol-level graph repair runs a median 8.7x faster, vector updates 25.4x, and static symbol navigation matches a live LSP on 632/1,000 requests.
A new paper from UC San Diego, Stanford, UC Riverside and USC argues that the interesting lever in a coding agent isn't the model, it's what you hand the model before it starts thinking. Their system, CodeNib, pre-computes lexical (BM25/trigram), dense (FAISS embeddings), and structural (typed graph) views of each repository commit, then serves ranked search, symbol navigation, and bounded context through one runtime rather than letting the agent grep and read its way to the answer.
The headline result is a trajectory-token reduction of 50 to 87 percent versus a paired grep/read baseline, measured across five models: Claude Haiku 4.5, Qwen 3.5, Gemma 4, and Gemini 2.5 Flash, while keeping AnswerRecall@5 within a 5 percent margin. Two eager policies do the work: injecting frozen top-10 code blocks up front, and a one-time compaction that lets the KV cache actually reuse the prefix on subsequent turns.
Incremental maintenance is the other half of the story, and the part that decides whether any of this is deployable. On 40 graph transitions across 8 repositories, symbol-level repair matched an independent rebuild about 45 percent of the time and, when it matched, was a median 8.7x faster. Vector maintenance matched 28 of 31 transitions with a median 25.4x speedup, largely because content-addressed embedding reuse is easy when doc identities are stable. Static symbol navigation matched a live LSP on 632 of 1,000 requests and ran 4.7x faster on those.
The honest caveats are inside the same tables. Static navigation matches live definitions 87 percent of the time but references only 39 percent, and the language mix matters a lot, with Go references matching just 22 percent and TS/JS 44 percent. Adding a Qwen-4B reranker buys about 4.6 recall points at 46.6x the latency. Graph expansion via RRF fusion came back inconclusive, with confidence intervals crossing zero. What the paper does not give you is any head-to-head against production agent scaffolds like Cursor or Claude Code, or a dollar-level cost model at team scale.
Still, the framing is the useful part for anyone shipping an agent. Token spend at the trajectory level is where coding-agent unit economics actually live, and pushing retrieval, symbol resolution, and structural context out of the model's turn and into an indexed side-car is a lever that open-model shops running Qwen or Gemma can pull as easily as teams on hosted Claude or Gemini.
Originally reported by huggingface.co
Read the original article →Original headline: UCSD's CodeNib Ships Multi-View Repo Context System, Cuts Coding-Agent Trajectory Tokens 50-87% Across Five Models