← 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.** Use `<repo-root>/docs/checkpoints/` if a `.git` is found in cwd or any parent; otherwise `~/.claude/checkpoints/`. If it 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, target the rest (mode: `keep-last`). - **anything else** → treat as a filename (with or without `.md`). Exact match only — if the file is not found, report and stop, never silently widen (mode: `name`). 3. **Print the target list.** One line per file: name, mtime, size. End with the total count and the parsed mode (e.g. `