prune-comments

prune-comments is a skill for Claude Code, Codex from natsukium/dotfiles. It costs 88 tokens per session (1,264 once invoked), scanned A, original, CC0-1.0.

Guidance for removing code comments that merely repeat what the code already says. It keeps comments that explain non-obvious reasons, rules, or constraints.

In plain words
What is it for?
It helps clean up excessive, stale, or unhelpful comments in existing code and during new implementation work.
Why use it?
Too many comments make important explanations harder to notice and can become inaccurate as code changes. Pruning reduces that noise while preserving information the code cannot show by itself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Good fit It helps clean up excessive, stale, or unhelpful comments in existing code and during new implementation work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/natsukium/dotfiles/prune-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 natsukium/dotfiles --skill prune-comments
Clone the repo
git clone --depth 1 https://github.com/natsukium/dotfiles

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/natsukium/dotfiles/prune-comments"><img src="https://agentmods.dev/badge/skills/natsukium/dotfiles/prune-comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,264 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00088 $0.01264
Opus 5.5 $0.00035 $0.00506
Sonnet 5.5 $0.00018 $0.00253
Haiku 4.5 $0.00009 $0.00126

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

Security

Grade A, and why

prune-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 3mo 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.

modules/features/coding-agents/common/skills/prune-comments/SKILL.md · 111 lines

How it starts

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

Pruning Code Comments

Over-commented code is worse than under-commented code: the noise buries the few comments that carry real information, and every comment is a liability that drifts from the code it describes. The goal of a prune is not "fewer comments" as a statistic — it is that every surviving comment is one the reader must not miss.

The survival test

A comment survives in exactly two cases, stated in one or two plain sentences:

  1. Why-not: it names an alternative a competent reader would plausibly reach for and states its non-obvious failure. ("Not the builtin NAT: NAT offers no host->guest path.")
  2. An invariant the code cannot show: a value that must agree with the other side of a boundary (another file, process, protocol, or tool) and what breaks if they drift; an environment, OS, or third-party quirk the code works around; an exit-code or format contract; an ordering/locking constraint whose violation breaks something non-locally ("holding this lock is what licenses X to do Y").

Exception: test code is the one place a WHAT comment is welcome — the test name plus at most a short comment saying which promise the test pins. Everything else in the test body follows the same rules as production code.

"The reason isn't visible in the code" is NOT sufficient. Every naming, factoring, and structuring decision has a reason, and none of them get a comment. If nobody would seriously contest the decision, the "because" is narration, not information.

DELETE

Delete the whole comment, or trim a mixed comment to its surviving clause:

  1. Paraphrase of the code or signature. Doc comments that restate what the name and types already say ("returns the current PID, or 0 when not running"; "accepts PORT or HOST:PORT").
  2. Generic language / stdlib / framework knowledge. How the framework wires things, what a stdlib call guarantees, what a well-known option means — anything true of every project using the tool, not of this software. Tutorials belong in the tool's docs.
  3. History. "was", "previously", "no longer", "renamed from", before/after framing, compatibility notes for versions nobody runs. git log owns the past; a comment that only makes sense against a previous version of the code is stale the day it lands.
  4. Rationale for uncontested decisions. Why a struct carries a field, why a function was split, "X rather than Y" where nobody would seriously try Y or the benefit is obvious.
  5. Narration of visible behavior. What the next line does, the shape a format string builds, restating a condition in prose.
  6. Reviewer-addressed justification. "This is safe because…", change-relative framing — that argument belongs in the commit message, not the source.
  7. Duplicates. An invariant already stated at its authoritative site (the usage site, the boundary definition, a central helper) does not get copies at every mention. Keep one, at the site a reader hits first when the invariant matters.

Read the full file on GitHub · 111 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. 3mo ago First seen · 111 lines · 88 tokens per session scan A 851d68e7375e

Subscribe to this mod's changes

prune-comments is a skill published in the GitHub repository natsukium/dotfiles (106 stars, last pushed today), licensed CC0-1.0. It adds 88 tokens to every session and 1,264 once invoked, about $0.0004 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-30.

Related

prune-comments compared with skills from other repositories

prune-comments next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prune-commentsnatsukium/dotfilesSkill106todayCC0-1.0A88Claude Code, Codex
deep-research-teammalob/nix-configSkill4648d agoMITA132Claude Code
audit-permissionsmalob/nix-configSkill4648d agoMITA67Claude Code
malo-find-skillsmalob/nix-configSkill4648d agoMITA69Claude Code, Codex
drift-checkjoshukraine/dotfilesSkill4307d agoMITA20Claude Code
codebase-auditfredrikaverpil/dotfilesSkill261yesterdayMITA119Claude Code
cross-reviewrgomezcasas/dotfilesSkill3626d agoMITA96Claude Code, Codex