We renamed a function across 24 files in a TypeScript codebase.
The grep approach ingested 492,954 bytes to accomplish it: grep to find all occurrences, read each file to understand context, replace, build to verify, read build output.
The LSP approach ingested 342 bytes. One rename_symbol call returned a structured workspace edit.
That's 1,441x fewer tokens for the exact same operation.
The experiment
We built a reproducible Go script that measures the actual byte cost of common code intelligence tasks using two approaches:
Grep/Read : what AI agents do today. Grep for a symbol, read the file, grep again, read context. This is how every agent without LSP navigates code.
LSP : structured queries to a language server. Get exactly the information needed, in a machine-readable format, with zero false positives.
For each task, we measure total bytes that enter the agent's context window on both sides.…