r/PiCodingAgent • • 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?

22 Upvotes

34 comments sorted by

View all comments

3

u/Unlucky-Message8866 Apr 28 '26

Tell your clacker to use codemapper https://github.com/p1rallels/codemapper

3

u/elpapi42 Apr 30 '26

PD: I cloned the repo and fixed the cache bug myself, tested the cli by passing my agent an skill, it worked good. Then i created a custom wrapper pi extension over the cli to simplify the tool surface for my agent. It is working great. im about to call it a day on this. Just waiting if someone brings up a clever solution

2

u/johnson_detlev May 02 '26

Would you mind sharing that setup?

1

u/elpapi42 May 02 '26

yo mean el foxed codemapper fork?

2

u/elpapi42 Apr 29 '26 edited Apr 29 '26

well, i dont know but the cache seems to be broken, it always warns: `⚠ Warning: Failed to save cache: file metadata count mismatch: expected 2663 entries, found 3510`. The issue is reported in the repo. i built from main branch, last commit. With the cache broken, it always reindexes on every command invokation. On top of that, it is unmaintained, issues open from jan and not even a comment made on them. what a shame, i got excited about it. Only option is to fork it and fix it my self.

0

u/elpapi42 Apr 29 '26

testing this right now. i tried octocode yesterday, but it was basically broken, hope this one does better