Skill cleanup
Skill ClydeShen/harness-skill/skills/productivity/skill-cleanup
Audit and remove stale, renamed, or duplicate skills across all installed agent platforms (Claude Code, Kiro, Codex, Windsurf, Gemini, Pi, and more). Handles symlink and copy installs, detects artifacts, and generates OS-correct removal commands. Use when skills list feels cluttered, after renaming a skill, after uninstalling a plugin, or when user says "clean up skills", "remove old skill", "prune skills", "stale skill", "duplicate skill".From its SKILL.md
npx -y skills add ClydeShen/harness-skill --skill skill-cleanupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.7 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it
Skill Cleanup
Audit tool. Never delete anything without explicit user confirmation per item.
Quick start — interactive TUI tool
The fastest path. Run the bundled script for a multi-select TUI that scans all platforms and removes in one flow:
# First-time setup (once per machine)
cd <skills-dir>/skill-cleanup && npm install
# Run the interactive cleanup tool
node scripts/cleanup.mjs
# Preview only — no files removed
node scripts/cleanup.mjs --dry-run
The tool:
- Scans all installed agent platforms (Claude Code, Kiro, Codex, Windsurf, Gemini, Pi, and more)
- Pre-selects stale entries (renamed originals, artifacts, orphaned installs)
- Shows a multi-select checklist — toggle any skill, select all with
a - Asks for final confirmation before removing anything
- Removes platform copies first, central store last
Use the manual flow below if you prefer guided step-by-step or need to inspect specific entries.
Phase 1 — Detect OS and home directory
Run the appropriate probe:
macOS / Linux:
echo "OS: $(uname -s)"
echo "HOME: $HOME"
Windows (PowerShell):
echo "OS: Windows"
echo "HOME: $env:USERPROFILE"
Use the detected home directory for all paths below. On Windows substitute \ for / throughout.
Phase 2 — Scan installed locations
Run each command that applies (skip if directory does not exist):
# Central store — source of truth
ls ~/.agents/skills/
# Symlink platforms (point into central store)
ls ~/.claude/skills/ # Claude Code
ls ~/.kiro/skills/ # Kiro CLI
ls ~/.pi/agent/skills/ # Pi
ls ~/.kilocode/skills/ # Kilo Code
ls ~/.qwen/skills/ # Qwen Code
# Copy platforms (independent copies — not symlinks)
ls ~/.codex/skills/ # Codex
ls ~/.codeium/windsurf/skills/ # Windsurf
ls ~/.gemini/config/skills/ # Gemini CLI
See PLATFORMS.md for exact paths per OS and notes on each platform's install type.
Build two inventories:
- Central store list — what
~/.agents/skills/contains - Platform lists — what each platform dir contains
Phase 3 — Flag stale entries
Compare inventories. Flag an entry as stale when ANY signal is true:
| Signal | Stale type |
|---|---|
| Name matches a known renamed skill AND the replacement is also in central store | Renamed original |
Two entries where one is clearly the predecessor (e.g. foo and foo-v2, bar and bar-old) | Duplicate |
| Entry present in a platform dir but absent from central store | Orphaned platform entry |
| Entry in central store but absent from ALL platform dirs | Orphaned install (no platform linked) |
.zip suffix, -workspace suffix, or -backup suffix | Install artifact |
| Symlink in a symlink-platform dir whose target path does not resolve | Broken symlink |
Also check ~/.claude/settings.json (or equivalent) for plugins entries whose repo or skill name no longer matches what is installed.
Phase 4 — Interactive selection
If no stale entries found: state "All installed skills look clean." and stop.
If stale entries found, call AskUserQuestion with multiSelect: true:
- One option per unique skill name (not per platform entry)
- label:
skill-name [Platform1, Platform2, ...]listing every platform it appears in - description: the stale reason — e.g.
orphaned — not in central storeorinstall artifact AskUserQuestionsupports max 4 options per call — if more than 4 stale skills, chain a second call for the remainder- Do NOT fall back to a text table — the checkbox selector is the required UI for this phase
The user's checked selections become the confirmed removal list for Phase 5.
Phase 5 — Remove confirmed entries
Use OS-correct commands. For each confirmed item:
macOS / Linux:
# Symlink entry (Claude Code, Kiro, Pi, Kilo Code, Qwen Code)
rm ~/.claude/skills/<name>
# Full directory (central store or copy platform)
rm -rf ~/.agents/skills/<name>
rm -rf ~/.codex/skills/<name>
Windows (PowerShell):
# Symlink / junction
Remove-Item -Force "$env:USERPROFILE\.claude\skills\<name>"
# Full directory
Remove-Item -Recurse -Force "$env:USERPROFILE\.agents\skills\<name>"
Remove-Item -Recurse -Force "$env:USERPROFILE\.codex\skills\<name>"
Removal order: platform entries first, central store last.
After removal, re-run Phase 2 scans and confirm the entries are gone.
Gotchas
- Never remove the only installed version of a skill — if no replacement exists, keep it.
- Symlink platforms (
~/.claude/,~/.kiro/,~/.pi/agent/,~/.kilocode/,~/.qwen/): entries are symlinks,rmwithout-rfis sufficient on macOS/Linux;Remove-Item -Forceon Windows. - Copy platforms (
~/.codex/,~/.codeium/windsurf/,~/.gemini/config/): entries are full directory copies — remove from each platform dir independently, then from central store. - Pi path is
~/.pi/agent/skills/, not~/.pi/skills/— the extraagent/level is intentional. - Gemini CLI may install under multiple subdirs (
antigravity-backup/,antigravity-ide/,config/) — check all three. settings.jsonplugin entries: surface for human review only; do not auto-remove them.
What ships with it: 5 files
14.0 KB alongside SKILL.md, 1 of them executable
scripts/
- cleanup.mjsruns10.1 KB
- .gitignore32 B
- package.json337 B
- PLATFORMS.md3.1 KB
- skill.json468 B