heft
Fast disk usage scanner with mtime tracking. Indexes a directory tree into an LMDB database, then queries it instantly.
Similar to duc, but faster — heft parallelizes filesystem stat calls across a thread pool and writes results in batched LMDB transactions.
Install
Usage
# Index a directory
# Index without crossing filesystem boundaries
# Exclude paths
# Show summary
# List a directory (sorted by size, largest first)
# Export as JSON
Options
| Flag | Description |
|---|---|
-d, --database <path> |
Database path (default: ~/.heft.db) |
--threads <n> |
Worker thread count (default: all cores) |
--one-file-system |
Don't cross mount boundaries |
--exclude <pattern> |
Exclude paths containing <pattern> |
--exclude-from <file> |
Read exclude patterns from file |
-v, --verbose |
Print each file as it's scanned |
Database
heft stores results in LMDB at ~/.heft.db. The database is always re-generable via heft index, so it uses WRITE_MAP + MAP_ASYNC flags for speed (no fsync). Override the path with -d.
See also
- docs/architecture.md — how heft works internally
- docs/benchmarks.md — performance notes and profiling