Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 4 min read

The Compact List Is the Most Expensive Way to Keep Your Links

I went into this run expecting the middle option to win. Dropping the links entirely loses every destination, and keeping them inline means paying for all of them, so a deduped list at the end felt like the obvious compr

I went into this run expecting the middle option to win. Dropping the links entirely loses every destination, and keeping them inline means paying for all of them, so a deduped list at the end felt like the obvious compromise. It is not. On most of the pages I measured, the compact list costs more than the full twin it was meant to slim down. The middle option is the most expensive one.

agentsearchhq suggested the test in the comments on yesterday's piece, and he specified the design himself: dedupe the list, drop the nav and footer links, keep the anchor text. So each entry pairs the first-seen anchor text with its destination, one line per distinct URL, like - Core Concepts: https://docs.gradle.org/9.9.3/userguide/gradle_basics.md#gradle. Same-page #anchor links are the nav cut, dropped entirely, since they point nowhere new. The served markdown twins carry no separately marked footer section, so there was no footer to cut beyond those anchors, and I did not invent one. Same seven pages as yesterday, plus the two link-dense docs pages and the Wikipedia list page, same tokenizer throughout. The stripped and main-text columns below are yesterday's numbers, re-verified by recounting.

Page .md tokens Stripped Compact Compact vs main Saving kept
Aptos AI hub 2,675 2,375 2,726 1.48x -17.0%
Gradle getting started 2,165 939 2,307 0.97x -11.6%
Gradle installation 3,402 2,909 3,282 0.79x 24.3%
Gradle troubleshooting 4,520 3,507 4,546 0.94x -2.6%
Gradle compatibility 2,414 2,279 2,446 0.73x -23.7%
Gradle declaring dependencies 2,011 1,716 2,027 0.63x -5.4%
Gradle build lifecycle 6,648 5,132 6,619 0.88x 1.9%
Gradle userguide index 1,391 1,005 1,459 0.62x -17.6%
Anthropic welcome 1,354 1,082 1,351 1.37x 1.1%
Wikipedia List of programming languages 19,856 9,709 22,492 2.32x -26.0%

"Saving kept" is the share of yesterday's strip saving the compact list retains. A negative number means the compact version costs more than the twin with the hrefs still inline. Six of the nine docs pages are negative. Only installation keeps a real share, 24.3 percent, and build lifecycle and Anthropic keep almost nothing, 1.9 and 1.1 percent. The Wikipedia page is the sharpest case: 747 distinct destinations, each with its name attached, and the compact list runs 22,492 tokens against a 19,856-token twin and 9,709 tokens of body text. The list costs more than the addresses did inline.

The reason is not the URLs. It is the names. The list repeats anchor text that is already in the body, so every entry pays for its destination and then pays again for words the reader already has. On getting started the list alone runs 1,368 tokens against 1,226 tokens of hrefs in the whole page. The list is bigger than the thing it replaces. On build lifecycle the anchor text inside the list runs 215 tokens, on troubleshooting 156, on Aptos 119, and those are the cheapest pages. The dedupe and the nav cut, the two savings the design was built on, are small against that. Here is the split.

Page Dedupe saves Nav cut saves
Aptos AI hub 4 46
Gradle getting started 0 0
Gradle installation 126 48
Gradle troubleshooting 97 33
Gradle compatibility 0 0
Gradle declaring dependencies 39 0
Gradle build lifecycle 217 53
Gradle userguide index 0 0
Anthropic welcome 67 0
Wikipedia List of programming languages 730 60

Dedupe carries more than the nav cut on every page where either is nonzero, except Aptos, where seven same-page anchors at 46 tokens beat a single repeated URL at 4. But both are small. Most URLs appear once, so there is almost nothing to dedupe, and the nav links are short #slug strings. The biggest dedupe in the whole corpus is 217 tokens on build lifecycle, against 1,516 href tokens on that page. The two cuts together never reach a few hundred tokens, while the list itself costs 167 to 1,487 tokens on docs pages and 12,782 on the Wikipedia page. The list is the expensive part, not the links in it.

I also measured the version without anchor text in the list, bare - URL lines with the names only in the body. It is not what agentsearchhq specified, but it shows where the cost lives. The bare list keeps 3.3 percent of the strip saving on getting started, 42.2 percent on installation, 29.0 percent on Anthropic, and 0.8 percent on the Wikipedia page. Always positive, never large. Even bare, the deduped URLs are most of the href cost, so there is little left to save. On a link-table page the bare list keeps under one percent, because 747 distinct destinations each pay their own address and there is nothing left to cut.

Two footnotes belong next to these numbers. First, the markdown twins carry HTML links the strip never counted: 26 on Aptos, 232 tokens of addresses, and 7 on Anthropic, 78 tokens. A builder that only handles markdown links misses those, and including them would make every compact version here slightly more expensive still. Second, the numbers above reconcile to within 28 tokens per page on the component sums, which is tokeniser boundary noise from counting pieces separately, except on Wikipedia, where the 527-token gap is the known difference between counting the joined URL string and counting each URL alone.

So the rule that falls out is blunter than the one I went in with. If the agent will follow links, keep the hrefs inline and pay the full twin. If it will not, drop them. The list at the end is the worst of both. It pays for the destinations, and then it pays again for the names.

The full numbers behind this one are in the MCP server token cost guide and the Cost and Context Survival Kit. Everything I write here stays free, that part doesn't change. β€” Salam

More from AheadKit: programming books, packs and AI tools. Each page lists exactly what's inside before you pay.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.