ashlr__tree
Token-efficient project structure view in a single call. Uses git ls-files so .gitignore is honored automatically.
Server: ashlr-tree — servers/tree-server.ts
Returns a Unicode box-drawing tree of the project structure in a single call. Inside a git repo, uses git ls-files so .gitignore is honored for free. Outside git, uses a readdir walk with a hardcoded exclusion set (node_modules, .git, dist, .cache, etc.).
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
path | string | no | Directory to scan (default: cwd) |
depth | number | no | Max traversal depth (default: 4) |
pattern | string | no | Only include files matching this regex (e.g. '\.ts$') |
exclude | string[] | no | Directory names to skip (default: node_modules, dist, build, .git, .next, .cache, .turbo, pycache, .venv, .DS_Store) |
sizes | boolean | no | Include file sizes shown as B/KB/MB (default: true) |
loc | boolean | no | Include line counts for text files (default: false; skips files over 2 MB) |
maxEntries | number | no | Hard cap on entries returned (default: 500). When exceeded, per-dir truncation with count. |
Output format
Each directory line shows its total size and file count. Each file line shows its size, unless sizes: false. Directories come before files, and a footer totals the scan. Abridged output from a small repo:
Example
Savings baseline
Replaces 3–10 ls calls + mental assembly. A typical project returns in one call what would take 5 calls to map manually.
Related tools
ashlr__glob— find files matching a patternashlr__orient— structural overview with semantic context