Skip to content

docs(claude): add the deletion test for code comments#384

Open
etrobert-bot wants to merge 1 commit into
mainfrom
docs/comment-deletion-test
Open

docs(claude): add the deletion test for code comments#384
etrobert-bot wants to merge 1 commit into
mainfrom
docs/comment-deletion-test

Conversation

@etrobert-bot

Copy link
Copy Markdown
Collaborator

What

Sharpen the existing comment-proportionality rule in the global CLAUDE.md with an applyable test:

Apply the deletion test: if a comment only restates what the code, filename, or option names already convey, cut it. Don't describe how or where code is wired up (e.g. which hosts import a module) — that's greppable, goes stale, and belongs in the PR.

Why

The existing rule ("keep comments proportional… state only the single non-obvious point… leave narrative for the commit/PR") is framed around length and its narrative examples are historical (root-cause chains, incident history). That let two other failure modes slip through in a recent module:

  • a comment that just restated the code / filename ("opt-in gaming support: the Steam client"), and
  • one that narrated the module's wiring ("imported per-host — currently only tower"), which is greppable and rots the moment a second host adopts it.

The deletion test turns "is this non-obvious?" from a judgment call into a procedure, and the e.g. keeps the one example illustrative rather than an exhaustive list to rules-lawyer against.

Scope: global CLAUDE.md only — general comment hygiene, not a repo-specific convention, so it isn't duplicated into the project file.

🤖 Generated with Claude Code

Sharpen the comment-proportionality rule with an applyable test: cut a
comment if it only restates what the code, filename, or option names already
convey, and don't narrate where or how code is wired up (that's greppable,
rots, and belongs in the PR). The existing rule was framed around length and
historical narrative, which let restate-the-code and describe-the-wiring
comments slip through.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@etrobert-bot etrobert-bot force-pushed the docs/comment-deletion-test branch from ef6620a to 3654ce5 Compare July 1, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant