clean

clean is a command for Claude Code from rikdc/ai-skills. It costs 7 tokens per session (204 once invoked), scanned A, original, MPL-2.0.

A code-cleanup command that removes comments which merely repeat the code, describe past edits, or contain disabled code.

In plain words
What is it for?
Use it to review local uncommitted changes, remove redundant comments, and move end-of-line explanations above the code they describe.
Why use it?
It reduces clutter while preserving comments that explain unfinished work, suppress tools, or prevent empty code blocks from becoming invalid.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the code-quality plugin — 3 commands shipped together

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 commands/rikdc/ai-skills/clean
Clone the repo
git clone --depth 1 https://github.com/rikdc/ai-skills

Made for: Claude Code.

Or install code-quality, the plugin that ships this one along with the rest of its 3 commands.

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 clean

README.md
[![agentmods](https://agentmods.dev/badge/commands/rikdc/ai-skills/clean.svg)](https://agentmods.dev/commands/rikdc/ai-skills/clean)
Your own site
<a href="https://agentmods.dev/commands/rikdc/ai-skills/clean"><img src="https://agentmods.dev/badge/commands/rikdc/ai-skills/clean.svg" alt="Measured on agentmods" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 204 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.1 $0.00007 $0.00204
Opus 5 $0.00003 $0.00102
Sonnet 5 $0.00001 $0.00041
Haiku 4.5 $0.00001 $0.00020

Measured 5d ago against content hash 83fb2367821c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

clean 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 5d 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/code-quality/commands/clean.md · 30 lines

What it actually says

  • Look for comments that are obvious or redundant and remove them. Examples of

    comments that can be removed include:

    • Commented out code.
    • Comments that describe edits like "added", "removed", or "changed" something.
    • Explanations that are just obvious because they are close to method names.
  • Do not delete all comments:

    • Don't remove comments that indicate code is a stub for future work.

    • Don't remove comments that start with TODO.

    • Don't remove comments if doing so would make a scope empty, like an empty catch

      block or an empty else block.

    • Don't remove comments that suppress linters or formatters, like

      // prettier-ignore

  • If you find any end-of-line comments, move them above the code they describe.

    Comments should go on their own lines.

Look at the local code changes that are not yet committed to git

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. 5d ago First seen · 30 lines · 7 tokens per session scan A 83fb2367821c

Subscribe to this mod's changes

clean is a command published in the GitHub repository rikdc/ai-skills (2 stars, last pushed today), licensed MPL-2.0. It adds 7 tokens to every session and 204 once invoked, about $0.0000 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-31.