logoalt Hacker News

ltbarcly3 • today at 2:40 PM • 1 reply • view on HN

In general, in my experience, grep is better than almost anything else you can use. It's very very fast and efficient, very flexible, and does not require any indexing pass, is never out of date, and doesn't require you to guess ahead of time what files you might want to search or how to process search tokens.

"Search your files, repos and agent sessions, locally, and give your agents the best context for the job. One search points them to the few passages that matter, instead of grepping the whole disk."

Grep is already searching for relevant passages with a single tool call. This is clearly LLM written copy. It makes literally no sense.

This reminds me of the dating app advert I keep seeing on tiktok, which says that other dating sites "force you to be the loudest voice on your profile". There's no interpretation that makes sense, it's just the typical LLM gibberish.

Indexing local files makes search faster (in theory, but in practice maybe not for less than a few tens of GB of local files on fast SSD), but not more flexible or requiring less tool calls.

It also will always suffer from being a little behind the on disk state, which is terrible when you are trying to do something like find all the references to something under active development, or when changing branches. Consider you checkout a branch and call this tool, it will just lie to you, telling your LLM there are matches in files that no longer match, getting line numbers wrong, missing matches in other files. Every time you change branches it will go nuts trying to reindex everything. The best case scenario is still probably performance on par with grep but out of date and doing a ton of extra work to index files whether or not you ever need to search them.

Grep can take general regex, which more or less can't be indexed, so there's very few things that are more flexible or produce less tool calls than grep.

Grep is also absurdly fast, if you don't know how fast it is it's faster than you think. Here I use ripgrep to search every piece of code I have checked out, around 11GB of data (more or less) in 0.2s (regular gnu grep takes 4s, mostly because it doesn't exclude .git/ folders and only uses one processor):

  xyz@xx:~% du -sh checkout
  11G checkout
  xyz@xx:~% time rg robotic checkout|wc -l
  19
  rg robotic checkout  1.14s user 1.07s system 1151% cpu 0.192 total
  wc -l  0.00s user 0.00s system 1% cpu 0.192 total

Replies

flecomet • today at 7:43 PM

Although I agree with all your points, I think there is a potential caveat with grep: it is not very token-efficient as it can return lots of matches, filling up the agent's context.

A potential solution for these indexing systems is to maintain several indexes (one per branch for example). Idk how they handle code changes though.

But I think the bigger negative signal is that these tools have been around for roughly as long as LLMs have, yet they are still barely used. Maybe because they are not that useful ?