lean-trim-comments

lean-trim-comments is a skill for Claude Code, Codex from tony/skills. It costs 38 tokens per session (2,502 once invoked), scanned A, original, MIT.

A code-maintenance tool that reviews comments and docstrings, which are notes written beside code, for unnecessary length, repetition, or unclear wording. It can rewrite or remove comments that do not meet the project's policy.

In plain words
What is it for?
Use it to audit tracked files, changed files, staged changes, or selected paths, then inspect the proposed diff or apply the approved edits.
Why use it?
It reduces clutter and keeps source comments focused on useful information instead of dense or repetitive text.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Good fit Use it to audit tracked files, changed files, staged changes, or selected paths, then inspect the proposed diff or apply the approved edits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tony/skills/lean-trim-comments
View source ↗ tony/skills
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 tony/skills --skill lean-trim-comments
Clone the repo
git clone --depth 1 https://github.com/tony/skills

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tony/skills/lean-trim-comments"><img src="https://agentmods.dev/badge/skills/tony/skills/lean-trim-comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,502 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.00038 $0.02502
Opus 5.5 $0.00015 $0.01001
Sonnet 5.5 $0.00008 $0.00500
Haiku 4.5 $0.00004 $0.00250

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

Security

Grade A, and why

lean-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.

The scan reads SKILL.md. This mod also ships 2 executable files (references/scope.py, references/tally.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.

.agents/skills/lean-trim-comments/SKILL.md · 237 lines

How it starts

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

this skill

Judge comments and docstrings against references/comment-policy.md, then delete or rewrite the ones that fail. By default only comments on lines the branch added or changed are judged; comments it never touched are left alone. Edits in place and prints a diff. Never commits or pushes.

The commands below run from the user's directory. Resolve references/scope.py and references/tally.py against the directory of this SKILL.md (the path it was read from) and write that absolute path literally in each command; shell variables do not persist between Bash calls. Never show that path in the reply.

When python3 is missing or older than 3.14, follow references/python.md.

Confirm before the first edit

This skill deletes code the user did not ask you to touch, and it can be routed to from a passing remark about comments. Present the classification and get an explicit yes through ask-user-choice before any Edit.

No exceptions: not for a single comment, not for a file the user just named, not under --all. --diff-only and --stdin edit nothing, so they need no confirmation.

Without a question tool, act as --diff-only unless the request itself says "go ahead and trim": that authorizes the edits it names, never a commit.

$ARGUMENTS

  • paths/globs: files to audit in full, resolved by scope.py --paths.
  • --stdin: code pasted in the message or read from stdin; print the trimmed code and edit nothing. Pasted code with no paths implies it.
  • --staged: judge comments on staged lines rather than the branch diff.
  • --all: audit every tracked file in full. Expect a large diff; say so before confirming.
  • --diff-only: classify and show what would change, edit nothing.

With no paths, the scope is the lines this branch added or changed.

Steps

  1. Resolve targets. With --stdin or pasted code, the pasted text is the target set; skip to step 2. With paths, resolve them; a path that matches no file exits 2: report it and stop:

Read the full file on GitHub · 237 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. 2d ago Changed · +2 lines 7827d434f9d1
  2. 1mo ago Changed · +25 lines de775fe293bc
  3. 1mo ago Changed · +98 lines 0628d671e5c6
  4. 3mo ago First seen · 112 lines · 38 tokens per session scan A 7dac533ba2e5

Subscribe to this mod's changes

lean-trim-comments is a skill published in the GitHub repository tony/skills (0 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 2,502 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-08-31.

Related

lean-trim-comments compared with skills from other repositories

lean-trim-comments next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lean-trim-commentstony/skillsSkill0todayMITA38Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code