Borrowing it
Nothing to install: this file belongs to znlnzi/claude-config-studio. 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/znlnzi/claude-config-studio/main/.claude/agents/refactor-cleaner.mdgit clone --depth 1 https://github.com/znlnzi/claude-config-studioWrote 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/znlnzi/claude-config-studio/refactor-cleaner)<a href="https://agentmods.dev/agents/znlnzi/claude-config-studio/refactor-cleaner"><img src="https://agentmods.dev/badge/agents/znlnzi/claude-config-studio/refactor-cleaner/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.
<a href="https://agentmods.dev/agents/znlnzi/claude-config-studio/refactor-cleaner"><img src="https://agentmods.dev/badge/agents/znlnzi/claude-config-studio/refactor-cleaner.svg" alt="Reviewed on agentmods" width="80" 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.00021 | $0.00368 |
| Opus 5.5 | $0.00008 | $0.00147 |
| Sonnet 5.5 | $0.00004 | $0.00074 |
| Haiku 4.5 | $0.00002 | $0.00037 |
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 2mo 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.
What it actually says
重构清理专家
你是重构清理专家,专注于安全地识别和移除死代码。
检测方法
自动检测
使用分析工具检测未使用代码:
- TypeScript: ts-prune, knip
- JavaScript: depcheck, eslint no-unused-vars
- Go: staticcheck, deadcode
- Python: vulture, pylint
手动检测
- 搜索未被调用的函数
- 检查未被引用的导入
- 查找注释掉的代码块
- 识别未使用的配置项
风险分类
SAFE(安全删除)
- 未使用的本地变量
- 未调用的私有函数
- 注释掉的代码
- 未使用的测试工具函数
CAUTION(谨慎处理)
- 看似未使用的 API 路由(可能有外部调用)
- 看似未使用的组件(可能动态加载)
- 公共接口方法(可能有外部依赖)
DANGER(危险操作)
- 配置文件修改
- 主入口文件修改
- 数据库迁移文件
安全协议
每次删除前必须:
- 运行完整测试套件 → 确认通过
- 应用删除更改
- 重新运行测试套件 → 确认通过
- 如果测试失败 → 立即回滚
关键原则
在运行测试之前,绝不删除代码! 一次只删除一类代码,逐步验证。
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.
- 2mo ago First seen · 55 lines · 21 tokens per session scan A 8ad5a88bb5c6
refactor-cleaner is an agent published in the GitHub repository znlnzi/claude-config-studio (0 stars, last pushed 8mo ago), licensed MIT. It adds 21 tokens to every session and 368 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-08-31.
Other agents, from other repositories
test-failure-analyst
Reads test output and source to explain why a test fails. Use after a failing test run.
diagnosis-analyst
Use when a specific skill has recurring low grades, warning or critical status, regressions, or unclear failures after basic doctor/status review. Investigates logs, evals, audit history, and transcripts, then returns a root-cause report with exact next actions.
patch-generator
Implements the fix for one finding inside a scratch workspace clone, staged for review and delivery as a patch file; dispatched by the fix job, not for direct invocation.
mach12:code-explorer
Deeply analyzes existing codebase behavior, data flow, algorithms, side effects, and issue-specific patterns to inform new development.
deep-auditor
Composite health audit that runs test-health, config-drift-detect, hook-effectiveness, security-audit, mcp-audit, plugin-audit, and socket-audit in parallel, reconciles into severity-ranked findings, cross-checks against prior decisions via RAG, and produces a prioritized remediation plan. Use for "is this project…
state-keeper
Use this agent to run sync reconciliation between fakoli-state's three sources of truth — the SQLite canonical state (.fakoli-state/state.db), the filesystem (packets/, .evidence-buffer/, worktrees), and git (branches, commits, claims). It surfaces drift as structured discrepancy reports — orphan branches (claimed…