# Frontier labs sell tokens, and their coding agents are trained to grep. We graded 251 greps: 36% missed

> Source: <https://discuss.huggingface.co/t/frontier-labs-sell-tokens-and-their-coding-agents-are-trained-to-grep-we-graded-251-greps-36-missed/192958#post_2>
> Published: 2026-12-02 03:01:11+00:00

**Recommendation:** Keep grep's output unchanged but append up to three files suggested by a code embedding model plus a code graph and reranker; the source recovered the needed file in 46 of 50 replayed misses with no regression on 25 controls.
More in the playbook "Working with AI coding agents": <https://wpnews.pro/playbooks/coding-agents>

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 is`installBundle()` calling`fs.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](https://www.papr.ai/blog/coding-agent-grep-cost) 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](https://huggingface.co/papr-ai/papr-embed-code-1-0.6b)

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?
