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

tree

$ tree Community Low Risk
Steve Baker (OSS) · Files & Search · GPL-2.0 · macos / linux / windows

tree renders hierarchical directory layouts with minimal setup. For AI agents, -J emits a clean nested JSON tree, -L caps recursion depth, and --gitignore / -I filter out node_modules and build artifacts.

FCRS-1.0 Score
91 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install tree
CLI vs MCP Decision CLI Preferred vs MCP

Running tree -J -L 3 directly in the shell gives an instant JSON directory map with zero MCP overhead.

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 23 / 25

Supports native -J JSON output, -n color suppression, --noreport, and non-interactive stdout.

  • Native -J JSON format and -n plain output flags
Trust & Safety 25 / 25

Purely read-only local directory listing; never writes files or accesses the network.

  • Zero write or network side effects
Setup & Portability 14 / 15

Packaged in nearly every Linux/macOS package manager (brew, apt, apk, dnf).

  • Ubiquitous Unix package availability
Utility & Efficiency 13 / 15

Single-command repository topology overview in ASCII or JSON.

  • -L depth limits and -I glob exclusions prevent context explosion
Maintenance & Lineage 8 / 10

Long-lived Unix standard maintained upstream with --gitignore added in v2.x.

  • Decades-long Unix lineage under GPL-2.0
Docs & Verifiability 8 / 10

Standard man page and --help cover all flags clearly.

  • Built-in man page and concise --help

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; reads local directory entries only.

Side Effects
Read-Only
Cost & Quotas

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

Copyable Guardrail for CLAUDE.md / AGENTS.md
# tree Agent Rules
- ALWAYS cap depth with `-L 2` or `-L 3` and exclude `node_modules|.git` via `-I` or `--gitignore`.
- Pass `-J` for JSON output or `-n` to suppress ANSI colors.

Agent-Ready Command Recipes

Safe Read-Only Queries

Emit a depth-bounded JSON directory tree
tree -J -L 3 -I 'node_modules|.git' --noreport .

Outputs structured JSON of the workspace up to 3 levels deep without summary footers.

Print plain ASCII directory layout respecting .gitignore
tree -L 3 --gitignore -n .

Renders an uncolored (-n) tree skipping ignored files (requires tree v2.0+).

Strengths for Agents

  • + Zero-risk read-only tool with native -J JSON hierarchy output.
  • + Available almost everywhere with intuitive -L depth and -I ignore flags.

Caveats & Pitfalls

  • ! Running tree without -L or -I on a repo with node_modules will flood the agent context window.
  • ! --gitignore requires tree 2.0+; older distro builds need -I patterns.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI