CustomLabs
Insights

How We Made Our Website Readable by AI Agents

Our HTML pages are about nine times larger than their Markdown twins. We built the twins so an AI agent can read the text without the page around it. We measured everything on 2026-11-16, on commit 9aaa052.

What does an AI agent get when it reads a normal web page?

It gets everything the browser gets: navigation, CSS, scripts and inline SVG. The words a reader wants sit inside that markup.

We built the site and counted. It has 160 pages. The HTML for all 160 pages totals 12,331,322 bytes. The Markdown twins total 1,321,649 bytes. The HTML is 9.3 times larger.

Page HTML bytes Markdown bytes
/ 109,035 13,320
/cost/ 162,762 37,449
/about/ 55,196 2,721

The gap is largest on pages with little text and much design. /about/ is the clearest case. It sends 55 KB of HTML to carry 2.7 KB of text.

What did we build?

The layer has four parts.

The first part is a build step that writes a twin for each page. A hook in astro.config.mjs runs after the build. It calls src/lib/markdown-export.mjs. That file converts the <main> element of each built page to Markdown. No list of pages exists, so a new page gets a twin with no extra work. The README section “Markdown twins” describes it.

The second part is two index files. /llms.txt is a short map of the site. /llms-full.txt holds the long form. Today they are 41,968 bytes and 293,234 bytes. src/pages/llms.txt.ts, src/pages/llms-full.txt.ts and src/lib/llms.ts build them. The proposal behind the format is at llmstxt.org.

The third part is content negotiation at the edge. A client can ask for Markdown at the normal URL. Two CloudFront functions handle it: terraform/website/functions/url-rewrite.js and markdown-headers.js. RFC 9110 defines the Accept and Vary headers they use.

The fourth part is discovery hints. Each HTML response carries a Link header that points to its twin. Each page has an alternate link element of type text/markdown in its head. robots.txt names llms.txt. A client that finds none of these can still add .md to a path.

This is what the two requests return today:

curl -sI -H 'Accept: text/markdown' https://customlabs.io/about/
# content-type: text/markdown; charset=utf-8
# vary: accept

curl -sI https://customlabs.io/about/
# content-type: text/html
# link: </about.md>; rel="alternate"; type="text/markdown"

How do we keep it from rotting?

A layer that nobody checks falls out of step with the site. We use three guards.

scripts/verify-md.mjs runs in npm test. It checks that each built page has a twin. It checks that the twin has the same title, no leftover markup and only absolute links. It also checks that dist/llms.txt has no em dash.

scripts/verify-edge.mjs checks the edge behaviour. It covers the headers above and the rewrite from a clean URL to its twin.

The third guard is one source for descriptions. We once typed each description again by hand for llms.txt, and the copies drifted. Now llms.txt prints the meta description of each page.

What does this not tell you?

We have no data on how often an assistant fetches a twin or llms.txt. We did not look at access logs for this article. So we make no claim about traffic, search ranking or citations.

llms.txt is a proposal. Not every crawler reads it. Some may ignore it.

Byte counts are not token counts. Markdown and HTML tokenize in different ways. The ratio of tokens may differ from the ratio of bytes.

The figures cover one site on one day. The page count and sizes change with each build. Measure your own site before you use our ratio.

Does this apply to your site or docs?

It applies if agents read your docs or product pages. One example is a coding agent that looks up your API. Another is an assistant that answers a buyer’s question about you. The build step is small. The gates keep it correct.

It applies less if your content sits behind a login, or if few outside readers use it. Start with the build step and the .md path. Add negotiation later.

The reasoning matches Tool Design and Context Engineering. Both say an agent should get the content it needs and little else.

CodeHerder runs the agent fleet that built and keeps this layer on our site. We can help you add the same layer to your docs.

Questions

FAQ#

Answers to the questions this piece raises.

01 What is a Markdown twin?

It is a plain-text copy of a web page, written in Markdown. Each page on this site has one. Add .md to the path to read it. The twin of /about/ is /about.md.

Link to this answer: What is a Markdown twin?
02 What is llms.txt?

It is a proposed file at the root of a site. It lists the pages that matter, with a short note for each. The proposal is at llmstxt.org. It is not a standard that every crawler reads.

Link to this answer: What is llms.txt?
03 How does a site return Markdown for the same URL?

The client sends an Accept header that asks for text/markdown. The server then returns the Markdown copy and sets a Vary: Accept header. RFC 9110 defines both headers.

Link to this answer: How does a site return Markdown for the same URL?
04 Do AI assistants read these files?

We do not know. We have no data on how often assistants fetch our twins or llms.txt. We built the layer because it is cheap to build and cheap to keep correct.

Link to this answer: Do AI assistants read these files?
Related services
Custom Development
Send agents the words they need.

Tool Design covers how agents read and call what you expose. Context EngineeringContext engineering decides what occupies a model's context window at every step, and in what order. covers what an agent should load into its window, and when.

Written by

CustomLabs Engineering

Agentic AI engineering team

CustomLabs is a small, senior-only studio that embeds with client teams. It ships eval-tested, model-agnostic AI systems into production in weeks. Every insight reflects work and lessons from the studio's own engagements — the people who write the code write the words.

Source: https://customlabs.io/insights/website-readable-by-ai-agents/

↑↓ navigate ↵ select esc close