comment-cleanup

comment-cleanup is a skill for Claude Code, Codex from OpenHands/extensions. It costs 114 tokens per session (1,621 once invoked), scanned A, original, MIT.

A code-maintenance skill that removes comments which merely repeat nearby code or describe old history. It leaves comments that explain facts a reader still needs and changes comments without changing program behaviour.

In plain words
What is it for?
Use it to clean comments in source files and README files, including redundant comments, verbose comments, and comments about removed functionality.
Why use it?
It reduces distracting or outdated prose while avoiding changes to how the code runs. The result is limited to a comment-only change.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to clean comments in source files and README files, including redundant comments, verbose comments, and comments about removed functionality.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openhands/extensions/comment-cleanup
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.

Any agent
npx skills add OpenHands/extensions --skill comment-cleanup
Clone the repo
git clone --depth 1 https://github.com/OpenHands/extensions

Made for: Claude Code, Codex.

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-cleanup

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/openhands/extensions/comment-cleanup"><img src="https://agentmods.dev/badge/skills/openhands/extensions/comment-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,621 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.00114 $0.01621
Opus 5.5 $0.00046 $0.00648
Sonnet 5.5 $0.00023 $0.00324
Haiku 4.5 $0.00011 $0.00162

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

Security

Grade A, and why

comment-cleanup 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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/comment_syntax.py, scripts/verify_comment_only.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/comment-cleanup/SKILL.md · 134 lines

How it starts

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

Comment Cleanup

Remove low-value prose from source files and READMEs without changing behaviour. Three patterns are in scope; everything else is left alone. The output is a comment-only diff.

The three patterns

Apply one test to every comment: does it tell a reader something they cannot get from the code within a few lines of it? If yes, keep it (shortened if needed). If no, delete it.

Pattern 1 - Comment restates the adjacent code

The content is inferable from the few lines above and below. Delete it.

# Get the content text from the message
content_text = message.get_content_text()

Typical signs: the comment paraphrases the function name, the variable name, or the branch condition; it announces the next line ("# Loop over users", "// Return result"); it labels a block whose first line already says the same thing.

Pattern 2 - Comment narrates history or removed functionality

The comment explains a past state, a change, or a PR. That belongs in the PR description or version control. Delete the history; keep any present-tense fact a reader still needs.

# Prior to merging PR-1234 we stored rectangle coordinates as min_x, min_y, max_x, max_y
# and you could simply reference rectangle.max_y. Now we store x, y, width, and height
# and calculate the max_y on the fly.
area = rectangle.get_max_y()

Here nothing survives: get_max_y() already says it is computed. If the comment had carried a live constraint (for example "max_y is derived, so do not cache it across resizes"), keep only that sentence.

Typical signs: "previously", "used to", "no longer", "now we", "after PR-...", "changed from", "was renamed", "legacy behaviour was", dates, author names.

Pattern 3 - Comment is verbose

The comment carries a real reason but is padded with narrative, anecdotes, repetition, or detail the reader does not need. Compress it to the shortest wording that keeps the reason.

# Back when I was in elementary school, the first shape I ever remember seeing was
# red triangle. ... Here, we generalize our shape using the douglas peucker algorithm
generalized = polygon.generalize(1.0)

Read the full file on GitHub · 134 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 134 lines · 114 tokens per session scan A 251475f16026

Subscribe to this mod's changes

comment-cleanup is a skill published in the GitHub repository OpenHands/extensions (190 stars, last pushed today), licensed MIT. It adds 114 tokens to every session and 1,621 once invoked, about $0.0005 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-10-29.

Related

comment-cleanup compared with skills from other repositories

comment-cleanup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
comment-cleanupOpenHands/extensionsSkill190todayMITA114Claude Code, Codex
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.2ktodayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k9d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k2d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill9742d agoMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5ktodayMITA51Claude Code, Codex