trim-comments

trim-comments is a skill for Claude Code from cboone/agent-harness-plugins. It costs 53 tokens per session (7,556 once invoked), scanned A, original, MIT.

A code-comment editor that shortens comments in selected files or changed code. It keeps the code's purpose and the smallest necessary reason.

In plain words
What is it for?
Use it to trim comments, rewrite jargon-heavy explanations, preview changes, and optionally leave edits uncommitted.
Why use it?
Long or unclear comments become another maintenance burden and can repeat what the code already shows.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: runs codex exec; mentions Codex.

Part of the trim-comments plugin — 1 skill shipped together

Good fit Use it to trim comments, rewrite jargon-heavy explanations, preview changes, and optionally leave edits uncommitted.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cboone/agent-harness-plugins/trim-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.

Any agent
npx skills add cboone/agent-harness-plugins --skill trim-comments
Clone the repo
git clone --depth 1 https://github.com/cboone/agent-harness-plugins

Made for: Claude Code.

Or install trim-comments, the plugin that ships this one along with the rest of its 1 skill.

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 trim-comments

README.md
[![agentmods](https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/trim-comments/github.svg)](https://agentmods.dev/skills/cboone/agent-harness-plugins/trim-comments)
Your own site
<a href="https://agentmods.dev/skills/cboone/agent-harness-plugins/trim-comments"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/trim-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 trim-comments

Your own site · 80×15
<a href="https://agentmods.dev/skills/cboone/agent-harness-plugins/trim-comments"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/trim-comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,556 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.00053 $0.07556
Opus 5.5 $0.00021 $0.03022
Sonnet 5.5 $0.00011 $0.01511
Haiku 4.5 $0.00005 $0.00756

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

Security

Grade A, and why

trim-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 2d 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/trim-comments/skills/trim-comments/SKILL.md · 370 lines

How it starts

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

Trim Comments

Rewrite the comments in scope to be as short as possible while still earning their place. The rules apply to comments in any language.

Options

The user may provide these options inline:

  • paths: A path, glob, or file list. Every comment in those files is in scope, changed or not. Without paths, the scope is the comments in or directly above code the current branch changed: committed changes since the base branch, plus staged, unstaged, and untracked files. When the user points at a single comment, that comment is the whole scope.
  • --dry-run: Report proposed changes without editing or committing.
  • --no-commit: Edit and verify, but leave the edits uncommitted. By default the skill commits its edits, and it never pushes.
  • --no-codex: Classify the comments in this session rather than through a Codex dry run; see "Proposals through Codex".

The standard

Lead with what the code is doing. Then the minimum why. Nothing else.

"What" means the effect or purpose a reader cannot get from the next few lines at a glance, not a paraphrase of the statements. A comment whose whole job is a constraint (see "Keep these") leads with the constraint instead.

One line is the default. Two lines when the why genuinely needs a clause. Three or more needs a reason you could defend out loud.

// Bad: why first, action buried, trivia at the end
// multipart/form-data is the documented encoding for this endpoint, and the shape attachments would
// need. Node 22 ships a global FormData.

// Good
// FormData because multipart/form-data is the documented encoding for this endpoint.

Write comments that stay true

A stale comment is worse than none: the reader trusts it, and nothing fails when it drifts. Prefer the wording that will stay true longest, and let that decide between otherwise equal rewrites.

  • Anchor the comment to the code beside it, not to code elsewhere. Nearby code changes in the same diff as the comment, so a reviewer sees both. Code elsewhere changes without anyone rereading the comment.
  • Never cite line numbers. Any edit above them shifts them. Name a function, type, constant, or file instead, so a rename makes the reference visibly wrong rather than quietly off by a few lines.
  • Leave out facts that change on their own schedule: counts of callers or cases, version numbers, dates, "currently", "for now", "new", and lists of the places that use something. The exception is a fact that explains why the code looks the way it does (see "Keep these").
  • Prefer a lasting reason to a passing one. "The API rejects more than 3 tags" outlives "the API rejected 4 tags in last week's outage".

Read the full file on GitHub · 370 lines

Files

What ships with it

1 file 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. 2d ago Changed · +21 lines 86cebb5e9d1b
  2. 8d ago First seen · 349 lines · 53 tokens per session scan A 76e5ef1eb362

Subscribe to this mod's changes

trim-comments is a skill published in the GitHub repository cboone/agent-harness-plugins (2 stars, last pushed today), licensed MIT. It adds 53 tokens to every session and 7,556 once invoked, about $0.0002 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-08.

Related

Other skills, from other repositories