refactor-clean

refactor-clean is a skill for Claude Code from vasuag09/harness-claude. It costs 53 tokens per session (297 once invoked), scanned A, original, MIT.

A code-cleanup skill that removes unused code, repeated logic, debug leftovers, and other accumulated clutter while preserving behavior.

In plain words
What is it for?
Use it after shipping to find safe deletion candidates, combine duplicated code, split oversized files, and verify the project still builds and passes its tests.
Why use it?
It helps reduce technical debt—the maintenance burden caused by old or unnecessary code—without turning cleanup into an unplanned redesign.

Skill for Claude Code

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

Part of the harness-claude plugin — 32 skills, 8 agents, 6 hooks, 3 MCP servers shipped together

Good fit Use it after shipping to find safe deletion candidates, combine duplicated code, split oversized files, and verify the project still builds and passes its tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vasuag09/harness-claude/refactor-clean
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 vasuag09/harness-claude --skill refactor-clean
Clone the repo
git clone --depth 1 https://github.com/vasuag09/harness-claude

Made for: Claude Code.

Or install harness-claude, the plugin that ships this one along with the rest of its 32 skills, 8 agents, 6 hooks, 3 MCP servers.

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 refactor-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/vasuag09/harness-claude/refactor-clean/github.svg)](https://agentmods.dev/skills/vasuag09/harness-claude/refactor-clean)
Your own site
<a href="https://agentmods.dev/skills/vasuag09/harness-claude/refactor-clean"><img src="https://agentmods.dev/badge/skills/vasuag09/harness-claude/refactor-clean/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 refactor-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/vasuag09/harness-claude/refactor-clean"><img src="https://agentmods.dev/badge/skills/vasuag09/harness-claude/refactor-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 297 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.00053 $0.00297
Opus 5 $0.00026 $0.00148
Sonnet 5 $0.00011 $0.00059
Haiku 4.5 $0.00005 $0.00030

Measured 9d ago against content hash 73318abc1633, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

refactor-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 9d 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.

skills/refactor-clean/SKILL.md · 26 lines

What it actually says

/refactor-clean — safe cleanup

Goal: a leaner, more modular codebase without changing behavior.

Do this

  1. Delegate to harness-claude:refactor-cleaner, or inline:
  2. Find candidates with analyzers when present (knip/depcheck/ts-prune/ruff/vulture), else mgrep/graph (or Grep/Glob if those are unavailable): unused exports/imports/files, dead branches, duplicated logic, stray debug code, oversized files (>800 lines).
  3. Confirm truly unused before deleting — check all references, including dynamic usage. When unsure, leave it and report.
  4. Consolidate duplication into one well-named utility; split oversized files by responsibility. Small, reversible steps; run tests/build after each.

Constraints

Behavior-preserving. No feature/API changes unless asked. Keep diffs reviewable; if a cleanup turns into a redesign, stop and route to /harness-claude:architect.

Exit criterion

Cruft removed with reference checks, tests/build still green, change documented.

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. 9d ago First seen · 26 lines · 53 tokens per session scan A 73318abc1633

Subscribe to this mod's changes

refactor-clean is a skill published in the GitHub repository vasuag09/harness-claude (2 stars, last pushed 2mo ago), licensed MIT. It adds 53 tokens to every session and 297 once invoked, about $0.0003 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

check-cache-bugs

Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5.

FlorianBruniaux/claude-code-plugins · 38 tokens

issue-triage

3-phase issue backlog management with audit, deep analysis, and validated triage actions. Use when triaging GitHub issues, sorting bug reports, cleaning up stale tickets, or detecting duplicate issues. Args: 'all' to analyze all, issue numbers to focus (e.g. '42 57'), 'en'/'fr' for language, no arg = audit only.

FlorianBruniaux/claude-code-plugins · 81 tokens

eval-rules

Audit .claude/rules/ files for structural correctness, glob validity, and real-world usefulness. Resolves each paths: pattern against actual project files, then asks the user whether each rule is still relevant and useful. Can update rules in-place based on answers. Use when setting up rules for the first time…

FlorianBruniaux/claude-code-plugins · 84 tokens

audit-codebase

Codebase health audit scoring 7 categories with progression plan.

FlorianBruniaux/claude-code-plugins · 15 tokens

pentest-forensics

Digital forensics — evidence acquisition, memory/disk imaging analysis, timeline reconstruction, IOC extraction advisory. Triggers on forensics, DFIR, Volatility, memory analysis, disk image, Autopsy, FTK, timeline, IOC extraction, evidence chain, log analysis.

fatihkan/badi · 60 tokens

pentest-malware

Malware analysis — triage, static analysis, dynamic sandbox, IOC extract, YARA signature writing advisory. Triggers on malware analiz, malware triage, sandbox, Cuckoo, IDA, Ghidra, dynamic analysis, IOC, YARA imza, packer, unpacker, reverse malware.

fatihkan/badi · 69 tokens