codebase-snapshot

· 6 min read · by

Benchmarks

Three ways to pack the same repository, measured on this repository itself. The numbers are generated by scripts/benchmark.mjs, which anyone can run:

node scripts/benchmark.mjs /path/to/repo "the question to slice for"

The run below used the default question, on this repository at 0.21.0 on 2026-11-30: 221 files, 764,225 estimated tokens in full.

Mode Files Parts Tokens vs full Time
full 221 9 764,225 100% 2.05 s
slice 7 1 63,983 8.4% 1.68 s
budget (30,000) 22 1 36,005 4.7% 1.69 s

What the columns mean

What to take from it

  1. The full snapshot is usually too large to paste. Under a million tokens for this repository is typical for a mature codebase; a 200k-token window cannot hold it.
  2. A slice is two orders of magnitude smaller and still coherent: four files that the planner judged relevant, with their bodies intact.
  3. A budget is the "fit the window" answer: 21 whole files at 3.7% of the tokens, chosen by entry point, importer count and layer rather than by alphabetical order.
  4. Generation is not the bottleneck. All three modes take about the same time; the saving is in what gets written, not in what gets read.

Ten public repositories

node scripts/benchmark-suite.mjs              # the ten default repositories
node scripts/benchmark-suite.mjs --json       # the same run, as data
node scripts/benchmark-suite.mjs <url> ...    # your own list

Each repository is cloned shallow into a scratch directory, packed by all three tools, and the clone is deleted. A repository that cannot be cloned is reported as skipped with the reason, never dropped from the table. Measured at 0.21.0 on 2026-11-30, with repomix 1.19.0 and gitingest from PyPI. The shape held; small file-count differences are policy (notably bounded previews), not scanner drift.

Repository Ours files Ours tokens repomix tokens repomix / ours gitingest bytes
jonschlinkert/is-odd 11 5,447 4,291 0.79 29,392
chalk/chalk 32 77,684 79,006 1.02 238,864
tj/co 19 12,996 9,189 0.71 74,613
isaacs/minimatch 87 303,508 64,794,947 213.49 1,764,476
moment/luxon 151 303,029 250,093 0.83 806,740
psf/requests 117 382,695 687,333 1.80 524,712
pallets/click 177 470,265 335,153 0.71 1,413,342
expressjs/express 215 261,817 198,639 0.76 792,177
colinhacks/zod 687 1,768,759 1,752,965 0.99 4,485,971
anuraghazra/github-readme-stats 131 205,013 169,079 0.82 553,367

Read it carefully:

The point of ten repositories is not a leaderboard; it is that the shape holds outside the repository the tool was written in.

Honest limits

Head-to-head against repomix

node scripts/compare.mjs --repomix      # add --json for machine-readable output

repomix is fetched through npx at run time and gitingest through python -m gitingest; neither is a dependency of this package. Measured on this repository at 0.21.0 on 2026-11-30, repomix 1.19.0, gitingest from PyPI, same machine:

Tool / mode Files Content bytes Tokens vs full Time
codebase-snapshot (full) 221 2,549,431 764,225 100% 2.04 s
codebase-snapshot (slice) 7 231,622 63,983 8.4% 1.63 s
codebase-snapshot (budget 30,000) 22 119,794 36,005 4.7% 1.70 s
repomix 1.19.0 386 4,245,226 1,067,915 139.7% n/a
gitingest ? 3,848,714 n/a n/a n/a

Read that honestly:

The same caveats apply to any comparison: different ignore rules, different wrappers, different tokenizers. What is comparable is the shape — full packs are too large for a context window, and a selection is one to two orders of magnitude smaller.