Hacker News new | ask | show | jobs
by rirze 105 days ago
Claude is creating verbose comments with recent models and people are are tired of it
2 comments

Those verbose comments provide context for why something is there way it is, so it can take those decisions in account when making changes in the future.
> why something is there way it is

It writes out stories describing what isn't there or what used to be there. It's usually not helpful, just noise. It also likes to write it in very verbose AI-styled prose.

"don't write a goddamn novel" <- I've said this to claude way too many times, nothing you can do actually seems to make it significantly less verbose
And the way they are written is rather unhelpful: '//this not cosmetic: this css helps the user understand where he should click'. The 'this is not' pattern is useless at best.
It's likely not helpful to you, but it is to Claude. Basically a memory entry at the exact point of relevance, with the same caveats. One advantage though is it survives cloning, so another using the project benefits.
It's only helpful to Claude in that it wastes more tokens and costs more.
It does visibly use a few more tokens in the short term. But it hurts Claude's ability in the long term if removed because it has to either think more every time it encounters that section in the code (more invisible thinking tokens used), or there's an increased risk of making a maladaptive change without context. Heck I've been bitten enough times already by it, though more recently it's cross project concern where Claude rediscovers some root cause that was already found and documented (I have it save a centrally-located writeup for things that took serious work to learn, when I remember, but I still need to make that knowledge pool known to other agents/sessions without having to manually prompt each time) elsewhere.

Problem is today's LLMs don't have the long term memory that humans have, and so remembering the reason behind a given change/decision has to be preserved in some way if it's non-obvious. Hence why there is {AGENTS|CLAUDE}.md, the auto-memory system, and 1001 variants of memory implementations in the wild. All are trying to ensure that LLMs can have the context they need at the location and time they need it. And you want to block Claude from using a technique that it natively finds helpful.

No it doesn’t. The comments are hugely verbose trash that immediately becomes outdated and brittle and confusing for humans and Claude alike.
What you need is RAG and better context management. I use vornik (it has plugins for both codex and Claude) that gives both the long term memory you mention. Hope this helps.
It's often is not helpful to claude either because it just confuses it more most of the time.
Confusion usually surfaces immediately, so it can be steered properly. Being sure of a decision that turns out to be wrong usually means a bug that could bite when you least expect it.
No it doesn’t. The comments end up complicating simple tasks, and if you open the repo after a week it takes a while to find out why Claude is reading irrelevant files or replying about irrelevant things
If they have in mind what I think of when I think of claude comments then frequently they are only relevant to the back and forth that produced the code and are exaggerated to the point of being misleading. A very common example is to land on something that isn't quite right or doesn't quite work, prompt an adjustment, and then the adjustment will have some grandiose prose about "preventing the critical bug that shipped once." People just need to clean up such litter manually but it would be nice if the models generated less of it.
The story of how the code got to a certain state belongs primarily in git commit messages, not in comments. Comments should serve to aid in understanding of the code, highlight footguns or hidden dependencies, etc.

Claude very often litters code with comments about decisions that were made within a single session/pull request, its just noise.

Those massive comments generally refer to intermediate states that never shipped, making them utterly useless, noisy and confusing as a permanent artifact. They're sometimes useful to reviewers, so a commit message or pull request comment is much more appropriate.
Yes I hate when Claude explain in comments how it is now compared to how it was before, or how it could be if a different decision had been taken.

Dude, just talk about the current state of the code!

> useless, noisy and confusing

That's your perspective. For Claude that's an extension of its thinking, which makes it work better. Just like the person who takes notes so they have references for later. Take it away and you're negatively impacting outcomes.

No, it's the other way around. If you put a comment "don't do foo" in your code, you're biasing future readers, human or artificial, to think about foo when you explicitly want them not to.
It isn't about making readers not think about foo. It's about biasing thought about foo in a particular direction. And I've seen it work multiple times: agent mentions it encountered X comments in the code and revised its action as a result (yes, I read live agent transcripts).
If one needs to dig history, then git log -p and similar are way more useful and reflect the real history rather than LLM inference about it. Comments reflecting the goal are more useful as neither history nor code itself covers it.
Looking into git history is an active decision that's usually only done after something undesirable happens, and now there's the need to try and find why. Better to have the context passively loaded as part of working with the relevant section of the code, and likely prevent that something from even happening in the first place. Think Chesterton Fence.
The new concise output style they just released definitely helps with Opus 5 in general.