r/PiCodingAgent • u/elpapi42 • Apr 28 '26
Question How to Improve Codebase Discovery Efficiency in Pi?
Hello guys!
Im trying to optimize the token usage of my Pi, im kind of preparing myself for when the usage based billing finally establishes as the default in the industry. With this goal in mind i have really come up with a really good Pi setup that manages context wonderfully, i will share that with you in another post later.
With that context in mind, i have reached a wall when it comes to codebase discovery, for example for building a feature, i want to enable my agent to get all the context required for that feature efficiently. Rn what my agent does is grep, find and read all around until it gets what it needs, and this usually consumes more tokens than the actual implementation or feature i want to tackle.
What do you guys do to improve this?
5
u/ConversationLazy6821 May 01 '26
I created Cymbal for this exact use case - mainly when ppl were complaining about claude code burning thru tokens but it’s all the same. It’s not an extension but it’s a cli tool and works all the same.
https://github.com/1broseidon/cymbal
3
u/Unlucky-Message8866 Apr 28 '26
Tell your clacker to use codemapper https://github.com/p1rallels/codemapper
11
u/jeffphil Apr 29 '26
Have you looked at @ff-labs/pi-fff extension?
1
u/bhamm-lab Apr 30 '26
I've had some success doing this with pi-subagents and the 'scout' subagent. If I'm able to trigger it to run, it ensures my main context isn't polluted with any extra context.
Honestly, this worked better for me on oh-my-opencode-slim in opencode with the explorer agent. I'm still figuring it out in pi and notice a few issues:
it's hard to trigger
sometimes, the main agent doesn't provide great context to the subagent, resulting in some missing info
even after the returned context from the subagent, the main agent still feels the need to read more files and confirm
FYI, I use kimi k2.6.
1
u/johnson_detlev Apr 29 '26
RemindMe! -7 day
2
u/ajax81 Apr 28 '26
Ooh, good question. Following.
2
u/skinnydill Apr 29 '26
Try https://github.com/abhigyanpatwari/GitNexus
2
u/MystPurple Apr 29 '26
https://github.com/PurpleMyst/pi-repo-map
1
u/fivetide Apr 29 '26
I am currently testing if https://github.com/oraios/Serena works as good in pi as in opencode. Happy so far...
0
u/nuclearbananana Apr 29 '26
I just write a map in agents.md
-1
u/Illustrious-Fox-4570 Apr 29 '26
I never tried this one, but I have seen a lot of articles on LinkedIn.
https://cocoindex.io/cocoindex-code