remove_dir_all crosses mount boundaries, so permanently deleting a marked
directory emptied anything mounted below it (sshfs, NFS, a USB disk, a
bind mount) before failing with EBUSY on the mount point. A one-filesystem
scan never shows that content, so it was data the user never saw.
The plan now refuses a target with a mount point beneath it, and the
removal walks the tree itself with openat(O_NOFOLLOW), stopping at a
directory on another device or mount (statx mount ID, which also sees
same-filesystem bind mounts).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- scan: spawn_with takes a Known subtree and reuses it where the walk
reaches it, so widening from ~ to / reads only what is outside ~.
- filter: which nodes match a name, ignoring ASCII case without
allocating. Matches are kept whole; their ancestors are kept sized by
what matched beneath them.
- treemap: layout_filtered lays out only what a filter keeps.
- classify: a category per node (code, agent scratch, toolchains, synced,
git, media, documents, cache) from names and shapes — a bare repository
is git whatever it is called — and a reclaim reason for caches, sync
history, package stores and build output beside its manifest.
- insights: "worth a look", the largest findings that never nest:
reclaimable space, agent worktrees, experiments untouched for a month.
- nodes carry their newest write time, rolled up by aggregate.
- space: a mount-table model of a volume. One volume is one mount source,
so btrfs subvolumes (/home, /var/log) stay in and /proc, tmpfs, /boot,
network shares and automount points stay out, checked by path so a NAS
is never mounted to be measured. Staying on the volume is now the
default; volume_root finds the disk a home directory lives on.
- removal: system trees (/usr, /etc, /var/lib, /nix/store, …) are refused.
- treemap: wider gaps between top-level directories, full name bands only
at the first level and a slim label row below it.
- scan: dust's approach — one rayon scope, a +1 completion counter per
directory, bottom-up aggregation — with live progress and cancellation.
Disk usage by default, hardlinks counted once, symlinks not followed.
- tree: nodes with derived totals; aggregate() is the single source.
- treemap: squarified layout in viewport pixels, a name band per
subdivided directory, and crumbs that always address the scanned tree.
- space: statvfs, and the projection after removing marked bytes.
- removal: guarded plans (root, home, scanned root, mount points and
paths outside the root are refused), rm -rf semantics without a shell,
and trash via trash-put, gio or a built-in XDG implementation.