- 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.
disktree
Find what is filling a disk, mark what should go, and remove it — with the volume's free space in view the whole time.
disktree is a treemap for Omarchy. It scans your home directory by default, draws every directory as a nested mosaic sized by what it really costs on disk, and lets you walk into it with the keyboard or the mouse. Mark as much as you like; nothing happens until you review the list and commit, and the permanent path always asks first.
Built with GPUI through gpui-omarchy, so it follows your Omarchy theme and behaves like the rest of the desktop.
Install
git clone https://github.com/tobi/disktree
cd disktree
make install
make install builds a release binary and puts three things under ~/.local
(no root needed):
~/.local/bin/disktree- a desktop entry, so disktree is in the launcher and in a file manager's Open with for a directory (it adds a handler; it never becomes the default)
- an icon
sudo make install PREFIX=/usr/local installs system-wide; make uninstall
removes exactly what was installed.
You need Rust 1.97 or newer and a Wayland or X11 session with a GPU that GPUI can drive (Vulkan).
Use
disktree # scan the home directory
disktree ~/src # or any directory
disktree --help # options: apparent size, follow links, skip hidden, …
The screen
- Top: the scan totals on the left; on the right, what is measured — rank by Size or Files, Hidden files, Apparent size, and how many levels are drawn. Below it, the breadcrumb: click any part to go there.
- Middle: the treemap, using the full width of the window. Every directory that is drawn open keeps a band at its top with its own name and size, and its contents sit below that band — so a parent's name never covers a child, and pointing at the band selects the parent.
- Bottom: the tile you are acting on (name, path, size, its share of its directory and of the scan, Open, Mark for removal); then the marked total with Review…, the volume's free space now and after the marks, and how much of the tree could be read.
Marking
Space, X, Enter and the arrows act on the tile under the mouse if the mouse moved last, and on the keyboard selection after you use an arrow or Tab. The tile you mark is hatched in the danger colour. Marking is reversible — press it again — and a path inside a marked directory is shown as going with it, so the saving is never counted twice.
Zooming and going in
Scroll to magnify toward the pointer. The wheel magnifies until the directory
under the pointer fills the view, and the next notch goes into it — one
continuous motion, with the directory's contents growing into place. Scroll the
other way to come back out. Enter goes into the selected directory at any
depth, and Backspace or Escape goes up one level. + and - magnify without
going in; 0 resets.
Removing
c (or Review…) opens the list of everything marked. Unmark anything
there, then choose:
- Move to trash — the default when a trash is available (
trash-putfrom trash-cli, thengio trash, then a built-in XDG trash). Recoverable until the trash is emptied, so it commits directly. - Delete permanently —
rm -rfsemantics. It always asks first, in a dialog that names what goes and how much comes back.
When it finishes, disktree scans again so the numbers on screen match the disk, and shows how much free space was actually gained.
Keys
| key | does |
|---|---|
space / x |
mark or unmark the tile you point at |
ctrl-click |
mark without moving the selection |
enter |
open that directory, at any depth |
⌫ / esc |
go up one directory |
← ↑ ↓ → |
move between tiles at this level |
tab |
next largest sibling |
| scroll | zoom toward a directory, then go into it |
shift-scroll |
pan the magnified view |
[ ] |
draw fewer or more levels at once |
- = 0 |
magnify, shrink, reset the view |
ctrl = ctrl - ctrl 0 |
interface zoom |
/ |
find an entry by name |
c |
review the marked list |
t |
rank by size or by file count |
d |
disk usage or apparent size |
i |
include or skip hidden entries |
r |
scan again |
p |
show or hide the selection line |
? |
every key |
q |
quit |
On the review screen: m trash, p permanent, ! unmark all, enter
commits, esc goes back.
What it measures
- Disk usage by default:
st_blocks × 512, the numberdureports and the space that actually comes back when a file is deleted. Apparent size (whatls -lshows) is one toggle away. - Hardlinks once. Two names for one inode cost one file.
- Hidden entries included, because
~/.cacheis often the biggest thing in a home directory. Symlinks are not followed.
The scan follows dust's approach: one rayon scope per root, a completion counter per directory so no directory is built before its last subdirectory lands, and one bottom-up pass that aggregates sizes and removes duplicate hardlinks.
What it refuses to do
The removal rules live in crates/disktree-core/src/removal.rs, and each one is
tested:
- only paths under the scanned root can be removed;
- the filesystem root, the scanned root and your home directory are refused;
- a mount point is refused, since removing it would reach into another filesystem;
- a symlink is unlinked, never followed;
- nothing is passed through a shell — a file called
-rfis just a file.
On Hyprland
Hyprland tiles new windows, so disktree opens into whatever tile it is given. It is designed for a roomy window; float it, or give it a rule:
windowrule = float, class:^(disktree)$
windowrule = size 1400 900, class:^(disktree)$
Develop
make run # release build, scanning $HOME
make lint # rustfmt --check, then clippy with every warning an error
make test # scanner, layout and removal tests, plus window-harness tests
make ci # lint, then test
The lint gate is strict on purpose: clippy::all and clippy::pedantic are
errors, and every exception is written down with its reason in Cargo.toml.
The window-harness tests draw real frames and press real keys — including one
that marks a directory, confirms the deletion and checks that the files are
gone while their neighbours are not.
| path | what lives there |
|---|---|
crates/disktree-core |
scanning, the tree, the squarified layout, free space and removal — no UI |
crates/disktree-app/src/state.rs |
every action the interface can take, and the key map |
crates/disktree-app/src/views.rs |
the screens |
crates/disktree-app/src/treemap_view.rs |
painting the mosaic and its labels |
crates/disktree-app/src/ui.rs |
the spacing, type and size scale, in rem |
crates/disktree-app/src/tests.rs |
end-to-end tests through a real window |
packaging/, assets/, Makefile |
the desktop entry, the icon, and install |
The interface follows the
GPUI Kit design guides:
every size is on one rem scale so interface zoom keeps its proportions,
primary is reserved for what Enter does, and the only question the app asks is
the one it cannot take back.
License
MIT