Agent skill
safe-rm
Use safe-rm script instead of rm -rf. Prevents accidental deletion of protected system, config, and project paths.
Install this agent skill to your Project
npx add-skill https://github.com/beshkenadze/claude-skills-marketplace/tree/main/skills/utility/safe-rm
SKILL.md
Safe RM
Overview
Wrapper around rm -rf with safety checks. Use this instead of direct rm -rf commands.
When to Use
- Deleting directories or files recursively
- Any
rm -rforrm -roperation - Cleaning up temporary files/folders
Usage
# Dry-run (default) - shows what would be deleted
safe-rm /path/to/delete
# Actually delete (if path is not protected)
safe-rm --force /path/to/delete
safe-rm -f /path/to/delete
Protected Paths
The script blocks deletion of:
System: /, /bin, /boot, /dev, /etc, /lib, /opt, /proc, /root, /sbin, /sys, /usr, /var, /home, /Users
Home config: ~, ~/.ssh, ~/.gnupg, ~/.config, ~/.local, ~/.claude, ~/.zshrc, ~/.bashrc
Project: .git, git repository root
Exit Codes
0— success (or dry-run completed)1— path is protected2— path does not exist
Instructions for Claude
- NEVER use
rm -rfdirectly — always usesafe-rmscript - Run without
--forcefirst to preview what will be deleted - If path is protected, inform user and do not proceed
- Only use
--forceafter confirming dry-run output is correct
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
skill-with-scripts
A template for skills that include executable code for deterministic operations.
your-skill-name
Brief description of what this Skill does and when to use it. This field is critical for Claude to discover when to invoke your skill.
jis-accessibility
Use when auditing websites for Japanese accessibility compliance, checking JIS X 8341-3 conformance, or advising on Japan's Act for Eliminating Discrimination against Persons with Disabilities.
meeting-notes
Structure meeting transcripts into organized notes with action items, decisions, and key points. Use when processing meeting recordings or creating meeting summaries.
global-accessibility
Use when determining which accessibility law applies to an organization, comparing requirements across jurisdictions (US, EU, Canada, Japan), or planning multi-country accessibility compliance strategy.
aoda-compliance
Use when auditing websites or apps for Canadian accessibility law compliance, checking AODA (Ontario) or Accessible Canada Act (federal) requirements, or advising on CAN/ASC-EN 301 549 obligations.
Didn't find tool you were looking for?