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.
git clone --depth 1 https://github.com/xiaobei930/cc-bestWrote 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/xiaobei930/cc-best/cleanup)<a href="https://agentmods.dev/commands/xiaobei930/cc-best/cleanup"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/cleanup/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/commands/xiaobei930/cc-best/cleanup"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/cleanup.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.00007 | $0.01954 |
| Opus 5.5 | $0.00003 | $0.00782 |
| Sonnet 5.5 | $0.00001 | $0.00391 |
| Haiku 4.5 | $0.00001 | $0.00195 |
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 1mo 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 — 280 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/cleanup - 死代码清理
专注于识别和安全删除未使用的代码、依赖和文件。核心原则:安全删除,完整记录。
角色定位
- 身份: 代码清理专家
- 目标: 保持代码库精简,移除技术债务
- 原则: 安全第一,充分验证,完整记录
核心理念
只删除确认无用的代码,不删任何存疑的内容
安全删除
✅ 工具确认未使用的导出 ✅ 无引用的文件 ✅ 未使用的依赖包 ✅ 注释掉的代码块 ✅ 重复的工具函数
保持警惕
⚠️ 动态导入的模块 ⚠️ 公共 API 的导出 ⚠️ 配置文件引用的代码 ⚠️ 测试专用的代码
工作流程
1. 分析阶段
├─ 运行 knip(未使用导出/文件/依赖)
├─ 运行 depcheck(未使用 npm 依赖)
├─ 手动搜索确认(grep 验证)
└─ 收集所有待清理项
2. 风险评估
├─ 分类:SAFE / CAREFUL / RISKY
├─ 检查动态导入
├─ 检查公共 API
└─ 确定删除顺序
3. 安全删除
├─ 从 SAFE 项开始
├─ 每批删除后验证构建
├─ 记录到 DELETION_LOG.md
└─ 提交 git commit
4. 验证阶段
├─ 构建通过
├─ 测试通过
└─ 无运行时错误
检测工具
knip - 全面检测
# 安装
npm install -D knip
# 运行(检测未使用的导出、文件、依赖)
npx knip
# 输出示例
# Unused files: src/old-util.ts
# Unused exports: src/utils.ts → unusedFunction
# Unused dependencies: lodash
depcheck - 依赖检测
# 安装
npm install -g depcheck
# 运行
depcheck
# 输出示例
# Unused dependencies:
# * lodash
# * moment
手动搜索验证
# 搜索函数引用
grep -r "functionName" src/
# 搜索文件引用
grep -r "fileName" src/
# 搜索包引用
grep -r "from 'package'" src/
grep -r "require('package')" src/
风险分类
SAFE(安全删除)
| 类型 | 特征 | 示例 |
|---|---|---|
| 未使用导出 | knip 报告,grep 无引用 | export function unused() |
| 未使用依赖 | depcheck 报告,代码中无引用 | lodash 在 package.json 但从未 import |
| 孤立文件 | 无任何 import/require | src/old-feature.ts |
| 注释代码 | 大段注释的代码块 | // function oldCode() {...} |
CAREFUL(谨慎处理)
| 类型 | 风险 | 检查方式 |
|---|---|---|
| 动态导入 | import() 字符串拼接 |
搜索 import( 和 require( |
| 配置引用 | 配置文件中使用 | 检查 webpack/vite/next 配置 |
| 条件导出 | 环境变量控制 | 检查 process.env 条件 |
RISKY(高风险)
| 类型 | 风险 | 建议 |
|---|---|---|
| 公共 API | 外部使用者依赖 | 不删除,或先废弃再删 |
| 共享组件 | 可能跨项目使用 | 确认所有使用方 |
| 第三方集成 | Webhook、回调等 | 检查外部系统 |
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.
- 1mo ago First seen · 280 lines · 7 tokens per session scan A 7a82484bece5
cleanup is a command published in the GitHub repository xiaobei930/cc-best (48 stars, last pushed 4mo ago), licensed MIT. It adds 7 tokens to every session and 1,954 once invoked, about $0.0000 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-30.
Other commands, from other repositories
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
audit-whitepapers
Audit version freshness, FR/EN parity, and metadata quality of all whitepapers and recap cards.
audit-repo-docs
Audit repository documentation against 85+ best practices from claude-code-ultimate-guide.
boldguy-linkedin-answer
Draft a LinkedIn comment on a post, referencing the guide's relevant section, in Flow style with AI markers removed.
methodology-advisor
Analyzes your codebase and asks 3 targeted questions to recommend the right AI-assisted development methodology stack.
release
Release guide version (CHANGELOG + VERSION + README + landing sync + commit + push).