Skip to content
Back to skills

Disk And Trash

ASecurity

Disk space and Trash mechanics. Load when disk space is low or a disk warning appears, when session scratch is over budget, before cleaning up worktrees or temp directories, and when a Trash review is due or the user asks about the Trash. Holds the disk thresholds, session temp and scratch registration, the worktree audit, the startup scratch sweep, the footprint line and the Trash review flow. The deletion rules themselves (Trash, never empty it, remote hosts) stay in the protocol.

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
developmentgo

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add poma-ai/megavibe --skill disk-and-trash --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Disk And Trash?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Disk And Trash
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/poma-ai-disk-and-trash/badge)](https://www.skillsdirectory.com/skills/poma-ai-disk-and-trash)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: disk-and-trash
description: Disk space and Trash mechanics. Load when disk space is low or a disk warning appears, when session scratch is over budget, before cleaning up worktrees or temp directories, and when a Trash review is due or the user asks about the Trash. Holds the disk thresholds, session temp and scratch registration, the worktree audit, the startup scratch sweep, the footprint line and the Trash review flow. The deletion rules themselves (Trash, never empty it, remote hosts) stay in the protocol.
---

# Disk space and the Trash: mechanics

The rules (ordinary deletions go to Trash, with the documented permanent managed-cleanup exceptions, never empty the Trash, a remote host has no Trash, a round is not done while its copies exist, the scratch budget) are in the protocol, `~/.claude/CLAUDE.md`, "Ordinary deletions go to Trash" and "Disk space is finite". This skill holds the mechanics.

Managed cleanup bypasses Trash: marked review copies have no age delay; session unit cleanup has no age delay for eligible attributed temp; session-end cleanup retains changes from the last hour; the orphan sweep defaults to 24 hours; verified worktree removal has no age delay. Short session temp and session scratchpad cleanup honor `.keep`, but review-copy removal and shared-temp registrations provide no general `.keep` guarantee. These helpers do not create Trash recovery copies. Preserve needed files elsewhere first. See README, **Permanent managed cleanup exceptions**, for ownership boundaries and limits.

## Disk warnings

`disk-check.sh` warns when free space is below the larger of 40 GB and 15 percent of the volume (`MEGAVIBE_DISK_WARN_GB` fixes the line; opt out with `MEGAVIBE_DISK_WATCH=0`): at session start, after every compaction, and about every 5 minutes of tool activity (`MEGAVIBE_DISK_CHECK_MINS`, 0 switches the mid-session check off; it needs perl), speaking once per level change.

Pytest and other tools that honor the default `TMPDIR` use the session’s short, budgeted temp directory when the SessionStart export succeeds. Use the session scratchpad for large items you place explicitly and register large items created directly under the shared temp base with `~/.megavibe/scripts/scratch-own.sh register PATH` (the SID comes from `CLAUDE_CODE_SESSION_ID`). When disk is low, first run `~/.megavibe/scripts/worktrees-audit.sh audit` to report what is big; `remove-safe` only touches clean, fully pushed, merged worktrees (or detached duplicates reachable from a remote ref), excluding locked, main and current ones, so review `remove-safe --dry-run` first.

## Startup scratch sweep and footprint

SessionStart also runs a bounded sweep of scratch from ended sessions. It keeps sessions it identifies as live, recent changes, and trees containing `.keep`. SessionStart registers custom Claude config directories for sweeps from other sessions. A custom directory outside normal discovery needs a SessionStart with the updated hook before another session can find it. A running `claude` process without a matching live record suspends session scratch cleanup, including for sessions started before their custom directory was registered. Damaged records, missing or unreadable registered config or sessions directories, and inconclusive process scans also suspend session scratch cleanup. The cutoff is 24 hours by default (`MEGAVIBE_SCRATCH_ORPHAN_HOURS=0` disables the sweep). Old, unopened numbered pytest run directories under the system temp's `pytest-of-<user>` directory are removed as a class because they are test fixtures by construction.

When a low-space warning appears at session start or after compaction, its footprint line shows how much used space on the boot volume is attributable to Megavibe. Run `~/.megavibe/scripts/disk-watch.sh footprint` to get the same estimate on demand. If a project is on another volume, the Megavibe launcher can place its session scratch on that volume.

## Trash review

**Trash arrival and review:** deterministic rules mark construction scratch safe/droppable; a queued worker copies backups and optionally sends only unsure metadata to subscription Haiku. Restore-candidates record suspected mistakes. Nothing is deleted or automatically restored. Only unresolved unsure/restore-candidate items count toward the 1024 MB threshold, or 100 MB with one older than seven days. `status` reports unresolved, queued, droppable and manually closed records; missing items on accessible volumes close quietly. Explicit attendance overrides payload and entrypoint inference; unattended runs stay quiet. Follow the hook's review steps for the unresolved remainder only, using its recorded reasons: group, ask per group, then apply restore / keep / backup / droppable. Emptying still requires the human-approved script or Finder.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.