config-gc
できること
このエージェントは、Claude Codeの設定ファイルを整理する手助けをします。古いもの、重複したもの、不要なものを探し出し、それらを削除することで、すっきりと速く動くように保ちます。
使う場面
- ✓「スキル」や設定が多すぎると感じたとき。
- ✓Claude Codeの起動が遅いと感じたとき。
- ✓毎月、設定を見直したいとき。
スキルのリンク
https://github.com/affaan-m/ECC/blob/main/skills/config-gc/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Claude Codeの設定を整理してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
定期的に設定ファイルを確認し、もう使われていないものや重複しているものを探します。その後、見つかったものを提示し、一つずつ削除してよいか尋ねます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Config GC — Garbage Collection for Claude Code Setups
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.
When to Activate
- The user asks to clean up, audit, or slim down their Claude Code configuration
- The user complains about too many skills, noisy hooks, or slow session startup
- A monthly/periodic config review is due
- After installing a large skill pack (e.g. this repo), to reconcile overlaps with existing setup
Do NOT activate for: cleaning project source code (that's refactoring), clearing chat history, or uninstalling Claude Code itself.
Design Philosophy
- Append-only configs leak. Skills, memory files, hooks, and permission entries only ever get added. Without periodic review they rot silently.
- Regular audits beat one-time purges. Scan every ~30 days, propose a small batch of candidates each time.
- Per-channel strategies. Each accumulation type (skills, hooks, permissions, ...) has its own staleness signals — don't apply one rule everywhere.
- Soft-delete first. Rename to
.disabled> move to~/.claude/_gc_trash/> real deletion. Always keep an undo path. - Forced human-in-the-loop. Every candidate gets its own
[y/n/skip]confirmation. No "yes to all" shortcut. - Keep a log. Every GC run appends to
~/.claude/gc_log.md: what was touched, why, and how to undo it.
Scan Channels
| # | Channel | Path | Staleness / redundancy signals |
|---|---|---|---|
| 1 | Skills | ~/.claude/skills/*/ |
Heavily overlapping names; never triggered in recent transcripts; domain mismatch with the user's actual work; broken or empty SKILL.md |
| 2 | Memory | ~/.claude/**/memory/*.md + its index |
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 |
| 3 | Hooks | ~/.claude/hooks/ + settings |
Scripts present on disk but referenced by no hook config; old versions superseded by rewrites |
| 4 | Permissions | permissions.allow in settings.json / settings.local.json |
Duplicate entries; specific entries already covered by a wildcard (e.g. Bash(git push) when Bash(*) is allowed); one-off grants from past experiments |
| 5 | MCP servers | ~/.claude.json or project .mcp.json |
Servers that fail to connect; functional duplicates; long-unused |
| 6 | Scheduled reminders / jobs | wherever the user keeps them | Fired one-shots older than 30 days; jobs whose target scripts no longer exist |
| 7 | Project history | ~/.claude/projects/*/ |
Stale handoff snapshots; session records superseded by newer state |
| 8 | Runtime caches | cache/, file-history/, logs/, shell-snapshots/ |
Sort by size and mtime; propose items >30 days old and large |
Workflow
- Scan all channels (or the subset the user names). Collect candidates with: path, channel, signal that flagged it, size, last-modified.
- Rank by confidence (broken/orphaned = high; merely old = low) and present as a numbered table. Cap each run at ~20 candidates — GC is periodic, not exhaustive.
- Confirm one by one. For each candidate show the evidence, then ask
[y/n/skip]. The user can stop at any point. - Soft-delete confirmed items: prefer
.disabledrename for skills/hooks 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 ingc_log.md, then remove it from theallowarray withjq. Only hard-delete when the user explicitly asks. - Log the run to
~/.claude/gc_log.md: timestamp, items actioned, undo instructions. - Report: reclaimed size, channels still healthy, suggested next review date.
Example Scan Commands
Orphaned hook scripts (channel 3) — scripts on disk that no hook config references:
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
Redundant permission entries (channel 4) — duplicates, and specific grants shadowed by a wildcard:
jq -r '.permissions.allow[]' ~/.claude/settings.local.json | sort | uniq -d
…
よくある質問
「スキル」「メモリ」「フック」「パーミッション」とは何ですか?
Claude Codeに設定できるさまざまな種類の項目です。「スキル」は小さなプログラムのようなもの、「メモリ」は情報を保存するもの、「フック」は出来事に反応するもの、「パーミッション」はClaude Codeができることを制御するものです。
確認なしに何かを削除しますか?
いいえ。見つけたものを必ず提示し、削除する前にあなたの許可を求めます。最終的な判断はあなたにあります。
間違えて削除したものを元に戻せますか?
はい。完全に削除するのではなく、「ゴミ箱」フォルダに移動するか、名前の末尾に「.disabled」を付けて保存するため、必要であれば復元できます。
詳細
作者による元の説明
Garbage collection for your Claude Code configuration. Periodically scans ~/.claude (skills, memory, hooks, permissions, MCP servers, 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 co
repo: affaan-m/ECC
人気
- GitHubのスター
- 280k
- ランキング
- #281
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
accessibility
280kエージェントが誰にとっても使いやすいインターフェースを作れるように手助けします。目が見えない方や身体の動きに制限のある方など、障害のある人にとってもWebサイトやアプリが正しく動くようにします。
agent-architecture-audit
280kエージェントがすべて正しく動いているかを確認できるようにします。AIシステムの問題を見つけて修正し、期待どおりに動くようにします。
agent-eval
280kエージェントが異なるAIコーディングツールを比較できるようにします。特定のタスクにおいて、どれがより速く、安く、信頼性が高いかを測定します。
agent-harness-construction
280kエージェントがタスクの進め方をよりよく理解できるようにします。エージェントが使うツールや指示を最適化し、成功する可能性を高めます。
似ているスキル
knowledge-automation
394kナレッジボールトに新しいコンテンツを定期的に取り込む繰り返しジョブを設定し、そのジョブが動いていることを確認するようエージェントを支援します。
knowledge-source-ingest
394kチャットチャンネル、フィード、メールボックスからの新しい項目でナレッジボールトを最新に保ち、すでに取り込んだものは再び追加しないようエージェントを支援します。
watchers
260kRSSフィード、JSONのエンドポイント、またはGitHubの活動を定期的に監視し、前回の確認以降に新しくなった項目だけを報告するようエージェントを支援します。