# Nj Safe Delete

Move files and folders to the operating system's recycle bin instead of permanently deleting them, ensuring they can be restored. This applies to all deletions, including build output, caches, and temporary files.

**Canonical URL:** https://skillshunter.net/skills/discovered-9a7befbaf9aab3482b55f1d1fcb5815a60a53ac0468c537e

**JSON URL:** https://skillshunter.net/api/public/v1/skills/discovered-9a7befbaf9aab3482b55f1d1fcb5815a60a53ac0468c537e

**Markdown URL:** https://skillshunter.net/skills/discovered-9a7befbaf9aab3482b55f1d1fcb5815a60a53ac0468c537e.md

**Instructions download URL:** https://skillshunter.net/skills/discovered-9a7befbaf9aab3482b55f1d1fcb5815a60a53ac0468c537e/download

**Category:** Software & Development

**Source URL:** https://github.com/NJ-Burrito/NJ-Kit/blob/2644ffdccb94c9eb0a65b23624abe9795e005faa/nj-kit/bundled/nj-safe-delete/SKILL.md

**Source commit:** 2644ffdccb94c9eb0a65b23624abe9795e005faa

**Listing approved at:** 2026-11-29

**Created at:** 2026-11-28T18:51:24.000000Z

**Updated at:** 2026-11-29T10:53:27.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Before using this tool, ensure the file or folder name does not contain percent-escaped characters (e.g., `QA%20Engineer`), as the recycle-bin API may fail to recognize them. If renaming is required, use `Rename-Item -LiteralPath` and verify the renamed path before proceeding.

### When to use it

- Deleting build output and caches
- Removing stale or orphaned files
- Deleting temporary files created during a session
- Moving files to the recycle bin on Windows or other OS platforms

## Skill instructions

---
name: nj-safe-delete
description: 'Delete files and folders to the operating system''s recycle bin instead of destroying them, so anything removed can be restored. Use for every deletion: rm, Remove-Item, del, fs.rm, shutil.rmtree, cleanups, delete the stale artifacts, remove that folder.'
---

# Nothing is deleted permanently

**Every deletion goes to the recycle bin.** Not `rm`, not `rm -rf`, not
`Remove-Item`, not `shutil.rmtree`, not `fs.rmSync` — those destroy, and a
destroyed file that turns out to have been wanted is not a mistake that can be
apologised away.

```bash
python ~/.claude/skills/nj-safe-delete/scripts/trash.py <path> [path...]
```

It moves each path to the OS recycle bin and prints what it moved. On Windows it
uses the Shell API, so the items appear in the Recycle Bin with **Restore**
available exactly as if a person had deleted them from Explorer.

## When this applies

Always. Including — especially — the cases that feel safe:

- build output, caches, intermediates, "regenerable" files
- stale copies after a move or a rename
- folders you created yourself earlier in the same session
- anything described as "temporary", "orphan" or "unused"

"It can be regenerated" is not a reason to destroy it. Regenerating costs
minutes; the judgement that it *was* regenerable can be wrong, and then the cost
is unbounded. 4.1 GB of video intermediates were destroyed on that reasoning
before this rule existed.

## The exceptions, and they are narrow

- **Overwriting a file you are rewriting** — writing to a path is not deleting.
- **Scratch files in the session's own temp directory**, created and discarded
  within one task and never seen by the user.
- **The user explicitly says to destroy it permanently**, in those terms.

Anything else: recycle bin.

## If the recycle bin is not available

Network drives, some containers and most CI machines have none. Then **move the
path aside instead of deleting it** — a sibling `.trash/` directory with a
timestamp — and say so, so the user knows where it went and that it still
exists:

```bash
python ~/.claude/skills/nj-safe-delete/scripts/trash.py --fallback-dir .trash <path>
```

## A name with `%` in it, or "nothing moved"

The shell's recycle-bin API decodes percent-escapes, so a folder literally named
`QA%20Engineer` is read as `QA Engineer` — a *different* folder — and the call
refuses ("nothing moved" / "the specified path is invalid"). Never retry with
another API that might succeed on the decoded name. Rename the item to a plain
name first (`Rename-Item -LiteralPath`), check the renamed path holds what you
expect, then recycle that.

If the rename itself says access denied / in use while no file is locked, a
process holds a directory handle (a watcher, not an open file). Find it before
guessing: enumerate this user's handles and match the path (2026-10-16 it was
PDFgear's `FileWatcher.exe`, which watches the folder of every PDF opened in
PDFgear). Stop that process, then rename and recycle.

## Say what you removed

A deletion is reported like any other change: what was removed, how much of it,
and where it can be recovered from. "Cleaned up" is not a report.

