I recently stumbled upon the technique of asking the LLM to create a Dot Viz (or mermaid) flowchart of the program flow.
The LLMs are great at:
- understanding the flow
- making diagrams
- running the code with logging they add to to even better understand the flow
The flow being in Dot (or other machine readable format) makes it even easier for the LLM to use that as a reference going forward.