Ahh! Author here. Thanks for posting! In case anyone wants to share in my frustration, I also wrote a blog post about this.
Blog post: https://zachahn.com/posts/1787191554
The prompt I use to tell the LLM what to fix: https://github.com/zachahn/vomit/blob/main/internal/config/s...
Wasn't received too well on Lobsters haha, wrote a small extra blurb about it there: https://lobste.rs/s/juekuk/how_fix_claude_5_s_token_vomit