Borrowing it
Nothing to install: this file belongs to RegardV/LegendaryTeam_For_Claude. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/RegardV/LegendaryTeam_For_Claude/main/.claude/commands/refactor-clean.mdgit clone --depth 1 https://github.com/RegardV/LegendaryTeam_For_ClaudeWrote 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.
[](https://agentmods.dev/commands/regardv/legendaryteam_for_claude/refactor-clean)<a href="https://agentmods.dev/commands/regardv/legendaryteam_for_claude/refactor-clean"><img src="https://agentmods.dev/badge/commands/regardv/legendaryteam_for_claude/refactor-clean.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02861 |
| Opus 5 | $0.00000 | $0.01430 |
| Sonnet 5 | $0.00000 | $0.00572 |
| Haiku 4.5 | $0.00000 | $0.00286 |
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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 605 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/refactor-clean - Dead Code & Unused Import Detection
Detect and remove dead code, unused imports, and unnecessary dependencies for cleaner, more maintainable codebase.
Usage
# Scan for and remove all dead code
/refactor-clean
# Scan only (no changes)
/refactor-clean --dry-run
# Clean specific directory
/refactor-clean src/components
# Clean unused imports only
/refactor-clean --imports-only
# Clean unused dependencies
/refactor-clean --deps
# Aggressive mode (removes more aggressively)
/refactor-clean --aggressive
What This Command Does
- Scans codebase for unused code
- Identifies:
- Unused imports
- Unused variables
- Unused functions
- Unused types/interfaces
- Dead code paths
- Unused dependencies
- Removes safely (with verification)
- Verifies build and tests still pass
- Reports what was removed and why
Command Flow
Step 1: Analyze codebase
→ Scan all source files
→ Identify unused code
→ Categorize by type
Step 2: Plan removals
→ Prioritize safe removals
→ Flag risky removals
→ Create backup plan
Step 3: Execute removals
→ Remove unused imports
→ Remove unused code
→ Update references
Step 4: Verify
→ Run build
→ Run tests
→ Confirm no breakage
Step 5: Report
→ List removed code
→ Calculate savings (LOC, bundle size)
→ Provide statistics
Invokes Agent
@RefactorAgent will handle this command with the following context:
Task: Identify and remove dead code
Mode: ${mode} (default: safe, aggressive, dry-run)
Requirements:
1. Scan codebase for unused code
2. Categorize unused code by type
3. Remove unused code safely
4. Verify build and tests pass after each removal
5. Report removals and impact
6. Rollback if any issues detected
Safety:
- Remove only truly unused code
- Preserve public APIs
- Keep code referenced in tests
- Verify build and tests after changes
Output:
- List of removed code
- Lines of code reduced
- Bundle size impact
- Build/test verification status
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.
- 8d ago First seen · 605 lines · 0 tokens per session scan A fdf148e52a43
refactor-clean is a command published in the GitHub repository RegardV/LegendaryTeam_For_Claude (19 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,861 tokens. 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-30.
Other commands, from other repositories
hatch3r-bug-plan
Diagnose a complex incident -- reproduce the symptom, rank root-cause hypotheses, design the fix path, and emit regression coverage items as a board-ready investigation.
api
Debug API and data flow issues by tracing through Component -> TanStack Query -> Express Route -> Service -> SQLite/JSONL.
logs
Analyze server logs to diagnose errors, exceptions, and unexpected behavior.
data
Inspect database and state files to debug data issues.
performance
Diagnose performance issues including slow renders, bundle size, N+1 queries, and memory leaks.
browser
Debug and fix browser issues by inspecting, diagnosing, and resolving visual or technical problems.