Frontier labs sell tokens. Their coding agents find code with grep: in 49 Cursor transcripts we counted 3,294 greps and 2 semantic searches. So we checked how well grep actually works.

Disclosure: I work on Papr, and the embedding models below are ours. We hand-graded 251 real greps our coding agent ran on our own repo. In 91 (36%) the right code wasn’t in the results. The agent almost never stopped: 85 of 90 misses went on to write code, and that code was reworked within a week more often (65% vs 48%, small sample).

Cost: across 5,268 tool-using turns (Aug–Nov 2026), turns with 5+ searches were 29% of turns and 63% of spend. Those are also the bigger tasks, so this shows where spend sits, not a controlled saving.

Two questions I’d like opinions on:

  1. Why is grep the default search action in agent training? It’s easy to train on: every repo has it, the output is plain text, and a non-empty result looks like progress. But it requires guessing the identifier first. Our example: searching “copy app files” returns nothing, because the function isinstallBundle() callingfs.cp .
  2. Is there an incentive problem? Labs bill by the token. A nine-call search bills nine calls, and a miss bills the rewrite. I don’t think anyone designed it that way, but nothing obviously pushes the other way. Are there agent RL setups that reward finding the right file in fewer calls?

What we tried: keep grep’s output untouched and add up to three files it likely missed, found by a 0.6B code embedding model running on-device, with a code graph and a reranker on top. On 50 replayed misses the needed file showed up 46 times, and the 25 controls didn’t get worse.

Full method, grading rubric and benchmarks: Coding agent grep cost: 63% of spend, 1 in 3 misses | Papr The 0.6B model (Apache-2.0, fine-tuned from Qwen3-Embedding-0.6B, CoreML + ONNX): papr-ai/papr-embed-code-1-0.6b · Hugging Face

Has anyone measured the miss rate of their own agent’s greps? And if you think the token incentive is the wrong explanation, what explains 3,294 greps to 2 semantic searches?

原文来源:discuss.huggingface.co