Is this in one of the skills or CLAUDE.md? This was happening in our codebase, but turned out it was interpreting an instruction to not add "what" comments as license to strip out comments.
Sometimes I have luck interrogating Claude on why it did something. It'll either point to a skill or agent file with the culprit, or it'll respond with some vapid nonsense and apologize.
I've definitely seen this. One of my least favorite parts of developing with AI is when I add print statements or small changes and the LLM removes them in the process of doing the next thing. I want to work _with_ the AI, not have it stomp all over my code.
When i first added "do not write comments" to my Claude.md, it started deleting all comments it came across. I yelled at it a bunch, eventually it got its md files aligned to where it's very clear: Claude does not write comments. Claude does not edit comments. Claude does not delete comments. Claude does not move comments. Only humans touch comments.
It's been working well for me for months now. If only I could convince the team to do it too
It might be touching one line of actual code in a file, and take advantage of it to remove 20+ lines of actual useful comments.
Everybody is talking about the opposite, so I'm wondering if this is rare.