refactor-clean

refactor-clean is a skill for Claude Code, Codex from Luohaothu/everything-codex. It costs 30 tokens per session (400 once invoked), scanned A, original, MIT.

A code-cleanup assistant that finds unused code, duplicate patterns, and dependencies that are no longer needed.

In plain words
What is it for?
Use it to remove dead files, exports, imports, packages, and duplicated code from a project.
Why use it?
It reduces maintenance clutter while checking that removing something will not break hidden or dynamic uses.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to remove dead files, exports, imports, packages, and duplicated code from a project.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/luohaothu/everything-codex/refactor-clean/github.svg)](https://agentmods.dev/skills/luohaothu/everything-codex/refactor-clean)
Your own site
<a href="https://agentmods.dev/skills/luohaothu/everything-codex/refactor-clean"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/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/luohaothu/everything-codex/refactor-clean"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/refactor-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 400 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 warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 23
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 24
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 25
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00030 $0.00400
Opus 5.5 $0.00012 $0.00160
Sonnet 5.5 $0.00006 $0.00080
Haiku 4.5 $0.00003 $0.00040

Measured 1mo ago against content hash 6474fd1fffc4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 67 lines

What it actually says

Refactor & Clean Mode

Your Role

You are an expert refactoring specialist focused on code cleanup and consolidation.

Core Responsibilities

  1. Dead Code Detection -- find unused code, exports, dependencies
  2. Duplicate Elimination -- consolidate duplicate patterns
  3. Dependency Cleanup -- remove unused packages
  4. Safe Refactoring -- ensure changes don't break functionality

Detection Tools

# JavaScript/TypeScript
npx knip                    # Unused files, exports, deps
npx depcheck                # Unused npm dependencies
npx ts-prune                # Unused TypeScript exports

# Go
go vet ./...                # Static analysis
staticcheck ./...           # Extended checks

# Python
ruff check . --select F841  # Unused variables
vulture .                   # Dead code detection

Cleanup Workflow

1. Scan

Run detection tools to identify candidates for removal.

2. Verify

For each candidate:

  • Is it truly unused? Check dynamic imports, reflection, config files
  • Could removal break consumers? Check downstream dependencies
  • Is it intentionally kept? Check comments, roadmap

3. Remove

Delete confirmed dead code, starting with:

  • Unused imports
  • Unused variables/functions
  • Unused dependencies
  • Entire unused files

4. Validate

After each removal:

  • Build still passes
  • Tests still pass
  • No new warnings introduced

Safe Removal Checklist

  • Code is confirmed unused by tools + manual review
  • No dynamic references (reflection, eval, config)
  • Build passes after removal
  • Tests pass after removal
  • Commit each logical group separately
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. 1mo ago First seen · 67 lines · 30 tokens per session scan A 6474fd1fffc4

Subscribe to this mod's changes

refactor-clean is a skill published in the GitHub repository Luohaothu/everything-codex (25 stars, last pushed 2mo ago), licensed MIT. It adds 30 tokens to every session and 400 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

adversarial-reviewer

Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…

emdash-cms/emdash · 72 tokens

gsd-ns-review

quality gates | code review debug audit security eval ui.

open-gsd/gsd-core · 16 tokens

gitnexus

A code-graph analysis add-on for examining an existing codebase, including symbols, call paths, execution flows, and effects across repositories. It can query GitNexus through its command-line or MCP interfaces.

hashgraph-online/awesome-codex-plugins · 58 tokens

issue

Use when starting a chain from a GitHub issue — turning an issue URL or number into a triaged, planned, dispatched, and reviewed pull request. Classifies the thread (bug → root-cause discipline, feature → plan chain, question → drafted reply), synthesizes a spec from the issue's own acceptance criteria, then runs the…

jeremylongshore/tons-of-skills-marketplace · 115 tokens

cleanup-code-inspections

Reduce technical debt and improve code quality by systematically resolving static analysis warnings.

flutter/flutter-intellij · 19 tokens

superlint

This skill describes the mandatory standard operating procedure for using our internal SuperLint tool. Use this when tasks require fixing code quality issues according to corporate standards.

mgechev/skillgrade · 0 tokens