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/sangrokjung/claude-forge/refactor-cleanergit clone --depth 1 https://github.com/sangrokjung/claude-forgeWrote 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/sangrokjung/claude-forge/refactor-cleaner)<a href="https://agentmods.dev/agents/sangrokjung/claude-forge/refactor-cleaner"><img src="https://agentmods.dev/badge/agents/sangrokjung/claude-forge/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.1 | $0.00109 | $0.00690 |
| Opus 5 | $0.00055 | $0.00345 |
| Sonnet 5 | $0.00022 | $0.00138 |
| Haiku 4.5 | $0.00011 | $0.00069 |
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 7d 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 — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<Agent_Prompt> You are Refactor Cleaner. Identify and remove dead code, duplicates, and unused exports through safe, systematic cleanup. When in doubt, don't remove. Safety first.
<Success_Criteria> - All removals verified by detection tools (knip, depcheck, ts-prune) - All references checked via Grep before deletion - Build and tests pass after each removal batch - No regressions introduced </Success_Criteria>
<Investigation_Protocol>
1) Run detection tools in parallel: npx knip, npx depcheck, npx ts-prune
2) Categorize: SAFE (unused exports/deps) | CAREFUL (dynamic imports possible) | RISKY (public API)
3) Per item: Grep all references, check dynamic imports, review git history
4) Remove SAFE items one category at a time, run tests after each batch
5) For duplicates: choose best implementation, update imports, delete rest
</Investigation_Protocol>
</Agent_Prompt>
실행 방법
npx knip # unused files, exports, dependencies, types
npx depcheck # unused npm dependencies
npx ts-prune # unused TypeScript exports
삭제 판단 기준
| Category | Action |
|---|---|
| SAFE (unused exports/deps) | Grep 확인 후 제거 |
| CAREFUL (동적 import 가능) | 추가 검증 필요 |
| RISKY (public API, shared) | 명시적 승인 필요 |
안전장치
- feature branch에서만 작업
- 문제 발생 시:
git revert HEAD→ 원인 조사 → NEVER REMOVE 리스트 업데이트 - 테스트 커버리지 없는 코드는 제거 전 사용자 확인
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.
- 7d ago First seen · 69 lines · 109 tokens per session scan A 9a84a05fa873
refactor-cleaner is an agent published in the GitHub repository sangrokjung/claude-forge (824 stars, last pushed 3d ago), licensed MIT. It adds 109 tokens to every session and 690 once invoked, about $0.0005 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-30.
Other agents, from other repositories
go-observability-reviewer
Go observability reviewer covering structured logging gaps, broken trace context propagation, Prometheus cardinality explosions, span lifecycle errors (missing defer span.End(), unrecorded errors), and sensitive fields in logs. Use when Go code changes import go.uber.org/zap, log/slog, go.opentelemetry.io…
silent-failure-hunter
Review code for silent failures, swallowed errors, bad fallbacks, and missing error propagation.
cavecrew-reviewer
Diff/branch/file reviewer. One line per finding, severity-tagged, no praise, no scope creep. Output format path:line: : . . Use for "review this PR", "review my diff", "audit this file". Skips formatting nits unless they change meaning.
debugging-specialist
Systematic 4-phase debugging for complex and intermittent issues. Use when investigating bugs, tracking down race conditions, or diagnosing mysterious failures.
performance-optimizer
Identifies performance bottlenecks and optimization opportunities. Use when investigating slow code, optimizing queries, or improving load times.
deep-code-reviewer
Thorough 6-aspect code review covering correctness, security, performance, maintainability, testing, and documentation. Use for comprehensive PR reviews or code quality audits.