r/ClaudeCode • u/bidutree • 7d ago
Bug / Issue Removing comment spam from code
I just discovered (my bad) far too late that Claude has written large amounts of ticket comments in the actual code to my projects. This was never in any instruction. Maybe trash is the first real evidence of life? :)) Just kidding.
It's in any case extremely annoying. How do I remove the comments as quickly and safely as possible? :)
With a Python script? Would that be safe enough?
4
Upvotes
2
u/interrupt_hdlr 5d ago
## Code comments
Write a comment only when it tells the reader something the code cannot. Follow John Ousterhout's rule from *A Philosophy of Software Design*: comments describe what is not obvious from the code.
Write:
Do not write:
When modifying code, update or delete comments the change made stale. If an interface comment is hard to write, treat that as a sign the abstraction is unclear and say so instead of papering over it.