AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Sep 30, 2026, 22:00 JST

Spec index cut AI reading by about 97.2% in developer's test

Spec index cut AI reading by about 97.2% in developer's test

3 Key Points

  1. What happened

    Reading one spec-index file of 803 lines on 2026年9月29日, an external program returned about 798 tokens against 28,407 processed, a compression of roughly 約97.2%.

  2. Why it matters

    Returning only the needed lines instead of a whole document appears to shrink how much text an AI must read per request, which can lower cost and context load.

  3. What to watch

    These are per-extraction estimates, not billing-token or whole-work figures, so the real saving hinges on how often the AI still opens the original spec and code.

WHO IT HITSThis lands on developers and engineering teams who feed large specifications and codebases to coding assistants and pay per token. It also matters to anyone evaluating whether external retrieval tools genuinely cut AI reading costs or only move the work elsewhere.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The setup grew out of a problem any team using coding assistants knows: handing the whole spec to the AI every time bloats the reading volume, but trimming it too aggressively drops the conditions that matter. The author's answer is to separate the specification into per-component HTML documents and give the same specs two doors — a mind-map view for people to see where things are, and an external program that pulls out only the relevant lines for the AI.

The compression figures come with firm caveats. The token counts are estimates from UTF-8 byte counts divided by four, not model-specific tokenizers or billing records. The 約97.2% came from reading an 803-line index file; a code-search extraction returned 777 tokens against 12,444 for roughly 約93.8% compression, and a screen-check diagnostic returned 339 against 2,024 for about 約83.3%. The first two returned all matches with no count-based cutoffs, and the third involved 8,096 bytes with zero findings or page errors.

The design is not a semantic search: candidate selection uses keywords and weighting, and past-document judgment leans on file names and locations. Whether the savings hold on a wider, cross-cutting change is likely to depend on how often the AI still has to open the original spec and code to verify conditions — which is precisely the check the author says should never be skipped. A follow-up piece is planned on the token-measurement program itself.

FAQ
How much did the AI's reading volume actually shrink?
On one spec-index file of 803 lines, the processed volume was 28,407 tokens and the returned volume was 798, an estimated 約97.2% compression. The author stresses this is a per-extraction figure, not a billing-token or whole-work saving.
Does this design lock me into Claude Code or Codex?
The goal is the opposite: keep the spec source, indexing programs, and search and check procedures independent of any model or chat. The author notes response formats and execution permissions need adjusting per AI, and says this design was not verified to give identical results on every AI.
Is this a lossless compression of the source documents?
No. The compression rate is calculated as (processed − returned) ÷ processed × 100, and it is not reversible compression that can restore all original information. Missing conditions, omitted counts, and unrun checks are the things the author says must never be cut.

AI news that matters for your work, in one minute a day

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleDazzle AI coach tells men: no contact won't win her back