clean-pr-comments

clean-pr-comments is a command for Claude Code from bengous/claude-code-plugins. It costs 11 tokens per session (804 once invoked), scanned A, original, MIT.

A pull-request review command that checks whether code comments are needed or are covering up unclear names or structure.

In plain words
What is it for?
Use it to find comments that should lead to renaming or refactoring, and to preserve comments that explain facts the code cannot show.
Why use it?
It reduces comments that merely repeat the code while keeping notes about business rules, external problems, performance, or history.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Part of the code-quality plugin — 1 skill, 2 commands shipped together

Good fit Use it to find comments that should lead to renaming or refactoring, and to preserve comments that explain facts the code cannot show.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/bengous/claude-code-plugins/clean-pr-comments
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins

Made for: Claude Code.

Or install code-quality, the plugin that ships this one along with the rest of its 1 skill, 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clean-pr-comments

README.md
[![agentmods](https://agentmods.dev/badge/commands/bengous/claude-code-plugins/clean-pr-comments/github.svg)](https://agentmods.dev/commands/bengous/claude-code-plugins/clean-pr-comments)
Your own site
<a href="https://agentmods.dev/commands/bengous/claude-code-plugins/clean-pr-comments"><img src="https://agentmods.dev/badge/commands/bengous/claude-code-plugins/clean-pr-comments/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clean-pr-comments

Your own site · 80×15
<a href="https://agentmods.dev/commands/bengous/claude-code-plugins/clean-pr-comments"><img src="https://agentmods.dev/badge/commands/bengous/claude-code-plugins/clean-pr-comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00804
Opus 5.5 $0.00004 $0.00322
Sonnet 5.5 $0.00002 $0.00161
Haiku 4.5 $0.00001 $0.00080

Measured 24d ago against content hash afb30ae626bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

clean-pr-comments scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

code-quality/commands/clean-pr-comments.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean PR Comments

Review comments in a PR. Fix comments that compensate for bad naming. Preserve comments that provide context code cannot express.

Decision Framework

Comment compensates for... Action
Bad variable/function name Rename, remove comment
Missing abstraction Extract to well-named function, remove comment
External knowledge Keep
Inherent complexity Keep

Remove After Refactoring

Comments that explain WHAT code does—these are naming problems:

  • int d; // days elapsed → rename to elapsedDays
  • // check if user can access premium before condition → extract to canAccessPremium()
  • setTimeout(fn, 86400000); // 24 hours → const ONE_DAY_MS = 86400000

Keep

Comments that explain what code CANNOT express:

  • Business rules: // FCC requires 30-day retention minimum
  • External quirks: // Safari bug, see webkit#12345
  • Performance: // Intentionally avoiding map() - 10x faster here
  • History: // Tried recursion but hit stack limits
  • Spec constants: // 0x1F frame delimiter per RFC 7230
  • Warnings: // Order matters - auth before session init
  • License headers and public API docs

Remove Immediately

  • Commented-out code (use git history)
  • Restates code literally: i++ // increment i
  • TODOs that should be tickets

Workflow

  1. Identify scope from $ARGUMENTS:

    • A PR reference: gh pr checkout <ref>, then gh pr diff <ref> --name-only. The checkout switches the user's branch and fails on a dirty tree: say so before running it.
    • Empty: the current branch, git diff --stat origin/main...HEAD
  2. Select strategy based on PR size:

    • Default: Process the files yourself
    • Too large to read in one context: Spawn parallel agents (see Scaling below)
  3. Read each file, identify all comments

  4. Present findings before editing:

    src/auth.js:
      L45: "// convert to uppercase" → REMOVE (obvious from code)
      L67: "// api timeout" → REFACTOR: rename `t` to `apiTimeoutMs`
      L89: "// Safari workaround #234" → KEEP (external quirk)
    

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 24d ago Changed · -1 lines afb30ae626bd
  2. 1mo ago Changed · -3 lines 499ae911c457
  3. 1mo ago First seen · 108 lines · 11 tokens per session scan A 9c15b97dd043

Subscribe to this mod's changes

clean-pr-comments is a command published in the GitHub repository bengous/claude-code-plugins (5 stars, last pushed today), licensed MIT. It adds 11 tokens to every session and 804 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.