ncdu
$ ncdu Community Med Riskncdu scans directory trees in C and exports structured disk usage metadata when invoked with -o (-o scan.json or -o- for stdout) and -0 (no UI). Bare ncdu opens an interactive ncurses TUI that blocks non-TTY agents, so headless scripts must always pair -0 with -o.
brew install ncdu Exporting disk usage with ncdu -0 -o scan.json runs locally at C speed with zero MCP round-trips.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Headless -0 -o- emits valid JSON cleanly, but bare ncdu enters an interactive ncurses TUI that hangs non-TTY agent shells.
-0 -o-disables UI and streams JSON to stdout- Default invocation without
-oblocks in interactive ncurses mode
Supports -r / -rr read-only flags in TUI mode and -o exports are read-only scans, though interactive TUI allows deletion (d) if -r is omitted.
- Read-only
-rflag and-xfilesystem boundary guard
Available via brew install ncdu and virtually every Linux distribution, though not built for native Windows.
- POSIX ncurses dependency limits native Windows builds
Fast C/Zig scanner whose -o JSON export decouples scanning from analysis.
- Supports reusable JSON scan snapshots via
-oand-f
Long-standing MIT project maintained by Yoran Heling (ncdu v1 C and v2 Zig branches).
- Established upstream maintainer at dev.yorhel.nl
Complete online manual at dev.yorhel.nl/ncdu/man documenting -0, -o, -x, -r, and JSON schema.
- Official man page includes export format specification
Security, Auth & Guardrails
None required; scans local filesystems and optionally writes JSON export files.
100% free, offline, and open-source (MIT).
# ncdu Agent Rules - ALWAYS pass `-0 -o-` or `-0 -o <file>`—running `ncdu` without `-o` enters a blocking ncurses TUI. - Pass `-x` to avoid crossing mounted network shares or virtual filesystems like `/proc`.
Agent-Ready Command Recipes
Safe Read-Only Queries
ncdu -0 -x -o scan.json /path/to/dir
Disables TUI progress (-0), stays on one filesystem (-x), and writes a structured JSON scan to scan.json.
ncdu -0 -o- /path/to/dir
Emits the JSON scan tree to stdout (-o-) without creating any file or opening ncurses.
Strengths for Agents
- +
ncdu -0 -o-streams full directory size trees as structured JSON without opening ncurses. - + Supports
-xfilesystem boundary limits and-rread-only protection.
Caveats & Pitfalls
- ! Calling
ncduwithout-oopens a blocking ncurses TUI. - ! No native Windows binary;
gdu -n -o -is more portable if Windows support is required.