Engineering
One code call instead of fifty tool calls — why we built aside-codemode
Agents burn context opening files one by one. Code mode filters inside one sandboxed JavaScript call and returns only the answer. Numbers and limits.
aside-codemode lets an agent run one JavaScript block instead of fifty tool calls, so searching, filtering and summarizing happen in a sandbox and only the answer reaches the model. Counting lines that mention function across a 127,000-file tree finished in 2,966 ms as a 778-byte answer; the same job through grep -r was aborted after 128 seconds and 3.23 GB of output.
The problem is volume, not speed
Ask an agent to “find five files that mention TODO” and it usually opens files one by one. Fifty files means fifty tool calls and fifty files’ worth of bytes in the model’s context — when the answer you wanted was five lines of paths.
The web is the same. If you need only the title and first link from five pages, reading the pages whole sends 1.86 million bytes of HTML to the model.
Turning it into one call
Code mode flips the order. The model writes what it wants as code; the code runs in a sandbox, reads, filters and reduces, and returns only the result.
const hits = await search.content({ path: ".", query: "TODO", max: 50 });
return [...new Set(hits.rows.map((r) => r.file))].slice(0, 5);
Only five paths reach the model. Browsing works the same way: open several URLs in one session and get back typed rows with just the values you asked for. In the repository’s 2026-09-15 measurement, five pages came back as 4,430 bytes instead of 1,865,043.
The engine was already there
Aside already shipped ripgrep, but no documented tool reached it. An agent’s real options were grep and find through bash. aside-codemode brings that engine onto the tool surface — it is not a faster search engine. Against ripgrep called directly, the two are level.
How to read the numbers
There are two kinds of numbers for this tool.
- Operator report: on a real development folder,
find+greptook 55 seconds and one call took one second. The folder and exact options were not recorded, so this is not an independent reproduction. - Controlled measurement: 2026-09-18, seven runs after a discarded warm-up. Across a 127,000-file tree,
grep -rhad emitted 3.23 GB after 128 seconds and was aborted;search.countanswered in 2,966 ms with 778 bytes — 502,963 matching lines in 57,403 files.
The second matters more. It is less a speedup than a question an agent holding POSIX tools could not ask at all. The full tables, including where it loses, are in the repository’s BENCHMARKS.md.
Same idea, another tool
agbrowse follows the same principle: short browser commands with no resident MCP server, printing only the evidence you need. The first question we ask when building agent tools is “what actually reaches the model?”
FAQ
Does code mode make search faster?
The engine is the same — aside-codemode calls the ripgrep that Aside already ships. What changes is that results are filtered before they reach the model, so only the answer is sent.
Can I trust the "55 seconds to one second" figure?
That figure is an operator report from a real folder, not an independent reproduction. The controlled measurement is from 2026-09-18 with seven runs; method and the losing cases are published in the repository's BENCHMARKS.md.