ashlr

/ashlr-benchmark

Measure snipCompact savings on files in the current project.

Slash command

In Claude Code, /ashlr-benchmark chooses a source directory in the current project and runs the plugin's servers/bench.ts --dir harness. It reports a table and the mean savings for files at least 2 KB. The harness scans JavaScript and TypeScript files and selects up to six of the largest eligible files; token counts are estimates. Results depend on the selected files and are not whole-session savings.

From a checkout, run the same harness on a directory or one file:

bun run servers/bench.ts --dir /path/to/project/src
bun run servers/bench.ts --path /path/to/file.ts --json

Reference benchmark runner

scripts/run-benchmark.ts is a separate read, grep, and edit benchmark. It defaults to the current repository and writes docs/benchmarks-v2.json, so use --dry-run to avoid overwriting that artifact when exploring.

bun run scripts/run-benchmark.ts --repo /path/to/repo --dry-run --compare
FlagEffect
--repo <path>Select a git checkout to sample.
--out <path>Write results to a custom path.
--dry-runPrint results without writing the output file.
--comparePrint native and ashlr read-sample sizes.
--validate-tokenizerSample API token counts when a usable ANTHROPIC_API_KEY is available; otherwise report that validation was skipped.

The reference results and confidence intervals are described in the benchmark methodology. They measure a particular workload, not a guaranteed reduction for every project.

On this page