/everything-claude-code:config-gcfrom everything-claude-code
Scans ~/.claude configuration (skills, memory, hooks, permissions, MCP servers, caches) for redundant, expired, or orphaned items and prompts user for cleanup.
Ships in everything-claude-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
借用运行时垃圾回收的思路:定期扫描不再被引用、冗余、过期或低价值的对象,并回收空间。关键区别是:这里的回收必须有人参与。不要自治删除。
不要用于:清理项目源码(那是重构)、清空聊天历史或卸载 Claude Code 本身。
.disabled > 移到 ~/.claude/_gc_trash/ > 真删除。始终保留 undo path。[y/n/skip] 确认。没有 “yes to all” 捷径。~/.claude/gc_log.md:动了什么、为什么、如何撤销。| # | 通道 | 路径 | 过期 / 冗余信号 |
|---|---|---|---|
| 1 | Skills | ~/.claude/skills/*/ | 名称高度重叠;近期 transcripts 从未触发;领域与用户实际工作不匹配;破损或空 SKILL.md |
| 2 | Memory | ~/.claude/**/memory/*.md + index | 同一主题多个 index entries;内容与更新条目矛盾;日期已过;index 缺失的 orphan files;应合并的低于 100 词片段 |
| 3 | Hooks | ~/.claude/hooks/ + settings | 磁盘上有脚本但没有 hook config 引用;旧版本已被重写取代 |
| 4 | Permissions | settings.json / settings.local.json 中的 permissions.allow | 重复 entries;已被 wildcard 覆盖的具体条目(如已有 Bash(*) 时的 Bash(git push));过往实验的一次性授权 |
| 5 | MCP servers | ~/.claude.json 或项目 .mcp.json | 无法连接的 servers;功能重复;长期不用 |
| 6 | Scheduled reminders / jobs | 用户存放位置 | 已触发的一次性任务超过 30 天;目标脚本已不存在的 jobs |
| 7 | Project history | ~/.claude/projects/*/ | 陈旧 handoff snapshots;已被新状态取代的 session records |
| 8 | Runtime caches | cache/、file-history/、logs/、shell-snapshots/ | 按大小和 mtime 排序;建议清理超过 30 天且较大的项目 |
[y/n/skip]。用户可以随时停止。.disabled 重命名,文件移到 _gc_trash/<date>/。Permission entries 位于 JSON(不能写 comments):备份 settings 文件,在 gc_log.md 中逐字记录每个 removed entry,然后用 jq 从 allow 数组删除。只有用户明确要求时才硬删除。~/.claude/gc_log.md:timestamp、处理项、undo instructions。孤立 hook scripts(channel 3)——磁盘上存在但没有 hook config 引用的 scripts:
for f in ~/.claude/hooks/*; do
name=$(basename "$f")
grep -rq "$name" ~/.claude/settings.json ~/.claude/settings.local.json 2>/dev/null \
|| echo "ORPHAN: $f"
done
冗余 permission entries(channel 4)——重复项,以及被 wildcard 遮蔽的具体授权:
jq -r '.permissions.allow[]' ~/.claude/settings.local.json | sort | uniq -d
if jq -e '.permissions.allow | index("Bash(*)")' ~/.claude/settings.local.json >/dev/null; then
jq -r '.permissions.allow[]' ~/.claude/settings.local.json \
| grep '^Bash(' | grep -vF 'Bash(*)'
fi
最大的陈旧 caches(channel 8)——使用 du -k 而不是 GNU-only find -printf,因此 macOS/BSD 也能用:
find ~/.claude/file-history ~/.claude/shell-snapshots -type f -mtime +30 \
-exec du -k {} + 2>/dev/null | sort -rn | head -20
带 undo path 的软删除(只捕获一次日期,避免日志和目录不一致):
gc_date=$(date +%Y-%m-%d)
mkdir -p ~/.claude/_gc_trash/$gc_date
mv ~/.claude/skills/dead-skill ~/.claude/_gc_trash/$gc_date/
echo "$(date -Iseconds) moved skills/dead-skill -> _gc_trash/$gc_date/ (undo: mv back)" >> ~/.claude/gc_log.md
删除已确认冗余的 permission entry(JSON 无 comments——先备份、记录,再编辑):
cp ~/.claude/settings.local.json ~/.claude/settings.local.json.bak
echo "$(date -Iseconds) removed permission entry: Bash(git push) (undo: restore from .bak or re-add)" >> ~/.claude/gc_log.md
jq '.permissions.allow -= ["Bash(git push)"]' ~/.claude/settings.local.json.bak \
> ~/.claude/settings.local.json
_gc_trash/ 副本或 .disabled 重命名,就是做错了。~/.claude 外的任何东西(或项目 .claude/)。Config GC 不会跑进源码树。gc_log.md。它很小,而“我什么时候禁用了那个 hook,为什么”比你想的更常出现。skill-stocktake — 审计 skill 质量;config-gc 审计 skill 是否应存在。对 GC 后保留下来的运行 stocktake。workspace-surface-audit — 加法侧:建议安装什么。config-gc 是同一生命周期的减法半边。configure-ecc — 用它安装 skills 后,运行 config-gc 来调和与既有配置的重叠。continuous-learning — 产生此技能后续审计的 memory files。security-review — 与 permissions 通道搭配很好。What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
config-gc, claude-config, garbage-collection, cleanup, audit
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
272 skills in this plugin
/accessibility使用 WCAG 2.2 AA 级标准设计、实施和审计包容性数字产品。使用此技能为 Web 和原生平台(iOS/Android)生成语义化 ARIA 和辅助功能属性。/agent-architecture-audit智能体和 LLM 应用的全栈诊断。审计 12 层智能体堆栈,检查包装器回归、内存污染、工具纪律失败、隐藏修复循环和渲染损坏。生成按严重程度排序的发现和代码优先修复。对于构建智能体应用、自主循环或任何 LLM 驱动功能的开发者至关重要。/agent-eval在自定义任务上对编码智能体(Claude Code、Aider、Codex 等)进行头对头比较,包含通过率、成本、时间和一致性指标/agent-harness-construction设计和优化 AI 智能体操作空间、工具定义和观察格式,以获得更高的完成率。Other plugins' skills for the same job