How to tell the model not write unnecessary comments

The model will always change the function name and comments for a certain change, and supplement the content of the change on the original basis.

For example, I have a Button

// drawButton
Button() {
...
}

Now, I ask the Claude-4-sonnet to add an animation to it.
The model will rename this Button() to ButtonWithAnimation() and add a comment.

// drawButton (added Scale Animation)
ButtonWithAnimation() {
...
}

Except for the actual added animation function, the change of function name and comment has no meaning. However, it seems to be very enthusiastic about such changes.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1.3 (Universal)
VSCode Version: 1.96.2
Commit: 979ba33804ac150108481c14e0b5cb970bda3260
Date: 2025-06-15T06:37:17.379Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Go to Settings -> Rules -> Add Rule, & type something along the lines of:

Do not write comments in the code to note that changes were made, nor should you write excessively long & verbose comments, or overly frequent comments; you should author your comments targeted at someone who is an advanced author of TypeScript, React, & Swift.

Then I would make it a separate similar rule to prefer less descriptive variable names, probably.

A good phrase I find is “avoid empty defensive programming, error handling, and commenting unless it is necessary for an AI to pick up on later. it is ok to let the application break”. Because they all have differing tendencies, real or simulatory, they do this to a varying degree. It is a bias of LLM training data and the distribution of github projects and how many projects in what source, framework, language, and how far from training cutoff we are. Google 2.5 should be avoided like the plague. It comments you into hell, and these sometimes cause semantical horrors later int he project when you ask for something and the agent sees the comment from ages ago. i try to do clean up often, but it is costly. even with rules, and constant refactors, its a grab bag if this new clean architecture is sustainable for a dev environment, or some frankenstein or a production application. it happens at about the 50% mark i find, o4 mini does ok if youre very specific, but it often hits tool call maxes. it makes for slow, but careful progress. use some of that time to make your questions less lazy. i dont say that rudely, i just call them that for myself when i drift.