Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

ncdu

$ ncdu Community Med Risk
Yoran Heling · Files & Search · MIT · macos / linux

ncdu 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.

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
brew install ncdu
CLI vs MCP Decision CLI Only

Exporting disk usage with ncdu -0 -o scan.json runs locally at C speed with zero MCP round-trips.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 17 / 25

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 -o blocks in interactive ncurses mode
Trust & Safety 21 / 25

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 -r flag and -x filesystem boundary guard
Setup & Portability 12 / 15

Available via brew install ncdu and virtually every Linux distribution, though not built for native Windows.

  • POSIX ncurses dependency limits native Windows builds
Utility & Efficiency 13 / 15

Fast C/Zig scanner whose -o JSON export decouples scanning from analysis.

  • Supports reusable JSON scan snapshots via -o and -f
Maintenance & Lineage 7 / 10

Long-standing MIT project maintained by Yoran Heling (ncdu v1 C and v2 Zig branches).

  • Established upstream maintainer at dev.yorhel.nl
Docs & Verifiability 8 / 10

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

Auth Modes
No Auth
Credential Storage

None required; scans local filesystems and optionally writes JSON export files.

Side Effects
Read-Only Local Write Destructive
Cost & Quotas

100% free, offline, and open-source (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Export single-filesystem disk usage to JSON headlessly
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.

Stream JSON disk usage directly to stdout
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 -x filesystem boundary limits and -r read-only protection.

Caveats & Pitfalls

  • ! Calling ncdu without -o opens a blocking ncurses TUI.
  • ! No native Windows binary; gdu -n -o - is more portable if Windows support is required.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI