safe-file-deletion

safe-file-deletion is a skill for Claude Code, Codex from MemTensor/MemOS. It costs 46 tokens per session (293 once invoked), scanned C, original, Apache-2.0.

A safety rule that requires explicit user permission before deleting files from disk.

In plain words
What is it for?
Use it whenever a task would delete one or more files, such as with rm, unlink, or file-removal APIs.
Why use it?
It prevents accidental or hidden file removal, including deletion performed by commands or scripts.

Skill for Claude CodeCodex

About the project

MemOS is a memory operating system that stores, retrieves, and manages long-term memory for large language models and AI agents. It supports context-aware interactions by organizing text, images, tool traces, personas, and knowledge bases for reuse across tasks.

MemTensor/MemOS · 11,188 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/memtensor/memos/safe-file-deletion
Any agent
npx skills add MemTensor/MemOS --skill safe-file-deletion
Clone the repo
git clone --depth 1 https://github.com/MemTensor/MemOS

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for safe-file-deletion

README.md
[![agentmods](https://agentmods.dev/badge/skills/memtensor/memos/safe-file-deletion.svg)](https://agentmods.dev/skills/memtensor/memos/safe-file-deletion)
Your own site
<a href="https://agentmods.dev/skills/memtensor/memos/safe-file-deletion"><img src="https://agentmods.dev/badge/skills/memtensor/memos/safe-file-deletion.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 293 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.00293
Opus 5 $0.00023 $0.00147
Sonnet 5 $0.00009 $0.00059
Haiku 4.5 $0.00005 $0.00029

Measured 5d ago against content hash 38cdb761ecfb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

safe-file-deletion scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `rm -rf` (directories)
apps/openwork-memos-integration/apps/desktop/skills/safe-file-deletion/SKILL.md · 51 lines

What it actually says

Safe File Deletion

Rule

Before deleting ANY file, you MUST:

  1. Call request_file_permission with operation: "delete"
  2. For multiple files, use filePaths array (not multiple calls)
  3. Wait for response
  4. Only proceed if "allowed"
  5. If "denied", acknowledge and do NOT delete

Applies To

  • rm commands (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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 51 lines · 46 tokens per session scan C 38cdb761ecfb

Subscribe to this mod's changes

safe-file-deletion is a skill published in the GitHub repository MemTensor/MemOS (11,188 stars, last pushed yesterday), licensed Apache-2.0. It adds 46 tokens to every session and 293 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.