Safe Remove
Prevents Claude Code shell session breakage by enforcing mandatory working directory verification before recursive deletion commands.
The Safe Remove skill is a critical reliability utility designed to prevent unrecoverable shell failures within the Claude Code environment. By mandating a pre-delete checklist, it ensures that the AI agent never accidentally deletes its current working directory or an ancestor directory—actions that otherwise cause all subsequent bash commands to fail with a permanent 'Exit code 1.' This skill implements defensive patterns, such as explicit directory navigation and path verification, saving developers from the frustration of forced environment restarts during cleanup, refactoring, or build tasks.
Key Features
01Identification of dangerous shell operations before execution
02Mandatory pwd verification before rm -rf operations
0356 GitHub stars
04Prevention of unrecoverable 'Exit code 1' shell breakage
05Safe directory navigation patterns for recursive deletion
06Explicit guidance for absolute and relative path safety
Use Cases
01Automating cleanup scripts without risking terminal session stability
02Refactoring project structures that require directory removal
03Cleaning up temporary build artifacts or test directories safely