The problem with your suggested approach is the resulting lack of holistic context. The problem of OP's approach (direct parsing) is cost and context-window-limits. There has to be a better way.
Using the "give it everything" method will cause it to forget most of what you're feeding it if you have a large repo anyway, right?