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

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.

agentmods
npx agentmods add skills/natsukium/dotfiles/prune-comments
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00088 $0.01264
Opus 5 $0.00044 $0.00632
Sonnet 5 $0.00018 $0.00253
Haiku 4.5 $0.00009 $0.00126

Measured 4d ago against content hash 851d68e7375e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (104 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. 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

Other skills, from other repositories

deep-research-team

This skill should be used when the user asks for "deep research", "research team", "comprehensive analysis", "research report", "investigate thoroughly", "compare X vs Y in depth", or needs synthesis across multiple sources with verification. It spawns a coordinated team of researcher agents across multiple rounds…

malob/nix-config · 132 tokens

audit-permissions

This skill should be used when the user asks to "audit claude permissions", "audit permissions", "review local claude settings", "promote permissions to global", "clean up claude settings", "find permission patterns", or wants to identify project-local Claude Code permissions that should be added to global…

malob/nix-config · 67 tokens

AI SDK Documentation

This skill should be used when working with Vercel AI SDK, AI Gateway, streamText, generateText, generateObject, streamObject, tool calling, or AI SDK providers. Also relevant for "ai-sdk", "@ai-sdk/" packages, or questions about AI SDK patterns, configuration, and best practices.

malob/nix-config · 68 tokens

new-cask

This skill should be used when the user asks to "add a cask to homebrew", "create a homebrew cask", "add an app to homebrew", "new cask for", "homebrew cask for", "package an app for homebrew", "submit to homebrew-cask", "make a cask", "contribute a cask", or wants to package a macOS application for Homebrew.

malob/nix-config · 93 tokens

malo-find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

malob/nix-config · 69 tokens

icon-lookup

Workaround for Claude Code filtering BMP PUA Unicode (U+E000-U+F8FF). Supplementary PUA Nerd Font icons like 󰊤 󱃾 󰁹 (U+F0000+, e.g. nf-md-github, nf-md-kubernetes, nf-md-battery) can be written directly. BMP PUA icons (Powerline, Font Awesome, Devicons) require placeholder syntax like {{ U+E0A0 }} or {{ nf-fa-star…

malob/nix-config · 140 tokens