logoalt Hacker News

ryuuseijintoday at 2:13 AM2 repliesview on HN

Here is another technique to save tokens: allow the model to read a skeleton of the source code before reading the code, to give it an index into the code so it can read targeted chunks.

There is a tool that uses ripgrep and treesitter that does this [1], adapted from the maki coding agent.

[1]: https://github.com/ninjaxtools/treesitter-index


Replies

chr15mtoday at 2:26 AM

Aider pioneered this with the "repo map" which works tremendously well.

ZeWakatoday at 4:14 AM

Yep, there's also prewalk.