Case study
Turns any repository into an onboarding site: dependency graphs, directory maps, framework cookbooks.
Sole author · Maintained · since
npm downloads, trailing year
Only the trailing-year download count above is independently registry-verified.
New engineers joining a codebase spend their first days building a mental map that already exists implicitly in the repo's structure (dependency graphs, module boundaries, framework conventions), but nobody writes it down, because a hand-written map goes stale immediately. An LLM can generate that map instead, but naively sending an entire repository through a model, file by file, is slow and expensive at the scale of the largest repositories tldr targets. I don't have a verified figure for that scale: the ledger below shows the one tldr number I've checked directly, trailing-year downloads; repo scale is one of four figures withdrawn until I verify them. Off-the-shelf documentation generators template from doc-comments; they don't reason about structure the way a static-analysis pass paired with a model can. I wanted the map generated automatically and cheaply enough to regenerate on every meaningful change, not hand-maintained until it drifted from the code.
A set of pure-Python static-analysis scripts extract structure (imports, directory layout, framework signatures) without a model call at all. The exact script count doesn't have a verified metric entry yet (see the decision record below).
Parallel Haiku workers handle the high-volume, low-complexity synthesis: per-file summaries and cookbook recipe drafts. A single Sonnet pass performs final synthesis under a fixed token budget, producing the dependency graphs (Cytoscape.js) and directory maps (D3.js) that make up the generated site.
ADR-001
Sending full file contents through a model for every file does not hold up at the scale of the largest repositories tldr handles. Structure (imports, directory layout, framework signatures) is recoverable by static analysis, without a model call at all.
I front-loaded pure-Python static-analysis scripts to extract structure before any model call, routed per-file summaries and cookbook drafts to parallel Haiku workers, and reserved a single Sonnet pass for final synthesis.
an early token-budget miscalibration on large repositories traced back to too much work left for the Sonnet stage. I would push more synthesis into the static-analysis stage from the start rather than after the failure.
tldr's first synthesis token budget was a guess. I picked a ceiling for the Sonnet pass without measuring what the static-analysis and Haiku stages actually left for it to do, and on the largest repositories Sonnet ran out of budget mid-synthesis on a meaningful share of runs, producing truncated cookbook pages instead of a clean failure.
My fix had two parts: tightening the token budget itself so the ceiling matched what a well-formed synthesis pass actually needed, and pushing more of the summarisation work back into the static-analysis and Haiku stages so less was left for Sonnet to do under a hard cap. The lesson matches Synapse's own memory migration almost exactly: a budget picked before you've measured what's consuming it is a guess wearing a number's clothes, and the fix is usually to shrink what reaches the expensive stage, not to raise the ceiling.
tldr's other figures, an inference-cost reduction, a language count, a repo-scale ceiling, and a synthesis token budget, came from the original project brief and never cleared independent verification the way Synapse's numbers did on 2026-08-11, so I withdrew all four on 2026-08-16 instead of shipping them with an unverified method. The one figure still shown above is the trailing-year download count, pulled directly from npm's public registry and reproducible by anyone:
# Trailing 12-month downloads for tldr-skill (1,047): the one
# tldr figure on this page that's independently registry-verified
curl https://api.npmjs.org/downloads/point/last-year/tldr-skillEach withdrawn figure returns once I've checked it directly against github.com/UpayanGhosh/tldr-skill, not before.
| Technology | Role |
|---|---|
| Python | Static-analysis scripts and orchestration. |
| Claude API | Tiered inference: parallel Haiku workers plus a single Sonnet synthesis pass. |
| Cytoscape.js | Renders the generated dependency graphs. |
| D3.js | Renders the generated directory maps. |
Verifying inference-cost reduction, language count, repo scale, and the synthesis token budget directly against the tldr-skill repository, the same audit Synapse's numbers went through on 2026-08-11, and restoring each figure once it's checked. Building incremental re-generation for repositories that change frequently, instead of a full re-run every time. Giving the static-analysis stage's script count its own audited metric entry too: it has never had one.