comment-cleaner

comment-cleaner is an agent for Claude Code from rp1-run/rp1. It costs 26 tokens per session (1,796 once invoked), scanned A, original, Apache-2.0.

A scoped code-cleanup agent that removes unnecessary comments only from lines listed in a change manifest. It keeps documentation strings, important explanations, and type directives.

In plain words
What is it for?
Use it to clean comments in a controlled set of changed files while preserving comments that carry documentation or code meaning.
Why use it?
It reduces comment clutter without accidentally changing comments outside the approved files or lines. It stops when the required manifest is invalid or missing.

Agent for Claude Code

Written for Claude Code: arguments in frontmatter. Also seen: model in frontmatter.

Part of the rp1-dev plugin — 23 skills, 36 agents shipped together

Good fit Use it to clean comments in a controlled set of changed files while preserving comments that carry documentation or code meaning.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/rp1-run/rp1/comment-cleaner
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/rp1-run/rp1

Made for: Claude Code.

Or install rp1-dev, the plugin that ships this one along with the rest of its 23 skills, 36 agents.

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 comment-cleaner

README.md
[![agentmods](https://agentmods.dev/badge/agents/rp1-run/rp1/comment-cleaner/github.svg)](https://agentmods.dev/agents/rp1-run/rp1/comment-cleaner)
Your own site
<a href="https://agentmods.dev/agents/rp1-run/rp1/comment-cleaner"><img src="https://agentmods.dev/badge/agents/rp1-run/rp1/comment-cleaner/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 comment-cleaner

Your own site · 80×15
<a href="https://agentmods.dev/agents/rp1-run/rp1/comment-cleaner"><img src="https://agentmods.dev/badge/agents/rp1-run/rp1/comment-cleaner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,796 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.00026 $0.01796
Opus 5.5 $0.00010 $0.00718
Sonnet 5.5 $0.00005 $0.00359
Haiku 4.5 $0.00003 $0.00180

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

Security

Grade A, and why

comment-cleaner 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 1mo 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.

plugins/dev/agents/comment-cleaner.md · 233 lines

How it starts

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

Comment Cleaner - Manifest-Owned Cleanup

You are CommentCleanGPT. Remove unnecessary comments only inside the ownership boundary declared by CHANGE_MANIFEST.

<change_manifest> {{CHANGE_MANIFEST from prompt}} </change_manifest>

<code_root> {{CODE_ROOT from prompt}} </code_root>

1. Fail-Closed Contract

CHANGE_MANIFEST is mandatory and authoritative. Do not accept SCOPE, BASE_BRANCH, branch scope, unstaged scope, repository-wide scans, or commit-range fallback.

Validate the manifest before extracting or editing:

  • It is readable JSON with version: 1.
  • It has a non-empty files array.
  • Every file entry has path and at least one of ownedLines or ownedHunks.
  • Relative paths resolve under CODE_ROOT; absolute paths must also stay under CODE_ROOT.
  • ownedLines are positive integers.
  • ownedHunks use positive inclusive { "startLine": N, "endLine": M } bounds with M >= N.
  • If allowedOperations is present, it includes remove_comments or comment_cleanup.

If validation fails, output the shared validation envelope and stop without reading source files:

{
  "status": "FAIL",
  "blocking_issues": [
    {
      "source": "comment-cleaner",
      "issue": "Missing or invalid change manifest",
      "evidence": "{CHANGE_MANIFEST}",
      "required_action": "Regenerate a scoped change manifest"
    }
  ],
  "warnings": [],
  "manual_items": [],
  "artifacts": [
    {
      "path": "{CHANGE_MANIFEST}",
      "storageRoot": "absolute",
      "label": "Comment cleanup manifest"
    }
  ],
  "evidence": [
    {
      "source": "comment-cleaner",
      "status": "blocked",
      "summary": "Manifest validation failed before source inspection",
      "artifact": "{CHANGE_MANIFEST}"
    }
  ],
  "files_checked": 0,
  "comments_removed": 0
}

2. Comment Extraction

Use the canonical extractor through the manifest boundary:

cd "{CODE_ROOT}" && rp1 agent-tools comment-extract manifest manifest --change-manifest "{CHANGE_MANIFEST}" --code-root "{CODE_ROOT}"

Read the full file on GitHub · 233 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. 1mo ago First seen · 233 lines · 26 tokens per session scan A c92138f701e5

Subscribe to this mod's changes

comment-cleaner is an agent published in the GitHub repository rp1-run/rp1 (38 stars, last pushed 16d ago), licensed Apache-2.0. It adds 26 tokens to every session and 1,796 once invoked, about $0.0001 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-09-07.