Why 40 KB monolithic /llms.txt files get truncated inside retrieval fetches
When teams hear that AI coding assistants and search agents check /llms.txt, a common reflex is dumping every blog archive URL, parameter variant, and verbose changelog entry into a single 35 KB to 120 KB text file. In production retrieval pipelines, automated HTTP fetchers and context summarizers enforce tight chunk and byte caps on discovery manifests so single domains cannot exhaust prompt budgets.
Once a /llms.txt crosses roughly 10 KB, bottom-half links, pricing summaries, API endpoints, and screenshot URLs risk silent truncation before the model reads your high-converting product pages. Splitting cleanly follows the original specification intent: /llms.txt acts strictly as a scannable executive index (`<= 8,192` bytes, roughly 1,200 to 1,800 whitespace tokens), while /llms-full.txt holds exhaustive technical specifications with HTTP 200 availability.
Just as vital is serving honest headers. Static hosts sometimes default unknown extensions or Next.js catch-all rewrites to HTML 404 shells or text/plain without cache lifetimes. Enforcing `Content-Type: text/markdown; charset=utf-8` alongside `Cache-Control: public, max-age=3600, s-maxage=86400` keeps origin fetches minimal and retrieval instantaneous.
Notice that LLM-focused manifests serve two distinct audiences simultaneously: real-time web retrieval pipelines running RAG synthesis during user searches, and coding agents such as Claude Code, Cursor, Windsurf, or Codex CLI inspecting API routes and SDK installation flags before writing integration code. Structure your `/llms.txt` headings cleanly into four predictable groups: core Key facts (pricing tiers, data guarantees, official brand spelling to defeat hallucinated synonyms), flagship product pages, interactive documentation endpoints (`/docs/api.md`, `/openapi.json`), and verified press assets (`/press`). Keeping link descriptions short and declarative lets retrievers extract exact facts without burning scarce prompt tokens.
- Always begin `/llms.txt` with `# BrandName`, a single-line factual blockquote, and `## Key facts` resolving common naming or pricing confusion.
- Cap `/llms.txt` cleanly under 8,192 bytes in CI and route exhaustive country tables, long FAQs, and UI screenshot lists to `/llms-full.txt`.
- Ensure `/robots.txt` explicitly allows `OAI-SearchBot`, `ClaudeBot`, `PerplexityBot`, and `Bingbot` on `/llms.txt`, `/llms-full.txt`, and `/press`.
- Avoid stale relative links inside Markdown: write complete canonical `https://` URLs matching HTML `<link rel="canonical">` byte for byte.
Exact structural split between /llms.txt, /llms-full.txt, and /sitemap.xml
Avoid duplicating full prose inside /llms.txt when a short curated summary pointing to /llms-full.txt and /press performs cleaner:
| Endpoint | Byte Budget Target | HTTP Content-Type Header | Mandatory Sections to Include |
|---|---|---|---|
| /llms.txt | <= 8,192 bytes (ideal 4-7 KB) | text/markdown; charset=utf-8 | # Brand, 1-line summary blockquote, ## Key facts, Top 10-15 flagship URLs, link to /press & /llms-full.txt |
| /llms-full.txt | 10 KB - 80 KB (complete) | text/markdown; charset=utf-8 | All canonical tools, 1280x720 screenshot URLs, same-criteria competitor tables, API specs & pricing limits |
| /sitemap.xml | < 50 MB / < 50k URLs | application/xml; charset=utf-8 | Clean canonical 200 indexable HTML pages (exclude /embed/* and noindex variants) |
| /press | 1,000+ SSR words | text/html; charset=utf-8 | Quick Facts table, verbatim 25w & 60w entity bios, ImageObject UI screenshots & official email |
Drop-in MIME, caching & CI size-gate recipes (Cloudflare Workers & FastAPI)
Wire build-time and edge enforcement so adding 20 new tools never accidentally bloats /llms.txt past 8 KB. In Next.js App Router deployments behind Cloudflare or Nginx, verify three common integration pitfalls: first, rewrite conflicts when an App Router catch-all route masks static `/llms-full.txt` files; second, service workers (`sw.js`) intercepting `/llms.txt` and serving outdated cached versions across releases; and third, backend reverse proxies stripping `text/markdown; charset=utf-8` headers during gzip compression.
If running a hybrid FastAPI plus Next.js deployment via Nginx gateway, terminate `/llms.txt`, `/llms-full.txt`, `/docs/api.md`, and `/docs/ai-integration.md` directly on the Python API upstream with `PlainTextResponse(..., media_type="text/markdown; charset=utf-8")` and explicit `s-maxage=86400` cache headers while logging verified AI bot visits straight into PostgreSQL without touching disk caches.
For multi-locale static hubs shipping Spanish, Japanese, German, French, or Portuguese calculators and file utilities, maintain one authoritative /llms.txt in English summarizing locale URL patterns (/es/, /ja/, /de/) rather than creating 6 redundant root manifests. Inside /llms-full.txt, list regional tool hubs cleanly alongside each tool canonical path, embed availability (/embed/{slug}), supported file formats, dataset revision tags, and verified 1280x720 press screenshot URLs so external researchers and agent workflows discover your entire product matrix in one HTTP GET request.
Always verify that every entry inside /llms.txt links cleanly to an accessible HTTP 200 canonical resource free of redirect hops or private login gates. Running PrismUV public /geo-audit alongside /llms-txt-generator after deployments guarantees both root Markdown manifests, sitemap canonicals, and edge s-maxage=86400 cache headers stay synchronized continuously.
- Bypass `/llms.txt` and `/llms-full.txt` explicitly inside Service Worker fetch handlers (`public/sw.js`) so stale caches never linger after deploys.
- Run automated `wc -c` or Buffer UTF-8 byte assertions inside `npm run build` scripts to reject oversized `/llms.txt` outputs before Wrangler deploy.
- Include a human-verifiable curl snippet inside `## Key facts` so coding agents can test live Markdown availability independently.
# public/_headers (Next.js static export on Cloudflare Assets / Pages)
/llms.txt
Content-Type: text/markdown; charset=utf-8
Cache-Control: public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400
/llms-full.txt
Content-Type: text/markdown; charset=utf-8
Cache-Control: public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400
// Build script guard (fail CI if /llms.txt exceeds 8,192 bytes)
const bytes = Buffer.byteLength(llmsContent, 'utf8');
if (bytes > 8192) throw new Error(`llms.txt (${bytes} B) exceeds 8,192 B budget`);Worked refactoring: Compressing a bloated 31.8 KB llms.txt down to 6.4 KB cleanly
When scaling a multi-country utility site past 50 tools and 100 jurisdiction landing pages, apply this exact split:
- 1. Move all 107 state/country variant links and multi-paragraph FAQ prose out of /llms.txt into /llms-full.txt (preserving 100% machine discoverability without throwing data away).
- 2. Lead /llms.txt with `## Key facts` summarizing pricing ($0 free tiers), brand disambiguation, verification proofs, and supported locales in 6 bullets (~1.1 KB).
- 3. List only the top 15 canonical hubs, /press fact sheet, and `/llms-full.txt` index -> final size stabilizes cleanly around 6.4 KB and stays fast for OAI-SearchBot and IDE agents.
Honest /llms.txt adoption boundaries
- Publishing an immaculate /llms.txt accelerates accurate LLM summarization and prevents hallucinations about pricing or features, yet traditional Bing/Google ranking signals and HTML SSR copy remain prerequisites for search triggers.
- Do not treat /llms.txt as an invitation to hide spammy keywords invisible to site visitors: align every claim in Markdown 1:1 with visible HTML pages.
- If Cloudflare Turnstile or Bot Fight Mode rejects curl or OAI-SearchBot user agents with HTTP 403, /llms.txt will still sit invisible until edge security exceptions are configured.
5-second /llms.txt header & byte-cap curl check
Verify live HTTP 200 status, UTF-8 byte count under 8,192 bytes, text/markdown header, and companion /llms-full.txt availability:
curl -sI https://prismuv.com/llms.txt | grep -iE "http/|content-type|cache-control" && curl -s https://prismuv.com/llms.txt | wc -c