safe-file-deletionClaude Skill
Enforces explicit user permission before any file deletion.
6.2k Stars
568 Forks
2025/07/06
| name | safe-file-deletion |
| description | Enforces explicit user permission before any file deletion. Activates when you're about to use rm, unlink, fs.rm, or any operation that removes files from disk. MUST be followed for all delete operations. |
Safe File Deletion
Rule
Before deleting ANY file, you MUST:
- Call
request_file_permissionwithoperation: "delete" - For multiple files, use
filePathsarray (not multiple calls) - Wait for response
- Only proceed if "allowed"
- If "denied", acknowledge and do NOT delete
Applies To
rmcommands (single or multiple files)rm -rf(directories)unlink,fs.rm,fs.rmdir- Any script or tool that deletes files
Examples
Single file:
{ "operation": "delete", "filePath": "/path/to/file.txt" }
Multiple files (batched into one prompt):
{ "operation": "delete", "filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"] }
No Workarounds
Never bypass deletion warnings by:
- Emptying files instead of deleting
- Moving to hidden/temp locations
- Using obscure commands
The user will see a prominent warning. Wait for explicit approval.
Similar Claude Skills & Agent Workflows
healthcheck
267.6k
Host security hardening and risk-tolerance configuration for OpenClaw deployments.
1password
267.6k
Set up and use 1Password CLI (op).
feishu-perm
267.6k
Feishu permission management for documents and files.
idapython
5.1k
IDA Pro Python scripting for reverse engineering.
webhook-signature-validator
1.0k
Validate webhook signature validator operations.
bearer-token-validator
1.0k
Validate bearer token validator operations.