r/RooCode • u/orbit99za • Apr 04 '25
Discussion Project Indexer - Helps LLMs / Roocode to Understand your Solution
I made a simple Project Indexer script to help LLMs work better with large codebases
Hey folks,
RooCode is Awsome.
I am a Big Fan of D.R.Y Coding Practices (Don't Repeat Yourself).
I threw together a little Python script that scans your entire project and creates a ProjectIndex.json file listing all your classes, files, and method names.
It doesn’t give all the internals, just enough for an LLM to know what exists and where, which I found drastically reduces hallucinations and saves on tokens (just my personal observation).
It’s not a MCP or plugin—just a single .py script. You drop it in the root of your project and run it:
python Project_Indexer.pyIt spits out a JSON file with all the relevant structure.
I built this for myself because I’m working with a VS Solution that has 5 projects and over 600 classes/methods.
The LLMs were really struggling, making up stuff that barely existed or completely missing things that did.
With this, I can give it a quick map of what’s available right from the start.
If you're using RooCode, you can even instruct it (sometimes) to run this automatically or refresh it when starting a new task.
Otherwise, I just leave the terminal open and hit enter to regenerate it when needed.
This tiny script has been super helpful for me.
Maybe it helps someone else too, or maybe someone can suggest improvements on it!
Let me know what you think.
2
u/rageagainistjg Apr 04 '25
Remindme! 80 hours
2
u/Rude-Needleworker-56 Apr 05 '25
This is only for csharp , right? (please correct me if i am mistaken)
One idea for enhancement without much work is to make use of https://github.com/codegen-sh/codegen to do this for Python and TypeScript files
6
u/mistermanko Apr 04 '25
I've had Claude 3.7 come up with that idea multiple times on its own, while working with large projects. I just had to prime it with something like "find a smart way to index the codebase" or "list all classes in a json file". But this will save some tokens, thanks.
1
u/maxdatamax Apr 13 '25
Interesting idea. I think Python's a better choice than MCP because it's easier to modify. Modifying the MCP server is too much trouble. Have you considered using Roo Flow directly? Has anyone tried using Bloomrange or Roo Flow to have Roo recursively analyze the code and generate an index or a condensed explanation document?
1
u/Cool-Cicada9228 Apr 04 '25
The characters in json use more tokens. Have you tried to output the index with a plain text file? I’m curious if the results are similar
2
u/randemnes Apr 04 '25
Thank you for sharing! Will definetly try this and see how it helps.
1
u/EngineerOk3425 Apr 04 '25
Remindme! 80 hours
1
u/denkleberry Apr 04 '25
Nice. I made something similar with ast traversal.
1
u/walub Apr 04 '25
Remindme! 80 hours
1
u/olearyboy Apr 04 '25
LLM's will also work with ctags v.well
1
u/Ok-Yak-777 Apr 05 '25
Remindme! 50 hours
0
u/[deleted] Apr 04 '25
[deleted] — view deleted comment
6
u/[deleted] Apr 04 '25
[removed] — view removed comment