Clean
Clean one repo or many repos (*-batch, skip list, dirty guard): scan, caches, build, git (prune/branch), stash (clear/drop old stashes), working tree…
от melodic-software★ 34 звезды на GitHub
Установить Clean в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Clean
Arguments. [scan|caches|build|git|stash|tree|all|<tier>-batch|aliases…] [--repo <repo> ...]. Bare → menu or auto-detect. The action list is context/action-router.md "Canonical actions". Repository-selection flags after the action pick a batch form's repos: --repo, --repos-from and --skip for every batch form and audit, --owner and --fleet for the §8 forms only.
Purpose
Return the repo toward a known-good state. Selective tiers (scan, caches, build, git, all) remove artifacts while preserving secrets, runtime deps, and skill data. tree is the destructive tier. reset --hard + clean -fdx, but safe-by-default: it preserves the same secrets / runtime-deps / skill-data classes unless you opt in via --include-deps / --include-secrets.
Machine-level listing (a whole home directory, not one repository) is /disk-hygiene:clean (if enabled) deep mode; this skill adds no scanner for it.
Bare invocation never mutates silently: resolve intent → dry-run → user confirmation → --apply. Full menu, aliases, and confirmation matrix: context/action-router.md.
Bundled-script invocation uses two deliberate forms. Paired ${CLAUDE_SKILL_DIR} in this file (matches allowed-tools) and interpreter-led <skill-dir> placeholders in routed context/*.md detail files. Rationale: reference/invocation-forms.md.
Arguments
$ARGUMENTS. Cleanup action or alias. Resolve first:
${CLAUDE_SKILL_DIR}/scripts/resolve-clean-action.sh $ARGUMENTS
When a leading action token is followed by free text, the resolver also emits a Note: <text> line. That note is advisory context you must address, a question to answer (e.g. "does this include stashes?") or a live-session constraint to honor (e.g. "6-7 live sessions, mind WIP"), not part of action selection. Surface it and act on it alongside the resolved action; never silently drop it.
Bare invocation (empty args)
- Infer from conversation (fresh pull →
tree, disk space →scan, …. See action-router). - If still unclear, present the action table from context/action-router.md and ask (Confirmation gate).
- Safest fallback:
scan.
Action table
| Action | Say it as… | Risk | Pre-flight? | In all? |
|---|---|---|---|---|
scan |
Show what's reclaimable | Safe | No | |
caches |
Clear tool and linter caches | Low | Yes | |
build |
Clear build output and logs | Low | Yes (includes caches) | |
git |
Prune stale git metadata; audit branches + stashes | Low | No | Yes |
stash |
Audit and triage stashes (age, source, diffstat) | Safe | No | |
tree |
Reset working tree like a fresh pull | Destructive | No (always dry-run first) | Never |
scan-batch |
Show what's reclaimable across many repos (skip-list) | Safe | No | |
tree-batch |
Reset many repos like a fresh pull (skip-list + dirty guard) | Destructive | No (always dry-run first) | Never |
all |
Sweep caches + build + git hygiene | Medium | Yes |
Tiers cumulative: build includes caches. all = build + git. Neither tree nor tree-batch is ever composed into all.
Fleet (batch) forms. Each selective tier has a multi-repo form. scan-batch, caches-batch, build-batch, git-batch, all-batch. That runs it across a repo set (§8); all but scan-batch sit behind one gate. scan-batch is read-only and has no gate. tree-batch is the destructive tier's separate batch form (§6.5).
Aliases (fresh, inventory, artifacts, caches-fleet, …): context/action-router.md.
What clean never touches by default
Protected-path enforcement gates scan, caches, build, git, and tree (tree honors the same classes by default). Full list: reference/cleanup-config.md.
- Secrets / config.
.env*,*.local.json/.jsonc/.md, IDE user config.treeremoves only with--include-secrets(unrecoverable). - Runtime dependencies.
node_modules/,.venv/,vendor/.treeremoves only with--include-deps(rebuildable). - Skill-owned
data/, user-generated synthesis, always preserved; no flag removes it.
tree requires explicit confirmation and is never auto-invoked. Any file tracked by git is reset via git reset --hard, not selective deletion, and any tracked file deleted by reparse-point traversal (junction/symlink into a tracked dir) is auto-restored.
Session-scoped destructive guard (frontmatter hook). A per-session run marker scopes the guard to the run, whatever the host does with the hook registration (lifetime: hooks in skills and agents): run marker is opened when a mutating tier starts (never for scan or `scan-bat
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Bash(${CLAUDE_SKILL_DIR}/scripts/resolve-clean-action.sh:*) - 02
Bash(${CLAUDE_SKILL_DIR}/scripts/scan.sh:*) - 03
Bash(${CLAUDE_SKILL_DIR}/scripts/preflight.sh:*) - 04
Bash(${CLAUDE_SKILL_DIR}/scripts/git-branch-audit.sh:*) - 05
Bash(${CLAUDE_SKILL_DIR}/scripts/git-stash-audit.sh:*)
Вложенные файлы
- context/action-router.md
- context/clean-batch.md
- context/git-branch-cleanup.md
- context/git-tree-reset-batch.md
- context/git-tree-reset.md
- context/preflight.md
- context/run-marker.md
- reference/cleanup-config.md
- reference/invocation-forms.md
- scripts/clean-batch.sh
- scripts/clean-batch.test.sh
- scripts/clean-build.sh
- scripts/clean-build.test.sh
- scripts/clean-caches.sh
- scripts/clean-caches.test.sh
- scripts/clean-run-marker.sh
- scripts/destructive-guard.sh
- scripts/destructive-guard.test.sh
- scripts/git-branch-audit.sh
- scripts/git-branch-audit.test.sh
- scripts/git-branch-delete.sh
- scripts/git-branch-delete.test.sh
- scripts/git-noninteractive.test.sh
- scripts/git-prune.sh
- scripts/git-prune.test.sh
- scripts/git-stash-audit.sh
- scripts/git-stash-audit.test.sh
- scripts/git-tree-reset-batch.sh
- scripts/git-tree-reset-batch.test.sh
- scripts/git-tree-reset.sh
- scripts/git-tree-reset.test.sh
- scripts/hook-utils.sh
- scripts/lib/batch-common.sh
- scripts/lib/batch-common.test.sh
- scripts/lib/clean-common.sh
- scripts/lib/cleanup-paths.sh
- scripts/lib/cleanup-paths.test.sh
- scripts/lib/git-noninteractive.sh
- scripts/lib/run-marker.sh
- scripts/lib/test-helpers.sh
FAQ
Что делает скилл Clean?
Clean one repo or many repos (*-batch, skip list, dirty guard): scan, caches, build, git (prune/branch), stash (clear/drop old stashes), working tree (fresh-pull reset), all; bare detects intent/menu; dry-run-first, confirm destructive. Use when: 'clean repo', 'stale branches', 'free up disk space'. Not for worktree dirs: use a worktree tool.
Как установить скилл Clean?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Clean запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…