Guide · Agent skill
How to use the Safe File Deletion agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Safe File Deletion skill (skill name: safe-file-deletion) is a set of instructions for an AI agent. Once it is installed, the agent must ask you for permission before it removes any file from your computer, whether it uses rm, unlink, fs.rm, or another tool that deletes files. This guide explains what the skill does, how to install it, how to trigger it, and what to check before relying on it.
Quick start
- 1Download the ZIP. Download the safe-file-deletion ZIP from this page.
- 2Unzip the skill. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project.
- 3Or upload it in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
- 4Confirm your host provides the permission tool. Make sure your environment has a request_file_permission tool, since the skill relies on it.
- 5Ask for a task that deletes files. Give your agent a cleanup request. The skill applies when a deletion comes up.
- 6Answer the prompt. Approve or deny each deletion request. Only approved files are removed.
What does the Safe File Deletion skill make an agent do?
The skill is a rule the agent is asked to follow before any delete operation. Before deleting any file, the agent calls a permission request tool named request_file_permission with operation set to "delete", waits for your response, and proceeds only if the answer is "allowed". If the answer is "denied", the agent should acknowledge that and not delete the file.
The rule applies to rm commands (single or multiple files), rm -rf for directories, unlink, fs.rm, fs.rmdir, and any script or tool that deletes files. For several files, the agent is told to send one request with a filePaths array instead of making separate calls, so you see a single prompt.
- Single file: the agent sends one request with a filePath.
- Multiple files: the agent sends one request with a filePaths array, which shows as one batched prompt.
- Denied: the agent acknowledges the denial and leaves the file in place.
{
"operation": "delete",
"filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"]
}How do you install the Safe File Deletion skill?
Download the ZIP file for the skill from this page. Then choose one of the following ways to install it, depending on where you run your agent.
For a personal setup, unzip the download into your ~/.claude/skills/ folder. To limit the skill to one project, unzip it into that project's .claude/skills/ folder instead. In the Claude apps, you can also upload the ZIP under Settings → Capabilities → Skills.
- Personal: unzip into ~/.claude/skills/
- Single project: unzip into the project's .claude/skills/ folder
- Claude apps: upload the ZIP under Settings → Capabilities → Skills
What does the skill need to work?
The skill depends on the host environment providing a request_file_permission tool. The SKILL.md file assumes this tool exists, but the skill package does not include it. If your agent environment has no such tool, the skill has nothing to call and will not provide the approval step.
The package contains only SKILL.md. According to the source, it does not run scripts and does not use the network.
- A host environment that provides request_file_permission
- No scripts are included or run
- No network access is used
How do you trigger the skill with natural requests?
The skill activates when the agent is about to use rm, unlink, fs.rm, or any operation that removes files from disk. You do not need a special command. Ask your agent for a task that involves cleaning up, and the skill applies whenever a deletion comes up.
Requests such as the following will involve deletion, so the skill should apply:
- "Clean up the build output folder in this project."
- "Remove the old log files from the logs directory."
- "Delete the duplicate images in my downloads folder."
- "Tidy up the temp files this script created."
What happens when you approve or deny a deletion?
When the agent reaches a deletion, it pauses and sends a permission request. The source says the user will see a prominent warning, and the agent must wait for explicit approval. Nothing is deleted until you approve.
If you deny the request, the agent should say so and leave the file alone. The agent should not try to get around your answer.
- Approve: the agent deletes the file or files.
- Deny: the agent acknowledges and does not delete.
- No answer: the agent waits, so unattended runs may stall.
What tricks does the skill block?
The skill tells the agent not to bypass the check. The agent should not empty files instead of deleting them, move them to hidden or temp locations, or use obscure commands to achieve the same result.
These rules are instructions the agent is asked to follow. They are not an enforced technical control, so they work only if the agent and host app honour them.
- Do not empty a file in place of deleting it.
- Do not move files to hidden or temp locations.
- Do not use obscure commands to remove files.
What people use it for
- Cleaning up build or temporary output in a project while keeping an approval record of each deletion.
- Tidying log or download folders without risking the wrong files being removed.
- Running an agent in a project where deleted files would be hard to recover, with a human check before each removal.
- Requiring one visible approval for a batch of files, using a single filePaths request.
Frequently asked questions
What is the safe-file-deletion skill?
It is an agent skill that tells an AI agent to request your permission before deleting any file. The agent calls request_file_permission, waits for your answer, and deletes only if you approve. It is licensed under Apache-2.0.
How do I install the Safe File Deletion skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
What does the skill require to work?
Your host environment must provide a request_file_permission tool, because the SKILL.md assumes it exists and the package does not include it. The package runs no scripts and uses no network.
Will the agent still delete files without asking?
The skill tells the agent to wait for an "allowed" response before deleting. It is an instruction the agent is asked to follow, so it works only if the agent and host app honour it.
Is the skill a hard security boundary?
No. The source describes it as an instruction rather than an enforced technical control. Do not rely on it alone to protect important data; keep your own backups.
Can I use this skill for unattended automation?
Not well. Every deletion waits for a human response, so an unattended agent may stall while it waits for your answer.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you want an approval step before an agent removes files, especially in projects where deletions are hard to undo. Pick something else if you need fully unattended automation or a technical guarantee that files cannot be deleted, since this skill is an instruction the agent must follow rather than an enforced control.
Download the skill