# Safety and deletion (/docs/concepts/safety)

What kuizer checks before it removes anything, which paths it never touches, and how permanent deletion and the optional trash mode work.

Scanning never deletes. Deletion is a separate step that revalidates every item first.

## Checks before every removal [#checks-before-every-removal]

Before each removal kuizer confirms that the item:

- is the directory it scanned, not a symlink or a mount point,
- sits inside a scanned root,
- is not your home directory or a system directory.

## Permanent by default [#permanent-by-default]

Deletion is permanent unless you opt in to the trash. In the terminal, a confirmation shows the item count and total size first. Set `delete.confirm = false` in the [config file](/docs/configuration) to skip it in the terminal UI; `review` items and projects with uncommitted changes always ask. When a selection contains `review` items, the CLI asks you to type the item count. The desktop app shows the same totals in a bar while items are selected and deletes them as soon as you press Delete.

## Trash mode [#trash-mode]

Set `delete.mode = "trash"` in the config file, or turn on "Move to the trash" under Settings > Deleting in the desktop app, which writes the same key. Project artifacts and global caches then move to the trash, and `kuizer restore` puts a run back. Trashed items free space only once the trash is emptied. `kuizer restore` works on Linux and is not supported on macOS.

Every run is logged in both modes, and `kuizer history` lists them.

## Safe and review [#safe-and-review]

Every result is marked `safe` or `review`. Anything found inside a hidden folder of your home directory is `review`, never `safe`. So are toolchain versions a project pins, Docker volumes and containers that stopped in the last 24 hours. `kuizer clean` selects `safe` items unless `--select all` says otherwise.

Projects with uncommitted git changes get a warning in the list and in the delete confirmation.

## What is never entered [#what-is-never-entered]

- Browser and app profiles: Chrome, Brave, Firefox, Edge and Electron apps such as Discord, Slack and VS Code.
- `~/.ssh`, `~/.gnupg` and the keyrings.
- Globally installed tools and editor extensions, such as `~/.vscode/extensions` and the pnpm, bun and yarn global installs.

## What never goes to the trash [#what-never-goes-to-the-trash]

Toolchains, Docker objects and git branches are removed for good in either mode, and the confirmation, or the summary bar in the desktop app, says so.

| Command | What goes | How |
| --- | --- | --- |
| `kuizer toolchain --clean` | Toolchain versions | `rustup toolchain uninstall` and `uv python uninstall`, or the version folder is deleted |
| `kuizer docker --clean` | Images, containers, build cache, volumes | The engine's own `image rm`, `container rm`, `builder prune` and `volume rm`, without force |
| `kuizer git --gc` | Loose objects | `git gc` |
| `kuizer git --branches` | Merged local branches | Each deleted branch is printed with the `git branch NAME COMMIT` line that brings it back |

A tool downloads a removed toolchain again when it is needed. A removed image or volume is gone.

## Duplicates [#duplicates]

`kuizer duplicates` only reports. You choose which copy to keep and remove the others yourself.
