simow wrote a tool that does this for Claude code
https://simonw.substack.com/p/a-new-way-to-extract-detailed-...