ashlr

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

FieldTypeRequiredDescription
pathstringnoDirectory to scan (default: cwd)
depthnumbernoMax traversal depth (default: 4)
patternstringnoOnly include files matching this regex (e.g. '\.ts$')
excludestring[]noDirectory names to skip (default: node_modules, dist, build, .git, .next, .cache, .turbo, pycache, .venv, .DS_Store)
sizesbooleannoInclude file sizes shown as B/KB/MB (default: true)
locbooleannoInclude line counts for text files (default: false; skips files over 2 MB)
maxEntriesnumbernoHard 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:

demo/  154 B · 28 files
├── commands/  9 B · 1 files
│   └── ashlr-status.md  9 B
├── scripts/  24 B · 12 files
│   ├── s0.ts  2 B
│   ├── s1.ts  2 B
│   ├── ...
│   └── s9.ts  2 B
├── servers/  100 B · 5 files
│   ├── bash-server.ts  20 B
│   ├── diff-server.ts  20 B
│   ├── efficiency-server.ts  20 B
│   ├── glob-server.ts  20 B
│   └── tree-server.ts  20 B
├── site/  18 B · 9 files
│   └── app/  18 B · 9 files
│       ├── p0.ts  2 B
│       ├── ...
│       └── p8.ts  2 B
└── package.json  3 B
5 dirs · 28 files · 154 B total

Example

Use ashlr__tree on the current project

Savings baseline

Replaces 3–10 ls calls + mental assembly. A typical project returns in one call what would take 5 calls to map manually.

On this page