Live data from Hacker News

Is grep all you need? How agent harnesses reshape agentic search

arxiv.org

11–20 of 73 posts

Re: Is grep all you need? How agent harnesses reshape agentic search

#11

Tangential, I have a hook that rewriters grep to rg but lately I wonder if this is actually wasteful as the model is so biased to grep, is there a way to shim/alias perhaps?

If performance is the concern, ugrep will get you most of the way there relative to gnu grep, and should be fully grep compatible in terms of syntax:

https://github.com/Genivia/ugrep#aliases

Claude Code may ship with ugrep already.

Re: Is grep all you need? How agent harnesses reshape agentic search

#12
post #6

Earlier quoted context omitted.

Many harnesses are doing this already, "Grep" is the tool name, ripgrep is the implementation It depends on if it is using Grep the harness tool or Grep from the bash tool

I see it using the Bash tool infrequently though sometimes Grep. I'm on Claude Code for now due to subscription lock-in, been contemplating moving to pi though

My experience here (also Claude user) is that the model uses different tools in different contexts. I see rg more on frontend and grep more on backend work. I imagine it defaults to using the tool it has more learning around within the contexts it's reaching for and since for the most part it's 6 of one or half a dozen of the other you'll see environment specific usages for these tools in claude for now. I imagine eventually it'll standardize but we're early yet on such things.

If you'd told me a decade ago I'd finally learn some sed in 26 because I'd want to understand what the AI was doing I'd have told you you were crazy . . .

Re: Is grep all you need? How agent harnesses reshape agentic search

#14

Tangential, I have a hook that rewriters grep to rg but lately I wonder if this is actually wasteful as the model is so biased to grep, is there a way to shim/alias perhaps?

My CLI does something close to this:

https://github.com/gitsense/gsc-cli

`gsc grep` is just an alias for `gsc rg`, mostly because agents are much more likely to reach for “grep” than “rg”.

It works pretty well, but it is not a perfect drop-in replacement. `grep` and `ripgrep` differ in a few details, especially around glob/wildcard behaviour and flags. What I found works is to not use `grep` in search examples, and have the CLI spit out an error message for the AI saying this is `ripgrep`, so it needs to use `ripgrep` syntax.

Re: Is grep all you need? How agent harnesses reshape agentic search

#16

If you are truly bitter-lesson pilled - give the agent all the tools and let it decide which to use. - regex (grep) - hybrid search (bm25+vector) this X vs Y is uninteresting when the answer can be both.

I'm still disappointed that ai can't use ctags, its used for finding strings and patterns, its right there.

Re: Is grep all you need? How agent harnesses reshape agentic search

#18

If you are truly bitter-lesson pilled - give the agent all the tools and let it decide which to use. - regex (grep) - hybrid search (bm25+vector) this X vs Y is uninteresting when the answer can be both.

That assumes that the agent knows which one is better. And to bake in which one is better via post-training would require a study like this to establish where each one works well

Re: Is grep all you need? How agent harnesses reshape agentic search

#19
post #13

This is a surprising result. With structured inputs like source code, I’d expect grep to outperform semantic search, but natural language’s errors and inconsistencies seem to leave so many cracks for information to fall through.

This paper is based on quality so I don't think it should be that surprising if you take loops into consideration. What the agent finds in the first pass, can help if formulate the next grep if needed.
Post reply on HN