5 ms·
I've been whittling my way towards having Claude write zero comments in code. They're pretty much never helpful.
by post-it 22d ago
I've been whittling my way towards having Claude write zero comments in code. They're pretty much never helpful.
- sdeframond 22d agoHow do you do it?
- ch4s3 22d agoYou could probably add linting rules to your tool of choice and tell claude that your lint tool has to pass.
- demibabs 22d agobut then no human generated comments allowed either, right?
- ch4s3 22d agoI'd do this by only running the linter locally and using this as a custom rule for the LLM, but I need to think about it a bit harder.
- devmor 22d agoThere is probably something you can do to only apply some rules to the actual changed lines in a git diff. You may have to write your own linter for that specifically.
- notsirius 22d agoyou'd probs want a commit hook for that
- unleaded 22d agoDoes "don't write comments" not work?
- jaggederest 22d agoabout as effective as don't make mistakes... For anthropic's models at least
- devmor 21d agoIt’ll work sometimes. You’re using a non-deterministic algorithm to generate output. If you want deterministic rules applied to it, you have to use deterministic systems to do it.
- oblio 21d agoMost lint tools allow exceptions if you add a special marker. I think even allow custom user exceptions. E999: human generated comment :-)
- nottorp 21d agoI just delete them most of the time. But I keep my LLMs on a short leash. No 40000 line PRs.
- justbees 21d agoI include a rule in the initial PR prep that it runs. So there's a hard limit to the length of the comments and what type of comments it can write and they get flagged in the review. It also reads the comments and checks for consistency with the following code so they don't drift. And the reviewer is a completely different agent/different model. So all of that happens before the manual review and usually catches a lot of the 3-5 line comments it inevitably adds.