Live data from Hacker News

Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

github.com

161–170 of 187 posts

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#161
Interesting for sure, but I think I need to be convinced this is necessary. How many tokens does Grep use on the average response anyways? Does this reduce input token usage from 100k to 2k per query or from 1k to 20? How does this effect output code quality?

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#162
post #106

> uses 98% fewer tokens than grep So are we supposed to believe that grep is so wasteful that models are reading 98% useless garbage every time they call it? Either this claim is not representative, or you're missing something else when you throw away the vast majority of context for the model.

The 98% is vs the grep+read loop, not grep output alone. When an agent hits an unfamiliar codebase it typically does "cat file" or reads the whole thing first, at least in my experience. If you're reliably getting agents to do "grep -C N" and stop there I'd genuinely be curious what your setup looks like, because I think the quality of the results is just too low to serve as useful context.

> When an agent hits an unfamiliar codebase it typically does "cat file" or reads the whole thing first, at least in my experience.

Depends on the size of the project and specific files. I have definitely seen agents make smart use of pi's "read" tool, which can take an offset and line limit (or defaults to a max 2000 lines/50KiB if the model doesn't specify). The bash tool also has the same max output, so if a model decides to cat instead of using the read tool it still wont blow out its context window with a single large file read.

But this sort of thing is going to vary with harness, model, project, and whatever the RNG delivers for the day.

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#164

What I have personally observed with such tools is that they make the AI's dumb, similar to how it makes coders dumb when relying more on AI tools. These agentic AI's are already smart enough to figure out a highly optimized path to code exploration or search. But, with these tools, they just go very aggressive, partly because the search results from these tools almost in 100% of the cases do not furnish full details…

I'm seeing over and over again people claiming absurd optimizations for coding agents:

> Our tool uses 99x fewer tokens and delivers 88x better results.

Okay, great, but...

1) It's VERY difficult to quantify something is better.

2) They almost never post how they measured how much better it is and what the margin of error might be.

3) I assume they are incompetent and don't even try the tool.

Like you pointed out, the odds these things make agents worse is FAR higher than they make them better.

Not saying it's impossible, but if it was possible on the scales they are claiming, it probably would already be done, or put into the next release of the agents...

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#165
post #97

Earlier quoted context omitted.

> These agentic AI's are already smart enough to figure out a highly optimized path to code exploration or search. Hasn't been my experience. We used to use Augment Code at work which has a thing called Context Engine - basically an MCP that can answer natural language queries about pre-indexed code. Then we switched to Claude Code, which for some reason prefers to use sed to read from files using line ranges from it…

Lol... I noticed it does weird stuff sometimes. I'll see it generate a python script inline on the CLI to edit files. Like... Yo what the fuck? It literally used the edit tool until 5 turn ago. Also, it'll run a formatter, read, edit to undo auto formatting and then continue on its merry way. What is the point of that??? Lol

I’ve seen Claude write a one line Perl script to pull items from a json file.

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#166
So about a year ago I wrote my own attempt at something like this using vector indexing and BM25 (the latest version uses CocoIndex, I had a custom coded solution using ChromaDB before). I wrote a comprehensive enough test set that showed performance increases on the quality of search results and reduction in token usage versus grep and rg. I haven't had time to really polish it but it worked well enough, particularly for one project where I have around 250k documentation files and docs out number code files 1000 to 1 (about 50% reduction in tokens and 30% increase in successful searches). Yesterday for grins I tried this project and was fairly disappointed to see it blow away my kludged solution particularly given that it doesn't have a lengthy indexing process. I haven't tested it on the 250k doc project yet, but in another project that I have a test suite for semantic search on it outperformed my solution by about 20% even on documentation in terms of successful search results (which I didn't expect given that it seems to only be tuned for code). I haven't gone through the code to see what its doing differently than what I tried, but what ever its doing it seems to have potential.

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#167

Earlier quoted context omitted.

> Just one line in AGENTS.md and CLAUDE.md: "Start by reading PROJECT.md" . > And PROJECT.md contains... …Why not just use that PROJECT.md as the AGENTS/CLAUDE.md?

Doing that would mean copying and keeping in-sync two files: AGENTS.md and CLAUDE.md since I use both, claude, and others intercheangeably in one project. Also, I dont want to keep my project's details in those files, but, keep it separate. With current setup/way, a single line in both satisifies all constraints and requirements.

I use AGENTS.md as the "global" agent file, then use CLAUDE.md as a light wrapper with Claude-specific instructions which ends in an instruction to read AGENTS.md .

Re: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

#170
post #56

Interesting. I too have been working in this space, though I took a different approach. Rather than building an index, I worked on making a "smarter grep" by offering search over codebases (and any text content really) with ranking and some structural awareness of the code. Most of my time was spend dealing with performance, and as a result it runs extremely quickly. I will have to add this as a comparison to https:/…

I was going to share a link to this. Thank you for making `cs`, I use it both with LLMs and directly in the terminal, despite not performing indexing it's pretty fast for my needs. Also definitely planning to try out semble.

You are welcome. Glad to hear its working for you. I have a few ideas I am working on to improve its relevance too that I hope pan out.
Post reply on HN