Yeah we all converge to the same workflow, in my ai coding agent I'm working on now, I've added an "index" tool that uses tree-sitter to compress and show the AI a skeleton of a code file.
Here's the implementation for the interested: https://github.com/tontinton/maki/blob/main/maki-code-index%...