awesome-code-cleanup

awesome-code-cleanup is a skill for Claude Code, Codex from khasky/awesome-agent-skills. It costs 166 tokens per session (6,213 once invoked), scanned A, original, MIT.

A repository cleanup and review process focused on comments, unused code, duplicate code, unclear names, and unnecessary abstractions. A repository is the project’s version-controlled folder.

In plain words
What is it for?
Use it to audit comments, correct stale explanations, identify dead or duplicated code, and optionally make behavior-preserving cleanup changes.
Why use it?
It removes misleading or distracting code notes while preserving behavior and can reveal dead or inconsistent code.

Skill for Claude CodeCodex

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

Good fit Use it to audit comments, correct stale explanations, identify dead or duplicated code, and optionally make behavior-preserving cleanup changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khasky/awesome-agent-skills/awesome-code-cleanup
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 khasky/awesome-agent-skills --skill awesome-code-cleanup
Clone the repo
git clone --depth 1 https://github.com/khasky/awesome-agent-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 awesome-code-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-code-cleanup/github.svg)](https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-code-cleanup)
Your own site
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-code-cleanup"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-code-cleanup/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 awesome-code-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-code-cleanup"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-code-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,213 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.00166 $0.06213
Opus 5 $0.00083 $0.03106
Sonnet 5 $0.00033 $0.01243
Haiku 4.5 $0.00017 $0.00621

Measured today against content hash 640b064a0be2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

awesome-code-cleanup 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 today.

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.

skills/awesome-code-cleanup/SKILL.md · 160 lines

How it starts

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

Code Cleanup

Audit and clean every code comment in a repository (or a scoped part of it) so the code follows: comments only when strictly necessary; the code itself is authoritative and self-documenting; kept comments are 1–2 lines where possible. The pass is strictly behavior-preserving — a comment pass that changes behavior is a failed pass.

Every comment gets one of four verdicts:

Verdict When Action
DELETE Restates code, narrates flow, tutorial-style, echoes a signature Remove
CONDENSE Load-bearing but bloated Compress to 1–2 lines, keep the essence
FIX Stale, misplaced, or contradicts the code Verify against code, rewrite accurately (or delete)
KEEP Dense gotcha/contract that genuinely needs its length Leave intact, flag in report

The FIX class is the highest-value work. Redundant comments are noise; stale comments are lies. A real pass regularly finds comments claiming constants that changed ("10,000 rows" over VOLUME = 2_000), explanations of mechanisms that no longer exist, JSDoc stranded above the wrong function, and references to deleted files. Always verify a suspicious comment against the actual code before rewording it — and never "fix" a comment to say something you haven't confirmed.

Modes

  • Comment pass (default) — the phased pipeline below, comments only.
  • Audit (read-only) — when the user asks to audit or review without editing: run Phase 0 recon and the Phase 1 analysis, edit nothing, and return findings instead of diffs. For each finding report: file:line, the smell, the suggested change, risk level (low / medium / high), recommendation strength (Strong / Worth exploring / Speculative — be honest about the last one), whether it can be fixed behavior-preservingly, and the verification command that would prove it. Shape each as Symptom → Consequence → Remedy — a smell with no concrete consequence and no remedy is noise, not a finding; where a named principle backs it (Fowler smell, Ousterhout shallow module, Hyrum's Law), cite it. Rank findings by impact and safety, and end with a "do not do" list — changes that look tempting but would touch public API or behavior. Cover comments plus the refactor-mode smells below.
  • Refactor (on explicit request) — extends the pass beyond comments to the code smells of AI-generated or vibe-coded files (see the REFACTOR MODE rulebook). Same phases, same NEVER list, same regression gate; every structural edit is held to the rename bar — provably behavior-preserving or not done.
  • Detection (on request) — when the user asks to find dead/unused code or logical inconsistencies ("find dead code", "найди мёртвый код", "неиспользуемый код", "логические несоответствия"): the DETECTION MODE pipeline — mechanical sweeps, evidence-contract subagents, execute-to-verify. Findings first; fixes only for the findings the user picks.
  • Execution (given a findings list) — the user arrives with a report from awesome-slop-audit, awesome-architecture-audit, or a reviewer, and wants it applied. The list replaces Phase 1's own analysis; everything else holds — Phase 0 recon still runs (the report may predate the current tree), the rulebook still governs each edit, the FIX-PASS TRAPS below apply per finding, and Phase 2 still verifies. Restate what is in and out of scope before the first edit: a user who picked three categories gets three categories, and the lies found in the others are re-listed unfixed, never quietly swept in.

Read the full file on GitHub · 160 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. today Changed · +2 lines 640b064a0be2
  2. 2d ago Changed · +9 lines · -85 tokens per session 8a8a99f13e2f
  3. 4d ago Changed · +15 lines e13faa84f88d
  4. 9d ago First seen · 134 lines · 251 tokens per session scan A 587daaa2b1a5

Subscribe to this mod's changes

awesome-code-cleanup is a skill published in the GitHub repository khasky/awesome-agent-skills (8 stars, last pushed today), licensed MIT. It adds 166 tokens to every session and 6,213 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

addyosmani/agent-skills · 51 tokens

doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now…

addyosmani/agent-skills · 67 tokens

code-simplification

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

addyosmani/agent-skills · 51 tokens

chinese-code-review

A Chinese-language code-review communication guide with templates and severity levels for review comments.

jnMetaCode/superpowers-zh · 62 tokens

receiving-code-review

A guide for handling code-review feedback carefully. Code review is the process of checking proposed changes before they are accepted into a project.

jnMetaCode/superpowers-zh · 50 tokens

requesting-code-review

A code-review procedure for checking completed work against its requirements before it spreads or is merged. A code reviewer is a person or agent who looks for defects and missing parts.

jnMetaCode/superpowers-zh · 24 tokens