cleanup

cleanup is a command for coding agents from SuperClaude-Org/SuperClaude_Plugin. It costs 16 tokens per session (832 once invoked), scanned A, a copy of cleanup, MIT.

A cleanup command for removing unused code, unnecessary imports, and unwanted project files. It can also reorganise the project structure and check the result afterward.

In plain words
What is it for?
Use it to clean code, imports, files, or everything together, with safer or more aggressive handling and optional interaction.
Why use it?
It reduces maintenance work and technical debt, meaning old or unnecessary code that makes a project harder to change safely.

Command

Part of the sc plugin — 32 commands, 20 agents 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/superclaude-org/superclaude_plugin/sc-cleanup
Clone the repo
git clone --depth 1 https://github.com/SuperClaude-Org/SuperClaude_Plugin

Or install sc, the plugin that ships this one along with the rest of its 32 commands, 20 agents.

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 cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/superclaude-org/superclaude_plugin/sc-cleanup.svg)](https://agentmods.dev/commands/superclaude-org/superclaude_plugin/sc-cleanup)
Your own site
<a href="https://agentmods.dev/commands/superclaude-org/superclaude_plugin/sc-cleanup"><img src="https://agentmods.dev/badge/commands/superclaude-org/superclaude_plugin/sc-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod 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.00016 $0.00832
Opus 5 $0.00008 $0.00416
Sonnet 5 $0.00003 $0.00166
Haiku 4.5 $0.00002 $0.00083

Measured 5d ago against content hash fc570ff621de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 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.

Origin

This is a copy

91% identical to cleanup — 31 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

commands/sc-cleanup.md · 112 lines

How it starts

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

/sc:sc:sc:cleanup - Code and Project Cleanup

Triggers

  • Code maintenance and technical debt reduction requests
  • Dead code removal and import optimization needs
  • Project structure improvement and organization requirements
  • Codebase hygiene and quality improvement initiatives

Usage

/sc:sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive] [--interactive]

Behavioral Flow

  1. Analyze: Assess cleanup opportunities and safety considerations across target scope
  2. Plan: Choose cleanup approach and activate relevant personas for domain expertise
  3. Execute: Apply systematic cleanup with intelligent dead code detection and removal
  4. Validate: Ensure no functionality loss through testing and safety verification
  5. Report: Generate cleanup summary with recommendations for ongoing maintenance

Key behaviors:

  • Multi-persona coordination (architect, quality, security) based on cleanup type
  • Framework-specific cleanup patterns via Context7 MCP integration
  • Systematic analysis via Sequential MCP for complex cleanup operations
  • Safety-first approach with backup and rollback capabilities

MCP Integration

  • Sequential MCP: Auto-activated for complex multi-step cleanup analysis and planning
  • Context7 MCP: Framework-specific cleanup patterns and best practices
  • Persona Coordination: Architect (structure), Quality (debt), Security (credentials)

Tool Coordination

  • Read/Grep/Glob: Code analysis and pattern detection for cleanup opportunities
  • Edit/MultiEdit: Safe code modification and structure optimization
  • TodoWrite: Progress tracking for complex multi-file cleanup operations
  • Task: Delegation for large-scale cleanup workflows requiring systematic coordination

Key Patterns

  • Dead Code Detection: Usage analysis → safe removal with dependency validation
  • Import Optimization: Dependency analysis → unused import removal and organization
  • Structure Cleanup: Architectural analysis → file organization and modular improvements
  • Safety Validation: Pre/during/post checks → preserve functionality throughout cleanup

Read the full file on GitHub · 112 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. 5d ago First seen · 112 lines · 16 tokens per session scan A fc570ff621de

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository SuperClaude-Org/SuperClaude_Plugin (55 stars, last pushed 15d ago), licensed MIT. It adds 16 tokens to every session and 832 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to cleanup, differing in 31 lines, and is treated as a copy.