Recoverable delete
- A turn, a scheduled task or a background run deletes
- The shim (rm, find, git, Python, Node) moves the file
- Into that run's trash on the machine where the file was
Which run a deletion belongs to
| Work | Trash folder |
|---|---|
| Bound explicitly | bind_trash_scope(owner, run, …) wins over everything below |
| Conversation turn | trash/<session>/<turn> |
| Background execution | The execution id of the run doing the work |
| Scheduled task | trash/task-<id>/run-<time>-<n>; a watch check uses watch-<time>. Bound in runtime/scheduler/worker.py. |
| Claimed job | trash/job-<id>/… |
| File panel on an SSH project | trash/files/<project key> on that host |
| Nothing bound | No shims; the command runs as typed |
Each run folder holds manifest.jsonl, items/ and origin.json (kind, task id, title, machine, container). The format is the same on every machine.
Where the shims run
| Machine | How |
|---|---|
| This computer | A PATH folder with rm, rmdir, unlink (Python), and find and git (shell that only starts Python for -delete and clean); sitecustomize for Python; a Node preload that also updates ES module exports |
| Docker container | The command is prefixed with a POSIX shell prelude that installs remote_delete.sh once per version. The trash is a folder of this computer mounted at its own path, so it outlives the container and lists with the local trash. |
| SSH host | The same prelude; the trash is $HOME/.openprogram/trash on the host. openprogram trash list --machine and restore --machine run through the SSH backend. |
The prelude needs sh, cat, mv, od and awk. Python and Node on the remote side call the shim's rm and rmdir.
Measured shells and images
| Where | Result |
|---|---|
| dash, bash, zsh, ksh, sh | rm, rmdir, unlink, find -delete and git clean all land in the trash and restore |
alpine:latest | BusyBox ash looks commands up on PATH, so its applets are shimmed; a nested sh -c too |
ubuntu:24.04 | dash; caught and restored inside the container, /tmp included |
python:3.12-slim | os.remove and shutil.rmtree caught through the remote sitecustomize |
Not caught
| Bypass | Why |
|---|---|
/bin/rm, busybox rm | An absolute path or a multiplexer skips PATH. Rewriting command text would break legitimate scripts. |
rsync --delete | rsync deletes inside its own process. --backup-dir would keep copies but no per-file record to restore from. |
| Overwriting | >, truncate and mv onto a file change content, not existence. Edits by the file tools keep their own file history. |
| Direct system calls | Compiled programs, python -I or -S, and Node without the preload call unlink themselves |
| git aliases for clean | Only the clean subcommand is read |
| Quoted paths in remote git clean | The shell shim refuses them instead of guessing; this computer decodes them |
| fish or csh as SSH login shell | The prelude is POSIX shell |
One-shot docker run | Only conversation containers get the trash mount |
The Sandbox cannot close these gaps. Seatbelt and bubblewrap allow or deny unlink by path; denying it breaks git locks, editors and build tools, and allowing it keeps nothing. seccomp sees no paths.
Retention and opting out
| Setting | Effect |
|---|---|
execution.trash_retention_days | 30. A run folder goes once nothing was written to it for that long; 0 keeps it. |
execution.trash_max_mb | 5120. Oldest runs go first while the trash is larger; 0 is no limit. The run starting now is never removed. |
execution.native_delete | false. When on, commands delete for good. |
openprogram trash clean | Applies both limits now |
Pruning runs when a run's trash is prepared, at most once an hour. An SSH host prunes by age once a day in the prelude.
Choices and their source
| Choice | Source |
|---|---|
| On by default, one switch to turn off | MiniMax Agent: permission.nativeDelete is false by default and deletions go to the system trash |
| 30 days by age | Claude Code keeps checkpoints for cleanupPeriodDays, 30 by default |
| A size bound | An operating system's trash empties oldest first when it fills |
| Our own trash, not the system's | Containers and SSH hosts have no system trash, and a per-run manifest lets one run be listed and restored as a unit |
Implementation status
Everything above is implemented: openprogram/host/sandbox/recoverable_delete.py, remote_delete.py, trash_retention.py and shims/remote_delete.sh. The user page is Deleted files.
Last updated · 2026-11-30