Agents · Apr 9 2026 · 6 min
grep can't
keep up.
AI agents inherited a 1973 reflex: reach for grep, rg, find. On a 4.47 million-file drive, that reflex costs minutes per lookup.
TL;DR
The short version. Five points, then the proof.
- 01A filename lookup on a 4.47M-file drive (Ryzen 9 9950X3D) returns in 85µs (139µs median), 412,000× faster than VS Code, and ~480,000× faster than Windows Search (67 s).
- 02Full-content search runs in ~7 to 9 ms. The query that takes ripgrep 93.8 s finishes in 16 ms (58,625× faster): zero file I/O at query time.
- 03For an agent, context-gathering that burned 6 min 57 s across 71 tool calls collapses to 16 ms in a single call (~7,200,000× faster), dropping search from ~58% of the turn's tokens to ~0%.
- 04The index is always fresh (updates land within ~1 ms of a file change) and it idles at just ~44 MB. The walk happens once, in the background; every query after is free.
- 05Everything local is free forever, no card. Hosting starts at $5.99/mo.
Interlinked Files
filename search · 4.47M files
grep
same query · same machine · same drive
Same machine, same query
Six orders of magnitude separate the slowest from the fastest.
| Tool | Wall clock | Human time | Notes |
|---|---|---|---|
| ripgrep (content search) | 328,300,000 µs | 5 min 28 sec | Walk, open, scan, close × 4.47M files |
| grep (C: drive, literal) | 70,700,000 µs | 70.7 seconds | Sequential walk, no parallelism |
| Windows Search | 67,100,000 µs | 67.1 seconds | Index-based but Windows-scale overhead |
| VS Code Ctrl+P | 35,000,000 µs | 35 seconds | Fuzzy match, single project scope |
| Interlinked (content) | 23,100 µs | 0.023 sec | Sparse n-gram index, zero file I/O at query time |
| Interlinked (filename) | 85 µs | 0.000085 sec | MFT index, sub-millisecond, no disk |
Every tool searched for the same literal string on the same 4.47 million-file NTFS volume. ripgrep opens, scans, and closes every file. Interlinked never touches one.
The wrong tool for this job
grep is fast. At the thing it was built for.
Against a single file, grep is a tight loop in C. Reads bytes, compares to a pattern, moves on. Finishes before you lift your finger off the Enter key.
Against 4.47 million files, grep has to open, read, scan, and close every one. Walk the directory tree. Check permissions. Decide if binary files count. 99.9% filesystem bookkeeping, 0.1% actual pattern matching.
ripgrep parallelizes the walk, skips binaries, uses SIMD. Still the same shape: walk, open, scan, close, repeat. On our corpus, that's 5 minutes and 28 seconds per query.
grep per query
file opens, reads, and closes
Interlinked per query
file opens. Index lookup only.
The agent tax
A single Claude Code turn can trigger 10+ file-search calls. If each one takes 70 seconds, the user is waiting 12 minutes for context gathering alone. The model finishes in seconds. The 1973 tool at the bottom of the stack doesn't.
How an indexed engine works
The walking already happened. Once. In the background. Hours ago.
A purpose-built engine does the walk exactly once, when the machine is idle. It reads every filename and every file's contents, builds data structures that answer lookups in microseconds, and keeps them current as files change. At query time there is no walk. There is only an index lookup, which finishes before the CPU has moved on to the next instruction.
The math is brutal. grep pays the walk cost on every query. An indexed engine pays it once and amortizes across every query forever. Ten searches a day? grep walks ten times. An indexed engine walked once, weeks ago.
Per-query cost breakdown
grep / ripgrep
Walk directory tree
Open 4.47M files
Read + scan each one
Close all handles
Interlinked Files
Hash query string
Probe index in memory
Return file list
The walk cost is paid once at index time. Every query after that is free.
831,764× faster for filenames. 14,199× faster for content.
Same machine. Same query. Same drive.Agent workflows
The agents aren't slow. Their tools are.
| Agent action | With grep/rg | With Interlinked | Improvement |
|---|---|---|---|
| Find a symbol across codebase | 30 to 70s | 0.023s | ~1,500× faster |
| Locate a file by name | 35 to 67s | 0.000085s | ~500,000× faster |
| 10-search turn (typical) | 5 to 12 min | 0.2s | User never waits |
| Full coding session (50 searches) | 25 to 60 min waiting | ~1s total | Search becomes invisible |
For a human running the occasional grep against a single repo, none of this matters. For an AI agent running dozens of lookups per turn across a machine-wide codebase, it's the difference between a workflow that exists and one that doesn't.
The lesson
grep is amazing. This isn't a takedown.
If you're scripting a one-off search, use grep. If you're piping through a log file in real time, use grep. If you want a fast answer on a single directory you're already in, grep is unbeatable. It will outlive all of us.
But when an agent is trying to find one file in four million, with a user waiting on the other end, grep is the tool from the wrong era. Swap it for an indexed engine and the agent stops reaching, stops retrying, stops guessing folders to scope down to. One tool call. 85 microseconds. Done.
The agents aren't slow because the models are slow. They're slow because the 1973 tool at the bottom of their stack can't keep up with the 2026 problem they're being asked to solve.
FAQ
Common questions. Straight answers.
QWhy is grep so slow across a whole drive when it's instant on one file?
Against one file, grep is a tight C loop. Against 4.47 million files it has to open, read, scan, and close every one: that's ripgrep's 93.8 s, nearly all filesystem bookkeeping. Interlinked did that walk once in the background, so each query is just an in-memory index lookup.
QDoes the index stay current, or do I have to rebuild it?
It stays live. Changes are reflected within ~1 ms of a file being written, so every search hits fresh data with no manual reindex.
QHow much does it cost?
Everything local is free forever, no card. Hosting starts at $5.99/mo.
QIf it's always resident, how much memory does it use?
About 44 MB at idle. The expensive full-drive walk runs once when the machine is idle; staying live afterward is nearly free.
QWhat does this actually change for an AI agent?
A lookup that took 6 min 57 s across 71 grep calls becomes 16 ms in one call (~7,200,000× faster). The tokens spent scrolling search output (about 58% of the turn) drop to almost nothing, so the agent stops guessing folders and just gets the answer.