/toolbelt:config-gcfrom toolbelt
Garbage collection for your Claude Code configuration. Periodically scans ~/.claude (skills, agents, memory, hooks, permissions, MCP servers, plugins, caches) for redundant, stale, orphaned, or low-value items, then walks the user through a confirm-each-deletion cleanup. Use when the user says "clean up my config", "config GC", "too many skills", "audit my setup", "my .claude is bloated", or asks for a periodic config review.
Ships in toolbelt. 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.
Borrowed from runtime garbage collection: periodically scan for objects that are no longer referenced, redundant, expired, or low-value, and reclaim the space. The critical difference: here, collection requires a human in the loop. Never delete autonomously.
This skill is a manual audit workflow, not an automated one. It does not assume any pre-installed cleanup hook or scheduler — every command below is meant to be run and reviewed by the agent (you) during the session, with the target directory always confirmed with the user first (default: ~/.claude, but a project's .claude/ or ~/.codex are equally valid targets — see "Applying to ~/.codex" below).
Do NOT activate for: cleaning project source code (that's refactoring), clearing chat history, or uninstalling Claude Code/Codex itself.
.disabled > move to ~/.claude/_gc_trash/ > real deletion. Always keep an undo path.[y/n/skip] confirmation. No "yes to all" shortcut.~/.claude/gc_log.md: what was touched, why, and how to undo it.| # | Channel | Path | Staleness / redundancy signals |
|---|---|---|---|
| 1 | Skills | ~/.claude/skills/*/ | Heavily overlapping names; never mentioned in recent conversations; domain mismatch with actual work; broken or empty SKILL.md |
| 2 | Custom subagents | ~/.claude/agents/*.md | Descriptions that overlap (e.g. two "security review" agents); tools grant broader than the agent needs; never invoked |
| 3 | Memory | ~/.claude/projects/*/memory/*.md + its index (e.g. MEMORY.md) | Multiple index entries for one topic; contents contradicting newer entries; dates that have passed; orphan files missing from the index; sub-100-word fragments that should merge |
| 4 | Hooks | settings.json / settings.local.json .hooks, plus any plugin-provided hooks/hooks.json under ~/.claude/plugins/ | Hook entries referencing scripts that no longer exist on disk; hooks that silently duplicate what a plugin already does |
| 5 | Permissions | permissions.allow / permissions.deny in settings.json / settings.local.json | Duplicate entries; specific entries already covered by a wildcard (e.g. Bash(git add *) when Bash(*) is allowed); one-off grants from past experiments (a curl to a one-time download URL, a single qlmanage repro command, etc.) |
| 6 | Plugins / marketplaces | ~/.claude/plugins/installed_plugins.json, ~/.claude/plugins/marketplaces/* | Installed plugins never invoked; marketplaces added for a single plugin that was later removed |
| 7 | MCP servers | ~/.claude.json .projects[].mcpServers or project .mcp.json | Servers that fail to connect; functional duplicates; long-unused |
| 8 | Scheduled reminders / jobs | ~/.claude/jobs/ | Fired one-shots older than 30 days; jobs whose target scripts no longer exist |
| 9 | Project/session history | ~/.claude/projects/*/, ~/.claude/sessions/ | Stale handoff snapshots (check against the handoff skill's .agent/ docs if present); session records superseded by newer state |
| 10 | Runtime caches | ~/.claude/cache/, ~/.claude/file-history/, ~/.claude/shell-snapshots/, ~/.claude/paste-cache/, ~/.claude/telemetry/, ~/.claude/downloads/, ~/.claude/session-env/, daemon.log, history.jsonl | Sort by size and mtime; propose items >30 days old and large |
| 11 | Backups | ~/.claude/backups/ | Backup files superseded by a newer backup of the same target |
~/.claude; could be a project's .claude/ or ~/.codex).[y/n/skip]. The user can stop at any point..disabled rename for skills/agents and _gc_trash/<date>/ move for files. Permission entries live in JSON (no comments possible): back up the settings file, record each removed entry verbatim in gc_log.md, then remove it from the allow/deny array with jq. Only hard-delete when the user explicitly asks.~/.claude/gc_log.md: timestamp, items actioned, undo instructions.Skills with no matching directory reference anywhere (channel 1) — quick sanity check for empty/broken SKILL.md:
for d in ~/.claude/skills/*/; do
f="$d/SKILL.md"
[[ -f "$f" ]] || echo "BROKEN (no SKILL.md): $d"
[[ -s "$f" ]] || echo "EMPTY: $f"
done
Custom subagents and their declared tool scope (channel 2) — eyeball for over-broad grants:
for f in ~/.claude/agents/*.md; do
echo "== $(basename "$f") =="
awk '/^tools:/{print; exit} /^---$/{c++} c==2{exit}' "$f"
done
Redundant permission entries (channel 5) — duplicates, and specific grants shadowed by a 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
Installed plugins that never appear in recent history (channel 6) — cross-check against pluginUsage if tracked in ~/.claude.json:
jq -r '.installed_plugins // {} | keys[]' ~/.claude/plugins/installed_plugins.json 2>/dev/null
Largest stale caches (channel 10) — du -k instead of GNU-only find -printf, so it works on macOS/BSD too:
find ~/.claude/file-history ~/.claude/shell-snapshots ~/.claude/paste-cache -type f -mtime +30 \
-exec du -k {} + 2>/dev/null | sort -rn | head -20
Soft-delete with undo path (capture the date once so the log can't disagree with the directory):
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
Removing a confirmed-redundant permission entry (JSON has no comments — back up, log, then edit):
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
The same workflow (confirm-each-deletion, soft-delete, log) applies to a Codex CLI setup, with different paths:
| Channel | Claude Code equivalent | Codex path |
|---|---|---|
| Skills | ~/.claude/skills/*/ | ~/.codex/skills/*/ (each has SKILL.md + agents/openai.yaml) |
| Config / rules | CLAUDE.md | AGENTS.md, ~/.codex/config.toml |
| Session/project history | ~/.claude/projects/, ~/.claude/sessions/ | ~/.codex/logs_*.sqlite, ~/.codex/memories_*.sqlite, ~/.codex/goals_*.sqlite |
| Plugins | ~/.claude/plugins/ | ~/.codex/plugins/ |
| Caches | ~/.claude/cache/ | ~/.codex/cache/, ~/.codex/.tmp/ |
Adjust the log location accordingly (e.g. ~/.codex/gc_log.md) so the two ecosystems don't share one undo trail.
_gc_trash/ copy or .disabled rename, you did it wrong.~/.claude, a project's .claude/, or ~/.codex). Config GC never wanders into source trees.gc_log.md forever. It's tiny, and "when did I disable that hook and why" comes up more often than you'd think.skill-stocktake — audits skill quality; config-gc audits skill existence. Run stocktake on what survives GC.security-scan — a focused, security-only pass over the same directories (secrets, permissive allow-lists, risky hooks). Pairs well with the permissions channel here.What SKILL.md sets; muted values are Claude Code's defaults
40 skills in this plugin
/agent-self-evaluationUse after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions./architecture-audit프로젝트의 설계(데이터/스키마 생명주기, API·인터페이스 계약, 상태 머신, 실패·경계 처리, 결합도·확장성, 신뢰 경계)가 얼마나 견고한지 근거와 함께 감사하는 스킬. structure-audit(파일·계층 조직)과 다르다 — 이 스킬은 "어디에 있는가"가 아니라 "이 모델링이 맞는가"를 본다. 코드 수정 없이 조사·보고만 한다. Triggers - "설계 감사", "아키텍처 감사", "설계 검토", "이 스키마 설계 괜찮은지", "API 계약 검토", "이 상태 머신 맞게 짰는지", "design audit", "architecture review", "schema design review"/article-writingWrite articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.Other plugins' skills for the same job
npx claudepluginhub jh3779/agent-toolbelt-public --plugin toolbelt