Live data from Hacker News

Why Cline doesn't index your codebase

cline.bot

111–120 of 131 posts

Re: Why Cline doesn't index your codebase

#111
I cant help but think this article was published as a direct response to Cline's (arguably superior) fork, Roo Code, releasing an experimental Codebase Indexer in the past week...

https://docs.roocode.com/features/experimental/codebase-inde...

Augment Code's secret sauce is largely its code indexer, and I find it to be the best coding agent around.

Re: Why Cline doesn't index your codebase

#112

Earlier quoted context omitted.

Fair point Jeff -- you're right that we're still doing retrieval. The key distinction is how we retrieve. Traditional RAG for code uses vector embeddings and similarity search. We use filesystem traversal and AST parsing - following imports, tracing dependencies, reading files in logical order. It's retrieval guided by code structure rather than semantic similarity. I highly recommend checking out what the Claude Cod…

Probably good to add a disclaimer at the top that clarifies the definition, since RAG is ultimately just a pattern, and vector indexes are just one way to implement the pattern. Indeed, industry at large sees RAG as equivalent to "vector indexes and cosine similarity w.r.t. input query", and the rest of the article explains thoroughly why that's not the right approach.

> industry at large sees RAG as equivalent to "vector indexes and cosine similarity w.r.t. input query"

Yep, and this is getting really old. Information retrieval is not a new problem domain. Somehow, when retrieved info is fed into an LLM, all nuance is lost and we end up with endless pronouncements about whether retrieval is/is not "dead".

Re: Why Cline doesn't index your codebase

#113
post #36
post #35

Earlier quoted context omitted.

Than it must be able to search every book and paper ever written because when it comes to deciding if an algorithm is correct I need to read the original paper that defined it and any updates in the literature since then. Since that rag system doesn't, and probably will never, exist we are stuck with vector embeddings as the common definition everyone working in the field uses and understands.

If you were to do this by hand, would you search every book and paper ever written? That is not feasible so you have to make a trade-off. For alternatives to vector search, see GraphRAG and AST parsing; e.g., https://vxrl.medium.com/enhancing-llm-code-generation-with-r... or https://github.com/sankalp1999/code_qa

That's what google scholar is for. Use it to find the meta analysis papers and go from there.

Which incidentally shows why RAG just means vector store + embedding model, since your definition means different things to different people and an implementation can't exist until we figure out AGI.

Re: Why Cline doesn't index your codebase

#114

What about doing something just-in-time? I'm just speculating, but what if cline leverages the LSP (for instance, rust-analyzer) to track the function chain and build a tree-like context of the codebase—not the entire codebase, but just specific blobs of code? Would that work?

LSP generally uses an AST representation of the code under the hood. And an AST representation is generally larger - often much larger - than the original code. So I'm not sure what the benefits of this would be compared to just loading the actual code into the context.

Re: Why Cline doesn't index your codebase

#115

This is still retrieval and RAG, just not vector search and indexing. it’s incredibly important to be clear about terms - and this article does not meet the mark.

Fair point Jeff -- you're right that we're still doing retrieval. The key distinction is how we retrieve. Traditional RAG for code uses vector embeddings and similarity search. We use filesystem traversal and AST parsing - following imports, tracing dependencies, reading files in logical order. It's retrieval guided by code structure rather than semantic similarity. I highly recommend checking out what the Claude Cod…

btw that podcast was recorded in jeff's office :)

Re: Why Cline doesn't index your codebase

#116
Isn't this what is called CAG (context augmented generation) these days? 1. Although I think RAG for code is nonsense, CAG seems to be very expensive even with cachig - imagine a huge code base. There should be a more efficient option. 2. How about indexing documentation - RAG should be okay there?

Re: Why Cline doesn't index your codebase

#117
post #37

Cursor does it. Cline doesn't. Aider goes the middle way with repo maps. Let's see what works best.

When I'm in the middle of a conversation with AI, sometimes I like to change the code immediately ("Oh that's wrong, let me fix that first"). Does it mess the context? Or I need to close/Ctrl+C and reopen?

As far as I know, Aider uses the latest content of the file, each time you ask something.

Btw. You can also trigger Aider via comments. This way you can mix it with your changes immediately.

https://aider.chat/docs/usage/watch.html#ai-comments

Re: Why Cline doesn't index your codebase

#118

This is still retrieval and RAG, just not vector search and indexing. it’s incredibly important to be clear about terms - and this article does not meet the mark.

Fair point Jeff -- you're right that we're still doing retrieval. The key distinction is how we retrieve. Traditional RAG for code uses vector embeddings and similarity search. We use filesystem traversal and AST parsing - following imports, tracing dependencies, reading files in logical order. It's retrieval guided by code structure rather than semantic similarity. I highly recommend checking out what the Claude Cod…

Following dependencies is the way to go IMHO. Saying "Code Doesn't Think in Chunks", is IMHO not correct. Developers do thing in chunks of codes. E.g. this function calls that function uses that type and is used here and there. It is not really a file based model like Cline uses. The file based model is "just" simpler to implement :-) . We use a more sophisticated code chunking approach in https://help.sap.com/docs/build_code/d0d8f5bfc3d640478854e6f... Let's see, maybe we should open source that ...

Re: Why Cline doesn't index your codebase

#119
post #15

"We Don't Dynamically Index Your Codebase So We Recan It with Every Query". Wasting time and tokens like this is not something to brag about. If indexing is so hard maybe someone should start a company just to do that, like https://news.ycombinator.com/item?id=44097699

They are saving time and tokens. They are rescanning the files locally using parsing and AST without sending tokens to the model which

How does scanning the files with every request save time? The whole point of an index is to make queries faster.

Re: Why Cline doesn't index your codebase

#120

I've been wondering when someone would finally use the actual code structure to do RAG. It seems like such an obvious, if somewhat harder (at least if you need to support many languages), approach. The vector/keyword based RAG results I've seen so far for large code bases (my experience is Cody) has been quite bad. For a smaller projects (using Cursor) it seems to work quite well though.

The most funny thing is how synchronicity worked its magic:

Roo Code experimental code indexing using vector DB dropped 3 days ago. Theire using Tree-sitter (the same as Aider) to parse sources into ASTs and do vector embedding on that product, instead of plaintext.

https://news.ycombinator.com/item?id=44117455

Post reply on HN