Token Optimization
Savings calculator
Move the sliders to match your project. See the savings instantly.
| Level | Includes | Tokens | Savings |
|---|---|---|---|
| L1Paths | Just file paths + language | ~1.6K | −99% |
| L2Symbols | + function & class names + imports | ~16K | −87% |
| L3Signatures | + full function signatures | ~30K | −75% |
| L4Summaries | + one-line AI summary per file | ~50K | −58% |
| Reading every file directly | ~120K | baseline | |
Estimated best case≈ 99% reduction · level 1 + scoping
Heads up, this is an estimate, not a measurement. Numbers assume ~3.5 characters per token, an average file size of ~2 KB, and average symbol counts. Your actual savings depend on your AI's tokenizer (Claude/GPT/Gemini differ), file size distribution, and how the agent uses tools. Treat these figures as ballpark, use
larkx stats in your project for indexed estimates that better match your codebase.This calculator is an estimate, not a benchmarkIt uses fixed per-level averages (~8 / ~80 / ~150 / ~250 tokens per file) and assumes a baseline of ~600 tokens to read each file. The chars-to-tokens conversion uses a ~3.5 ratio. Real numbers will differ.
How the numbers are derived
- Per-level tokens come from averages observed in TypeScript / JavaScript codebases, not a measured benchmark
- Raw read cost assumes ~600 tokens per file (≈ 2 KB average) using a ~3.5 chars-per-token approximation
- Different AI models tokenize differently (Claude vs GPT-4 vs Gemini), expect ±5-20% variance
- Files in your project might be smaller or larger than the average, variance compounds
- AI behavior in practice (re-reads, context loss, retries) often inflates real costs further
How to get a better estimate for your project
Run larkx stats in your project root. It uses your actual file count and actual symbol counts to compute per-level token estimates, much closer to reality than this slider-based calculator.
Illustrative example
The numbers below are estimates from typical TypeScript projects. Your actual savings depend on file sizes, the AI model's tokenization, and how aggressively you scope queries.
| Scenario | Without larkx (est.) | With L2 (est.) | Approx. reduction |
|---|---|---|---|
| Initial scan (300 files) | ~180K tokens | ~24K tokens | ~85% |
| Focused refactor (15 files in src/auth) | ~50K tokens | ~1.2K tokens | ~97% |
| "Where is foo?" | ~10K+ tokens | ~30 tokens | >99% |
Note: these aren't benchmarks, they're back-of-envelope numbers using a ~3.5 chars/token estimate. The calculator above generates the same estimates for any project size you input.