← ClaudeAtlas

checkpoint-prunelisted

Delete checkpoints — by name, by age, or interactively. Reports what was removed. Use to clean up docs/checkpoints/ when old snapshots have stopped being useful. /resume --list is the read-only counterpart.
PHPCraftdream/cc-arch-hands · ★ 1 · Data & Documents · score 74
Install: claude install-skill PHPCraftdream/cc-arch-hands
# checkpoint-prune Companion to `/checkpoint`. Removes checkpoint files from the same directory `/checkpoint` writes into. ## Usage ``` /checkpoint-prune # no arg → delete ALL checkpoints (asks to confirm) /checkpoint-prune 14d # delete files older than 14 days /checkpoint-prune 48h # delete files older than 48 hours /checkpoint-prune 10 # keep the 10 most recent, delete the rest /checkpoint-prune pre-refactor # delete one named checkpoint /checkpoint-prune --dry <arg> # report only, never delete (works with any of the above) ``` ## Behavior 1. **Locate the directory.** From the caller's original working directory, run `git rev-parse --show-toplevel`. If it succeeds with a non-empty path, use that path as `<repo-root>` and target `<repo-root>/docs/checkpoints/`. **If the command fails or returns an empty path (caller is outside any Git repository), refuse and stop** — checkpoints are project-scoped; never target `~/.claude/checkpoints/` or any other path shared across projects/agents. If the resolved directory doesn't exist, say so and stop. 2. **Resolve the selection** by parsing the argument in this order — the **first rule that matches wins**: - **no argument** → target every checkpoint (mode: `all`). - **digits followed by `d` or `h`** (e.g. `14d`, `48h`) → target every file whose mtime is older than `now - N` (mode: `older-than`). - **digits only** (e.g. `10`) → sort by mtime descending, keep the first N