← All comparisons
Code search · LemonCrow vs ast-grep

What ast-grep says, and what it scored.

A tree-sitter AST pattern matcher for structural search and rewrite: precise when you already know the exact shape of the code you want.

We ran it against LemonCrow's local code search, the code_search tool Workspaces Lite gives Claude Code, Codex and OpenCode, on the same 7,213 searches across 14 open-source repositories. ast-grep put the right file first 27.1% of the time; LemonCrow did 58.2%.

Same queries, same repos
ToolMRRRight firstp95
LemonCrow local search0.67658.2%134ms
ast-grep0.31227.1%1255ms

Its speed claim is about exact AST patterns; the queries here are free text and identifiers, which it is not built for. 0.312 MRR against LemonCrow's 0.676. LemonCrow runs ast-grep itself for structural matches.

MRR (mean reciprocal rank) is 1.0 when the right file is always the first result and 0.5 when it is second on average. Right first is how often the first result was right. p95 is the 95th-percentile query time; slowest is the slowest query seen. July 2026 run, one deterministic pass per query. LemonCrow's row was re-run after a fix to the harness's timing; the other tools' times predate that fix and may read slow. LemonCrow's September 2026 local release scored 0.6425 MRR on a newer set of 6,292 searches, which is not comparable with this table.

What ast-grep says
“ast-grep can precisely search code based on AST, running through ten thousand files in sub seconds.”
Publishes no figuresNo comparison with another toolRepository ↗
By kind of search
SearchLemonCrowast-grep
DefinitionFind the file that defines a named symbol. 1,570 queries.0.8710.555
ContentFind the files whose text matches the query, such as where a name is used. 1,444 queries.0.8640.591
Semantic intentA plain-language description of what the code does. 1,800 queries.0.5760.000
SWE-benchSearches drawn from SWE-bench issue tasks. 1,908 queries.0.4930.230
Agent sessionsSearches coding agents actually ran, mined from real sessions. 491 queries.0.5710.179

MRR per kind. The five kinds add up to the 7,213 queries; every tool ran all of them.

By repository (14)
RepositoryLemonCrowast-grep
astropy0.7150.448
django0.6520.223
flask0.6710.323
lemoncrow0.5370.224
linux0.6680.107
matplotlib0.7470.000
pylint0.7840.452
pytest0.7390.455
requests0.8030.486
scikit-learn0.6690.330
seaborn0.7680.445
sphinx0.5800.299
sympy0.6370.373
xarray0.7640.448

MRR per repository, over all five kinds of search. LemonCrow ranks higher on all 14. The lemoncrow/lemoncrow rows are LemonCrow's own repository, where the agent-session searches come from.

Try it, and check the numbers

Workspaces Lite is free and open source (Apache-2.0), runs on your machine, needs no LemonCrow account and uploads no source. One command installs it and gives Claude Code its tools; use --agent codex or --agent opencode for those agents.

Install Workspaces
$ curl -fsSL https://lemoncrow.com/install.sh | bash -s -- --product workspaces --agent claude

The benchmark scored all 11 third-party tools in BENCHMARKS.md on the same queries. The method, the full table and the raw results are public.