Workspace Trash
name: workspace-trash
by crewhaus · published 2026-03-22
$ claw add gh:crewhaus/crewhaus-workspace-trash---
name: workspace-trash
description: Soft-delete protection for workspace files. Intercept file deletions and move them to a recoverable trash instead of permanent removal. Use when deleting, removing, or cleaning up files in the workspace. Triggers on /trash, /trash:view, /trash:empty, /trash:restore, or any file deletion request. Also use when the agent needs to rm/delete/remove any file — always trash instead of permanently deleting.
requiredBinaries:
- node
- mv
- cp
- rm
- find
- awk
- date
- basename
- dirname
---
# Workspace Trash
Never permanently delete workspace files. Always use trash instead of `rm`.
Dependencies
Configuration
| Variable | Default | Description |
|---|---|---|
| `OPENCLAW_HOME` | `$HOME/.openclaw` | OpenClaw root directory. Only files under this path can be trashed. |
| `OPENCLAW_WORKSPACE` | `$OPENCLAW_HOME/workspace` | Primary workspace directory. Trash lives at `$OPENCLAW_WORKSPACE/.trash/`. |
These variables are standard OpenClaw environment variables and are typically already set. The script uses safe defaults if unset.
Slash Commands
Script
bash skills/workspace-trash/scripts/trash.sh <action> [args...]Actions: `move`, `list`, `restore <id|index>`, `empty`, `size`
Security
Destructive Operations
Rules
1. **NEVER use `rm` or `rm -rf` on OpenClaw files.** Always use the trash script's `move` action instead.
2. When asked to delete/remove/clean up files, use `trash.sh move <path>` — not rm.
3. Before emptying trash, always confirm with the user and show what will be deleted.
4. The trash lives at `.trash/` in the primary workspace root. A `.manifest.json` tracks original paths for restoration.
5. **Scope: any file under `~/.openclaw/`** — primary workspace, agent workspaces (`workspace-*`), and other OpenClaw directories. The script refuses paths outside `~/.openclaw/`.
6. **Cross-filesystem support:** Agent workspaces may be on different mounts. The script uses `cp -a` + `rm` as a fallback when `mv` fails across filesystems. Restore also handles cross-filesystem moves.
7. Restore by index number (from list) or by trash name. Items from agent workspaces show `[agent]` tag in list view.
8. When multiple files are being deleted, pass them all in one command: `trash.sh move file1 file2 dir1`
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...