What search previews do to agent efficiency
tl;dr
Personal agents are the future of AI interactions. But the more they can do for you, the more of your life they need access to. Email, notes, docs, code, old chats. Once that pile gets big enough, the question stops being whether the agent can find the answer. It becomes how much it wastes getting there.
So I tested this on a mixed corpus of 119k files: my own code, email, Drive, Notion and AI chat logs, plus two large third-party repos that make up most of it. I didn’t detect a coverage difference from preview length. The agents usually got to the answer eventually. The difference was how efficiently they got there.
In Claude Code, 500-character document previews cut wasted file opens by 24% and saved about 1 turn per question, with coverage within 5 points, across 1,680 runs. Median runtime stayed roughly the same (25.3 s vs 25.8 s with 200 characters), and cost was about 11% higher. I also ran the same test inside a real personal agent, Amuse, on two more models, and didn’t detect a coverage difference there either.
Definitions
- Preview: the snippet the agent sees in search results before deciding whether to open a file.
- Open: reading the whole file.
- Wasted open: opening a file that didn’t help answer the question.
- Open precision: the share of opened files that were relevant.
- Turn: one step where the agent thinks or calls a tool.
- Coverage: how many expected facts made it into the answer. This is what I used to measure accuracy, not a check that the entire answer was correct.
- Grep: plain text search through files. This is how coding agents navigate currently.
- Measurable change: a difference whose 95% confidence interval doesn’t include 0, so the data can tell whether it went up or down.
Methods
- Corpus: a mixed corpus, frozen as a read-only snapshot. About 119k files: my own code, email, Drive, Notion and AI chat logs, plus two large third-party repos. Secrets were redacted. Financial, medical and credential content was excluded. An earlier 100k-file snapshot came to about 3.1B tokens, about 82% of them from the two third-party repos, kept as realistic clutter. It isn’t meant to represent a typical user’s data.
- Agent: Claude Code running Opus 5.5 at high effort.
- Amuse: Replit’s open-source local assistant on localhost, with my patch adding MCP client support. gpt-6-luna on both preview lengths (200 and 500 characters) × 80 questions × 2 runs, gpt-6.2-sol on both × 80 × 1. A grep arm was also run but excluded after a tool setup error; a rerun is in progress. Fresh database every run, same blind grading.
- Rules for each test were written and committed to git before any run.
- Questions were checked independently. A fresh AI judge graded answers blind, without knowing the method. I also spot-checked the reference answers.
- Only question types are published. No real questions, answers, file names or transcripts.
Preview study setup
The goal was to find out what an agent should see before it opens a file.
The questions in my first tests were too easy, so I built 80 new ones where searching the question’s own words never put the answer in the top 10. They covered the kinds of things you’d ask a personal agent: what’s the latest on something, questions needing two or three sources, lists and counts, answers buried in long files, specific time windows, and questions with no answer at all.
An independent check rejected 21 of the 104 questions that passed the generator’s own filter. I used 80 of the 83 questions that were left, and I spot-checked 15 myself.
Then I tested 7 ways to show search results. Same corpus and harness, and the preview was the main thing that changed: grep had no search engine, and the dates method also got a recent-first option.
- Grep without a preview
- File path and title only
- 200-character preview
- 500-character preview
- Metadata card with source, date, etc. and 200 characters
- One-line summary
- 200 characters plus dates for recency
Some methods overlapped with the earlier experiment in the appendix, which was already partly testing previews. But I needed to try them again on the harder questions. I ran each of the 80 questions on all 7 methods, with 3 runs per question-method pair to check for flukes. 1,680 runs total.
Results
These questions were built so the question’s own words wouldn’t get the answer into the top 10. The agent still found it by rewriting searches and opening files until it had what it needed. In Claude Code, every method got every buried-answer question right, and all 7 were within 5 points of each other on coverage overall.
Across repeat runs, it opened the same first file only 41 to 55% of the time, but gave the same answer 83 to 94% of the time.
The main result was the 500-character preview. In Claude Code, it was the only method that clearly beat the baseline on choosing relevant files, though open precision was a secondary measure with no multiple-comparison correction. 60% of the files it opened were relevant, compared with 51% for 200 characters.
That worked out to 24% fewer wasted opens and about 1 fewer turn per question, for about 11% more cost. The fewer turns didn’t translate into a lower median runtime: 25.3 s vs 25.8 s (95% CI of the difference -2.3 to +2.5 s). The extra preview text adds tokens to every search result, which may explain it, but I didn’t measure that. Path-only previews were worst, with about 1.3 extra files opened per question, likely because the agent had nothing to go on.
In all three setups I ran, including the Amuse runs below, 500 characters meant fewer opens, fewer wasted opens and fewer turns. Wasted opens per run went from 2.06 to 1.57 in Claude Code, and from 0.67 to 0.38 and 0.47 to 0.30 in the two Amuse setups.
So the tradeoff is a bit more context per search result in exchange for fewer wasted reads, with coverage and median time about the same. That’s useful if you’re trying to cut unnecessary file reads, not evidence that 500 characters is best for every personal agent.
Does it hold in a real personal agent?
I reran the study inside Amuse, Replit’s open-source local assistant, with a patch that lets it call the same search tools over MCP (fork). Same 80 questions, corpus and tools, pre-registered and blind-graded the same way. I used two models: gpt-6-luna, a cheaper and weaker one, on both preview lengths with 2 runs per question, and gpt-6.2-sol, Amuse’s default, on both preview lengths with 1 run.
| Coverage | Opens | Wasted opens | Turns | |
|---|---|---|---|---|
| luna, 200 characters | 0.390 | 1.16 | 0.67 | 12.37 |
| luna, 500 characters | 0.402 | 0.56 | 0.38 | 11.20 |
| sol, 200 characters | 0.710 | 1.30 | 0.47 | 10.29 |
| sol, 500 characters | 0.729 | 0.70 | 0.30 | 9.14 |
I didn’t detect a coverage difference from preview length here either. Going from 200 to 500 characters, coverage went from 0.390 to 0.402 with luna and from 0.710 to 0.729 with sol. For luna, the difference could be anywhere from a small drop to a small gain (95% CI -0.049 to +0.075), so I can’t call it a measurable change. I also can’t call them equal, because the range went past the ±0.05 bound I set beforehand (90% CI up to +0.065). Luna scored about 0.40, far from the ceiling, so the questions being too easy can’t explain why I didn’t detect a difference.
In these runs, longer previews still meant less work: with 500 characters, both models opened about 0.60 fewer files per run, wasted fewer opens and took fewer turns. Part of that is more runs opening nothing at all (34% to 59% of runs with luna, 26% to 53% with sol), so some of it may be the agent stopping early rather than choosing better. What didn’t carry over was the open precision gain from Claude Code, where a bigger share of opened files were relevant. With luna that share changed by -0.031, but the 95% CI runs from -0.145 to +0.080, so it could have gone either way. The range is that wide because Amuse only opened 0.56 to 1.30 files per run, so the comparison covers just the 45 questions where both arms opened something, and one file more or less moves the share a lot.
Coverage was about 0.95 in Claude Code, 0.72 with sol and 0.40 with luna on the same questions. That’s not a fair head-to-head, since both the model and the harness changed.
Limitations
This is three models and two harnesses, still one person’s corpus. Amuse had 2 runs per question with luna and 1 with sol. I want to try more data and more models before assuming it generalizes.
In Claude Code, 200 and 500 characters tied on median time (grep and path-only were slower), and I ran those runs on my subscription rather than the API, with files read locally. In a real personal agent, reads would go through API calls, which I didn’t time.
Conclusion and future work
- Tiered previews. Longer ones for the top hits, shorter ones for the rest, to keep the savings at lower cost.
- Corpus maps. Give the agent a summarized map of the files before it starts.
- A proper Grok Bot test, with a fresh account and more questions.
- Why accuracy is lower in Amuse: the agent stopping early vs the model’s ability, and whether a budget tracker helps.
- A public benchmark other people can run.
Appendix: How I got here
Predicting the agent
I started by trying to predict what the agent would do next, so I could give it the right tools without it spending too long deciding.
First I built tool bundles, basically groups of tools for a common task or intent. Then I added a small scout model to plan the main model’s first step. I also tried switching models between turns. All three failed the rules I’d written down before testing.
The problem is that models don’t agree with themselves. Give an agent the same question again and it’ll chase different leads and call different tools. In a replay test on MCP-Atlas tasks, Sonnet picked the same tool with equivalent arguments only 36 to 48% of the time per turn. That makes the changing path hard to predict.
Search vs grep
Next I looked at the search methods themselves. I compared 4 methods on 97 questions: plain grep, keyword search returning full chunks, keyword search returning 200-character previews, and those same previews with dates so the agent could see what was newest.
They all ended up around 97% coverage. Again, the agents were usually capable enough to get the expected facts regardless of the method. But the questions were also a bit too easy. For 42% of them, keyword searching the question’s own words put the right document first.
Time and cost were where things changed. Full chunks were fastest at 22.7 seconds, but dumping all that text into context made them cost around 50% more. Grep was slowest at around 37.8 seconds. The 200-character previews had the fewest errors (0.021 per answer vs 0.031 to 0.052).
For the fourth method, I thought dates would help the agent get to the right, most recent answer in fewer turns. My prediction was at least 15% faster than grep at the same coverage. It passed the coverage, cost and error checks, but missed the speed bar: 34.9 s against a 32.1 s target (15% under grep’s 37.8 s). So I reported it as a failure.
Time mostly followed how many turns the agent took. Cost followed how much text piled up in its context.
Picking a method per question
Since nothing won outright, I went back to prediction. What if I could pick the best method for each question before the agent started?
A perfect picker would’ve saved about 21 to 24% of the cost. But the classifiers I built only saw the question, and they did worse than just sticking with one method.
At that point I stopped trying to predict the agent. There was a best choice, but I couldn’t reliably pick it before the agent started searching. So instead of guessing where it would go, I looked at what it sees when it searches. That became the preview study in Methods and Results above.