Deletion Safety Gate — Fail-Closed Check Before rm -rf

    1

    A fully pushed checkout can still be the working directory an hourly job launches from.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Deletion Safety Gate — Fail-Closed Check Before rm -rf

    Example session with this skill installed

    My disk is almost full. Before deleting these old worktrees, run deletion-safety-gate on each path and only delete the ones it reports SAFE:
    ~/code/worktrees/checkout-redesign
    ~/code/worktrees/nightly-report
    ~/code/worktrees/old-spike

    • Read your context and instructions
    • Compiled the deletion safety gate

    deletion-safety-gate — 3 candidates, checked one at a time (read-only)

    1. ~/code/worktrees/checkout-redesign
      spellings: $HOME/code/worktrees/checkout-redesign | ~/code/worktrees/checkout-redesign | /worktrees/checkout-redesign
      loaded jobs: 0 | job files: 0 | crontab: 0 | config/scripts: 0 | processes: 0 | shared git store: not a hub
      → SAFE (git clean, 0 unpushed, recovery ref saved: refs/archive/checkout-redesign)

    2. ~/code/worktrees/nightly-report
      loaded jobs: 1 HIT — com.dev.nightly-report (WorkingDirectory=/worktrees/nightly-report, matched bare spelling)
      job files: 1 HIT — ~/Library/LaunchAgents/com.dev.nightly-report.plist.bak
      config/scripts: 1 HIT — ~/bin/run-report.sh:4
      → REFUSE (referenced by a live scheduled job; git status was clean, which is exactly why this check exists)

    3. ~/code/worktrees/old-spike
      config/scripts: could not read ~/.config/tooling/state.db (permission denied)
      → REFUSE (screen incomplete — fail closed)

    Deleted: 1 (checkout-redesign). Kept: 2.
    Next steps: retarget or unload com.dev.nightly-report before deleting #2; fix read access and re-run for #3.
    Not screened: open file descriptors, remote CI definitions, paths built at runtime.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    Clean git history proves a folder's history is safe to lose — not that nothing still uses the path. A fully pushed checkout can still be the working directory an hourly job launches from. Deletion Safety Gate makes your coding agent prove a path is unreferenced before it deletes it.

    It searches every place a path can be referenced, in three spellings (absolute, ~/-relative, and bare /<parent>/<basename>), across five screens:

    • Loaded scheduled jobs — the live state, which can differ from the file on disk
    • Job definitions on disk — crontab, timer/service units, and their backups
    • Config and scripts — JSON/YAML/TOML/shell files that hold the path as a string
    • Running processes — argv, including processes running from deleted files
    • Shared object stores — git "hub" checkouts other worktrees depend on

    The verdict is strictly SAFE or REFUSE. Any hit, any screen that can't finish, a nonexistent path, your home dir or root, or a protected folder is REFUSE. "I couldn't tell" never becomes SAFE. The skill itself never deletes, moves or writes anything.

    It also has an audit mode that finds config paths already pointing at nothing, ranked by how live the consumer is (loaded job first, doc rot last), and it names its own blind spots (open file descriptors, remote CI, runtime-assembled paths).

    When to use it

    • Before deleting, pruning or reclaiming disk from worktrees, clones, caches or "stale" build dirs
    • Before a bulk cleanup across many candidate folders (one path at a time, never batch-SAFE)
    • As a periodic audit for config paths that no longer exist

    What's inside

    • SKILL.md — the method, the five screens, the fail-closed contract, a stdlib-only Python reference sketch (spellings, process screen, config-surface screen, gate), a per-path shell loop, audit-mode ranking, declared gaps, and install/invoke examples. Works with Claude Code and any agent that loads SKILL.md skills.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 19 days ago

    Requires

    Git

    Permissions

    Terminal / Shell
    Listed19 days ago
    Updatedtoday

    What's inside

    Frequently Asked Questions

    A read-only, fail-closed check your agent runs before deleting any worktree, clone, cache or build folder. It screens scheduled jobs, crontab, config files, running processes and shared git object stores for references to the path, and returns SAFE only when every screen finishes with zero hits.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Deletion Safety Gate — Fail-Closed Check Before rm -rf on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in DevOps & Cloud