This happens with everything LLMs write - code comments, readmes, user facing UI text, etc. It just can't help but include every irrelevant detail from the context.
It's definitely gotten worse over time as well. Looking at older README files I generated using Opus/Sonnet 4.5, its actually quite shocking how clear and concise they are. Whereas eg, Opus 5 will write paragraphs and paragraphs about random things I prompted, or a partial solution that was then scrapped for something else.
My theory is that the increasing strength in performing long-context tasks has led to this particular quirk.
I have in my Claude.md that comments must be diegetic, if needed at all. This seems to have helped. And it is then something which gets checked by agents in code review.
It's definitely gotten worse over time as well. Looking at older README files I generated using Opus/Sonnet 4.5, its actually quite shocking how clear and concise they are. Whereas eg, Opus 5 will write paragraphs and paragraphs about random things I prompted, or a partial solution that was then scrapped for something else.
My theory is that the increasing strength in performing long-context tasks has led to this particular quirk.