Third tool in the “read → search → orient” trilogy for AI coding agents:
| Tool | Answer | Status |
|---|---|---|
| zcat | read a file | shipped |
| rustygrep | find a needle | shipped |
| repomap | orient: what’s in this repo | this repo |
Problem: real repos have thousands of files. tree output dwarfs an
LLM context window before the agent reads one file, and a 5000-line listing
is useless — the agent wants “where is the auth code”, not “here are every
vendor dir and node_modules”.
Job: answer “what does this repo contain” in the fewest tokens.
.gitignore.repomap # map, ranked, token-capped
repomap --budget 2000 # cap output (default 4000)
repomap --full # no truncation
repomap --json # machine-readable
repomap --no-gitignore # include ignored files (warn: huge)
--json is the money feature — same pattern as zcat/rustygrep. An agent
gets a machine-readable map, not a human tree to re-parse.
repomap on this repo prints a ranked tree, tokens ≤ budget.repomap --json emits {files:[...], total_tokens} parseable as JSON..gitignore-excluded paths; .git, node_modules, vendor gone.go test ./... passes.go build.