From safe-delete
Prevents catastrophic file deletion by transforming rm to trash and blocking dangerous patterns. Use when discussing file deletion safety, rm alternatives, or trash utilities.
How this skill is triggered — by the user, by Claude, or both
Slash command
/safe-delete:safe-deleteThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Expert on safe file deletion practices using trash instead of rm.
Expert on safe file deletion practices using trash instead of rm.
rm -rf /, rm -rf ~, sudo rm -rftrash instead of rmStage 1: Block dangerous patterns
rm -rf /, rm -rf ~, rm -rf ., rm -rf *sudo rm -rf (any path)--no-preserve-root flagStage 2: Transform safe rm to trash
rm file.txt → trash file.txtrm -rf ./build → trash ./buildrm -r dir/ → trash dir/# Install trash (macOS)
brew install trash
echo 'export PATH="/opt/homebrew/opt/trash/bin:$PATH"' >> ~/.zshrc
# Install trash (Linux)
pip install trash-cli
# Check if a command would be blocked or transformed
/safe-delete check "rm -rf ./node_modules"
# Convert an rm command to trash
/safe-delete convert "rm -rf ./dist"
# List all blocked patterns
/safe-delete patterns
# Install trash utility
/safe-delete install
| Command | Risk | Recovery |
|---|---|---|
rm -rf ./build | Permanent deletion | None |
trash ./build | Moves to Trash | Easy restore |
rm -rf / | System destruction | Reinstall OS |
// Blocked (dangerous)
{
"decision": "block",
"reason": "Blocked dangerous command: 'sudo rm -rf' pattern detected."
}
// Transformed (safe)
{
"decision": "modify",
"modifiedToolInput": {
"command": "trash ./node_modules"
}
}
npx claudepluginhub zot24/skills --plugin safe-deleteWarns before destructive commands like rm -rf, DROP TABLE, force-push. Activates when user requests careful mode or safety mode. Useful for prod or shared environments.
Blocks destructive Bash commands like rm -rf, DROP TABLE, git force-push, reset --hard, and restricts file edits to a specific directory. Use for protection on critical systems.
Prevents destructive operations via three modes: cautious (warns on dangerous commands like rm -rf, git push --force, SQL drops), lockdown (restricts edits to one directory), and clear (removes restrictions). Uses PreToolUse hooks for Bash, Edit, and Write.