Writing a great llms.txt
Your llms.txt is generated automatically. You don't write it directly. But you do control what goes into it, by writing better frontmatter on each page.
What the file looks like
https://docs.yoursite.com/llms.txt looks roughly like this:
# Your Docs
> One-paragraph description of your product, generated from your project metadata.
## Pages
- [Quickstart](https://docs.yoursite.com/getting-started/quickstart.md): Get from zero to a published site in five minutes.
- [Custom domains](https://docs.yoursite.com/publishing/custom-domains.md): Point your own domain at your docs with automatic SSL.
- ...
Each entry: a markdown link with the page title, pointing to the .md URL, with the page description after a colon.
What you control
The two fields that drive every entry are in the page's frontmatter:
---
title: "Custom domains"
description: "Point your own domain at your docs with automatic SSL."
---
title becomes the link text. description becomes the after-colon explanation. Both are required for a page to be useful in llms.txt.
How to write descriptions for AI
Descriptions in llms.txt get scanned by AI assistants deciding which page to fetch. Two things matter:
1. Be specific. "Documentation about custom domains" tells an AI nothing. "Configure docs.yoursite.com with automatic SSL via CNAME" tells it exactly when this page is the right answer.
2. Include the obvious keywords. If a page is about "rolling back to a previous version", say "rollback" and "previous version" and "revert" if there's room. AI assistants don't always do fuzzy matching well.
3. Aim for 15–25 words. Long enough to disambiguate, short enough to not bury the lede.
Order matters
llms.txt is sorted by sidebar_position. Important pages first means AI assistants see them first when scanning the file from top to bottom. Boost the position of pages you want represented in answers.
Hiding pages from llms.txt
Drafts, internal notes, deprecated pages — set sidebar_class_name: "hidden" in frontmatter and the page won't appear in llms.txt (or in the sidebar).
---
title: "Internal API hooks"
sidebar_class_name: "hidden"
---
The page is still publicly accessible at its URL — sidebar_class_name: hidden only hides it from navigation, not from the open web. For genuinely private content, see password protection.
What we don't do
- We don't include
descriptiontext from pages with no description set. If you forget the description, the page lacks one inllms.txt. (Better blank than nonsense.) - We don't auto-truncate. If a description is 200 words, it goes in at 200 words. Self-discipline matters.
- We don't include a project tagline that's longer than a tweet. AI assistants quote it; keep it tight.