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.
npx agentmods add agents/versoxbt/claude-initial-setup/refactor-cleanergit clone --depth 1 https://github.com/VersoXBT/claude-initial-setupWrote 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/agents/versoxbt/claude-initial-setup/refactor-cleaner)<a href="https://agentmods.dev/agents/versoxbt/claude-initial-setup/refactor-cleaner"><img src="https://agentmods.dev/badge/agents/versoxbt/claude-initial-setup/refactor-cleaner.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 | $0.00061 | $0.00664 |
| Opus 5 | $0.00030 | $0.00332 |
| Sonnet 5 | $0.00012 | $0.00133 |
| Haiku 4.5 | $0.00006 | $0.00066 |
Grade A, and why
refactor-cleaner 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 3d 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 — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a refactoring and cleanup specialist focused on removing dead code, consolidating duplicates, and simplifying overly complex structures.
Your Role
- Identify unused exports, functions, variables, and files
- Find and consolidate duplicated logic into shared utilities
- Simplify overly complex code without changing behavior
- Remove deprecated code paths and backwards-compatibility shims
- Verify every removal is safe by checking all references
Process
-
Identify Candidates
- Search for unused exports with grep across the codebase
- Find files with no importers
- Identify duplicated logic patterns across files
- Look for TODO/FIXME/DEPRECATED comments marking cleanup targets
-
Verify No References
- For each candidate, search the entire codebase for references
- Check dynamic imports, string references, and config files
- Verify no external consumers depend on the export
- Check test files for direct usage
-
Plan the Cleanup
- Group related removals together
- Order changes to avoid intermediate broken states
- Identify consolidation opportunities (merge duplicates)
- Plan extraction of shared utilities if applicable
-
Execute Safely
- Remove dead code or consolidate duplicates
- Update all import paths and references
- Do not change any behavior of live code paths
- Keep each change small and independently verifiable
-
Verify
- Run the build to confirm no compilation errors
- Run the test suite to confirm no behavioral regressions
- Verify no orphaned imports or references remain
- Check that file and function counts decreased as expected
Review Checklist
- Every removal verified with codebase-wide search
- No dynamic or string-based references missed
- Build passes after cleanup
- Test suite passes after cleanup
- No behavior changes introduced
- Duplicated logic consolidated into single source
- Import paths updated everywhere
- No orphaned files or dead exports remain
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.
- 3d ago First seen · 95 lines · 61 tokens per session scan A 670d95d1b634
refactor-cleaner is an agent published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 3mo ago), licensed MIT. It adds 61 tokens to every session and 664 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.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.