r/ClaudeCoding • u/EntertainerOk4774 • 25m ago
Comments in codebase
Hi, I'd like to ask about your approach to allowing Claude to add comments to your code. In my codebase, information is now spread across multiple places: code comments, ADRs, lessons learned, and documentation. I'm considering asking Claude to remove comments from the code, as I believe code should be self-explanatory. However, could this negatively affect Claude's ability to properly understand the context?
1
Upvotes
1
u/CorpT 22m ago
lol no do not do that. Why do you care if there are comments there if they're accurate? Why make Claude work harder than it has to?
1
u/gouldopfl 4m ago
I can tell you from 4 decades of experience. Leave them there and enhance them even more. I can remember on several occasions going back into 10 year old code, in a language I hadn't used for years, my skill level was not as good and wondered what the hell was that.
0
u/cleverhoods 18m ago
Do not allow Claude to write comment like that in code. A 1-2 line of code documentation is fine as long as it’s about the code and code only.
All the rest goes in your progressive disclosure (whatever that might be, memory, custom loading logic, rules, claudemd or agentsmd files)
0
u/CounterAttack-Studio 9m ago
This instruction works pretty well for me:
Don't write comments; make the code clear enough not to need them. The one exception is a line whose purpose the code can't convey.If the context gets too polluted Claude will miss it sometimes but in general it always follows it.