/apogee:cleanup [<path inside the repo>] [--no-size]from apogee
Reclaim disk space that agent work leaves behind: linked git worktrees (of the repository and of every submodule), the stale records of worktrees deleted by hand, orphaned worktree directories, and the build directories (Rust target/, DerivedData) that make each copy 5–35 GB. Inventories first with a read-only script, deletes only what the user picks. Use when the disk fills up, when worktrees pile up after parallel agents, or when the user asks to clean up, tidy up or free space, in any language. Offered by the session-start reminder and by /apogee:finish.
Ships in apogee. 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.
Read when SKILL.md points to them; scripts run unread.
Agents that work in parallel each take a git worktree, and a worktree of a compiled project grows
its own build directory: a Rust workspace is 5–35 GB per copy. Nobody removes them when the work
is merged, and a directory deleted by hand leaves its record in git (prunable in
git worktree list). In a superproject every submodule has a gitdir of its own with its own list,
so the leftovers multiply. This skill finds all of it, says what is safe to delete and why, and
deletes only what the user picks.
Nothing is removed before the user has seen the inventory and chosen. Work that exists nowhere else (uncommitted changes, commits on no base branch or remote) is never removed by default.
bash "${CLAUDE_PLUGIN_ROOT}/skills/cleanup/scripts/inventory.sh" [--no-size] [<path>]
Read-only. Started anywhere inside the repository (a linked worktree or a submodule included), it
finds the superproject's main checkout and walks it and every initialised submodule. Sizes come
from du and take a minute or two on a large tree; --no-size skips them. Output is one
tab-separated line per entry: VERDICT SIZE PATH REF NOTE.
| Verdict | Meaning | Default action |
|---|---|---|
PRUNE | git records a worktree whose directory is gone | prune the record |
REMOVE | clean, every commit on develop/main/master or a remote, not used recently | remove |
KEEP | uncommitted changes, unpushed commits (its own, a submodule's inside it, or a nested worktree's), locked, or used recently: another session may be in it | leave; the note says why |
NESTED | a submodule worktree inside another listed worktree | goes with its parent, which already accounts for it |
ORPHAN | a directory in the repo whose .git file points at a gitdir that no longer exists | remove on request |
BUILD | a Rust target/ (next to a Cargo.toml) or DerivedData/ of the main checkout | report only |
Show the user a summary, not the raw output: PRUNE as one count, then every other entry with
its size, ref and note, largest first, and the total that the default actions would free. The
untracked files that make a worktree KEEP are often screenshots or build output; list them
(git -C <path> status --short | head -20) so the user can judge.
One AskUserQuestion, multi-select, built from what the inventory found (omit empty groups):
REMOVE worktrees, with their sizes (recommended).ORPHAN directories.KEEP worktrees, each named with what would be lost (its note). Offer one only after
the user has seen its untracked files or unpushed commits; never recommend one.BUILD directories: deleting one costs a full rebuild, and a concurrent agent may be building
into it. Offer only when the user asked for space beyond the worktrees.One state-changing command per step, each path named in full.
PRUNE notes:
git --git-dir=<gitdir> worktree prune -v.git -C <main checkout of its repo> worktree remove <path>. Without
--force git refuses a dirty tree, which is the safety net if something changed since the
inventory. A worktree that contains submodules is refused with "working trees containing
submodules cannot be moved or removed": re-run the inventory for it, confirm it is still
REMOVE, then delete the directory by its path and prune the superproject's gitdir and every
submodule gitdir that listed a worktree inside it.Re-run the inventory with --no-size to confirm the result, then report in a few lines: what was
pruned and removed, what was kept and why, and the space freed (df -h <volume> before and
after). Suggest nothing else unless asked.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mishagin-dev/apogee --plugin apogee20 skills in this plugin
/ai-clean-roomPersonal black-box clean-room skill: build an independent product that reproduces the functionality of a closed-source reference application using only its public documentation, observed behavior and screenshots, without copying its code, texts, icons, design or name. Manual invocation only (/apogee:ai-clean-room)./brOfficial skill for beads_rust (`br`), a local-first, dependency-aware issue tracker for AI agents. Use when creating issues, triaging backlogs, managing dependencies, finding ready work, updating status, or exporting the local JSONL backup (br sync --flush-only)./finishClose the unit of work /apogee:start opened, and the only way work is closed in an Apogee project. feature/bugfix: review, docs, public docs, clean tree, git-flow finish into develop, push develop. hotfix: review, then the release preparation (version, CHANGELOG, gate, notes) and the operator's commands. research: check the note is complete, mark it done, propose the follow-up. Detects the type from the current branch./git-commitThis skill should be used whenever creating a git commit or writing a commit message — when the user asks to "commit", "create a commit", "git commit", "write a commit message", "commit my changes", or "conventional commit". Generates a Conventional Commits message from the staged diff (falling back to all changes), validates it against strict rules, and creates the commit. Commit messages are always written in English. Applies only inside a git repository./git-flowDrive the installed git flow binary (AVH Edition) for Git Flow branching: init a repo, start/finish/publish feature and bugfix branches, cut and finish a release with tag and back-merge, ship a hotfix, or open a support branch. Use when asked to run git flow, start or finish a feature/release/hotfix, cut a release, tag a version, or initialize Git Flow. Applies only inside a git repository./initBootstrap a project's Apogee context: research the codebase, fill docs/apogee/ai-context and the root CLAUDE.md, seed a CLAUDE.md per first-level submodule. Run once per project, in Plan Mode.