Chuyển đến nội dung
Skillpedia
Tự động hóa280k · #281

config-gc

Skill này làm gì

Agent này giúp bạn sắp xếp các tệp cấu hình của Claude Code. Nó tìm các mục cũ, trùng lặp hoặc không cần thiết, rồi giúp bạn xóa chúng để mọi thứ gọn gàng và nhanh hơn.

Khi nào nên dùng

  • ✓Khi bạn thấy có quá nhiều “skill” hoặc cấu hình.
  • ✓Khi Claude Code có vẻ chậm khi khởi động.
  • ✓Để rà soát cấu hình định kỳ mỗi tháng.

Liên kết skill

https://github.com/affaan-m/ECC/blob/main/skills/config-gc/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/affaan-m/ECC/blob/main/skills/config-gc/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Dọn dẹp cấu hình Claude Code của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent định kỳ kiểm tra các tệp cấu hình để tìm mục không còn dùng hoặc bị trùng lặp. Sau đó, nó cho bạn xem những gì đã tìm thấy và hỏi bạn có muốn xóa từng mục hay không, từng cái một.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. Append-only configs leak. Skills, memory files, hooks, and permission entries only ever get added. Without periodic review they rot silently.
  2. Regular audits beat one-time purges. Scan every ~30 days, propose a small batch of candidates each time.
  3. Per-channel strategies. Each accumulation type (skills, hooks, permissions, ...) has its own staleness signals — don't apply one rule everywhere.
  4. Soft-delete first. Rename to .disabled > move to ~/.claude/_gc_trash/ > real deletion. Always keep an undo path.
  5. Forced human-in-the-loop. Every candidate gets its own [y/n/skip] confirmation. No "yes to all" shortcut.
  6. 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

  1. Scan all channels (or the subset the user names). Collect candidates with: path, channel, signal that flagged it, size, last-modified.
  2. 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.
  3. Confirm one by one. For each candidate show the evidence, then ask [y/n/skip]. The user can stop at any point.
  4. Soft-delete confirmed items: prefer .disabled rename 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 in gc_log.md, then remove it from the allow array with jq. Only hard-delete when the user explicitly asks.
  5. Log the run to ~/.claude/gc_log.md: timestamp, items actioned, undo instructions.
  6. 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

…
Câu hỏi thường gặp

“Skill”, “memory”, “hooks” và “permissions” là gì?

Đây là các loại cấu hình khác nhau của Claude Code. “Skill” giống như những chương trình nhỏ, “memory” lưu thông tin, “hooks” phản ứng với các sự kiện, còn “permissions” kiểm soát những gì Claude Code được phép làm.

Agent có xóa gì mà không hỏi không?

Không. Agent luôn cho bạn xem những gì đã tìm thấy và xin phép trước khi xóa bất cứ thứ gì. Bạn luôn có toàn quyền kiểm soát.

Nếu lỡ xóa nhầm thì có khôi phục được không?

Có. Agent cố gắng chuyển mục vào thư mục “thùng rác” hoặc đổi tên thành “.disabled” thay vì xóa vĩnh viễn, nên bạn có thể khôi phục nếu cần.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
280k
Vị trí xếp hạng
#281
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự