4.5GuidePart of Build a website with AI coding agents: the practical guide
What llms.txt is, whether it helps, and how to add one
llms.txt is a short file that lists a site's key pages for AI tools. Here is what it does, what the evidence shows, and how to add one to an Astro site.

On this page9 sections
llms.txt is a plain text file at /llms.txt that lists a site’s main pages, so an AI tool can find the right ones without reading the whole site. Google Search ignores it, and the two large studies we read found no link to AI citations and almost no reads, so it is not a ranking tactic. Add one if your build can generate it, because its real job is narrower: a map for an agent that someone has sent to your site.
Checked November 6, 2026.
What is llms.txt?
It is a text file, written in Markdown, at a fixed address on your site. It holds a short list of your important pages. Anyone can open one. Here is a live one, from the Claude Code docs.
Jeremy Howard proposed the format in September 2024. It is a proposal, not an official web standard, so no tool has to follow it.
The name comes from LLM, short for large language model: the kind of AI behind tools such as ChatGPT and Claude.
Why llms.txt exists
Web pages are built for people. The proposal points out that a page wraps its information in navigation, ads and JavaScript, which makes clean text hard to extract. AI tools also have limited room to read. That room is called the context window, and the proposal says it is still too small for most whole sites. A sitemap doesn’t solve this, because it lists everything.
The idea is a short, picked list in one known place. It was meant for an agent, an AI tool that carries out a task for a person, to fetch “on demand” while helping someone. It was not meant mainly for training AI models.
So if you add one, does anything read it? We get to that below.
llms.txt vs robots.txt and sitemap.xml
People mix these up, because all three sit at the top of a site. A crawler is a program that visits sites and fetches pages.
Says which addresses they may access
Lists the site's pages
A short map of the main pages
robots.txttells crawlers which addresses they may access. Obeying it is up to the crawler.sitemap.xmllists your pages so search engines can crawl your site more efficiently.llms.txtis a short map. It controls nothing.
AGENTS.md is a different thing again. It is for agents working in your code, not for visitors to your site. See AGENTS.md vs CLAUDE.md.
llms.txt example
Every line in the file is one of four kinds:
NameThe only required part
# Rowan Ellery
SummaryOne line on what the site is
> Designer and developer in Bellingham, Washington.
SectionA heading that groups links
## Projects
Link with a noteA page, and why it matters
- [Ridgeline](https://example.com/projects/ridgeline): Offline maps and trail reports for crews and rangers.
Here is a trimmed copy of the real file from the demo site of Vesper, our free personal blog and portfolio theme. The person is made up. The theme generates the file when the site builds.
# Rowan Ellery
> Designer and developer in Bellingham, Washington. Calm software, maps and film photography.
## Pages
- [Rowan Ellery](https://example.com/)
- [Articles](https://example.com/articles)
- [Projects](https://example.com/projects): Some are client work at Switchback Studio, some are weekend projects that got out of hand. Most are open source.
- [Now](https://example.com/now): A short page about what has my attention this month, instead of a busy social feed.
- [Privacy](https://example.com/privacy): What this site collects, why, and who handles it.
## Projects
- [Ridgeline](https://example.com/projects/ridgeline): Offline maps and trail reports for crews and rangers.
- [Contour](https://example.com/projects/contour): Print-ready topographic posters from any trail.
The examples in the guides we read come from software companies and docs sites. This one is a personal site, and the proposal says the same structure suits “a personal site answering questions about someone’s CV”.
You may also see llms-full.txt, which puts a site’s full text in one file. Mintlify, a docs platform, says it developed that file with Anthropic and that it joined the proposal. The llmstxt.org page doesn’t mention it today. You don’t need it to follow the proposal.
Does llms.txt help?
“Does it help?” is really several questions, and they have different answers.
| Question | Answer | Best evidence | Limit |
|---|---|---|---|
| Google ranking? | No | Google: “Google Search ignores them” | Google only, not other companies’ tools |
| Do AI bots read it? | Almost never | Ahrefs, 137,210 domains: 97% of about 38,000 valid files got zero requests | One month. Its customers skew technical |
| Does it earn AI citations? | No evidence | SE Ranking, nearly 300,000 domains: “no correlation” | Correlation, in one model |
| Do AI companies say they use it? | We found no statement | OpenAI, Anthropic and Perplexity crawler docs point owners to robots.txt |
Silence is not proof of non-use |
| Do agents fetch it? | A little | Ahrefs: agents made 10.5% of requests to files that were read, and it names Claude-Code |
Small numbers. Logs can’t show why |
137,210 domains studied
About 38,000 with a valid llms.txt
About 1,100 whose file got any request
A few notes on those sources:
- Who wrote them. Ahrefs and SE Ranking both sell SEO tools. We sell themes, and our themes include this file. Weigh all of us with that in mind.
- What “valid” means. Ahrefs counted a file that returned real Markdown, not an error page. It did not check that the file followed the proposal.
- Who did the reading. In the Ahrefs data, SEO audit tools sent the most requests, at 21.7%. Ahrefs’s own crawlers made 10.6%, about as many as all agents combined. AI retrieval bots made 1.1%, and people made 4%.
- A third study agrees. Semrush reports that in its own test, “we didn’t find a correlation between implementing llms.txt and improved performance in AI results”.
Publishing one is not the same as reading yours. OpenAI’s and Perplexity’s crawler pages each link their own llms.txt, while telling site owners to use robots.txt. The Claude Code docs go further and tell agents to fetch the file “before exploring further”. So vendors design for it on their own docs. That doesn’t show their tools will look for yours unprompted.
Ahrefs has a view on that too. It says agents fetch the file “when directed, not speculatively”, so an unlinked file is unlikely to get picked up.
Our opinion: the agent use is the one that makes sense. Someone points a tool at your site, and the file saves that tool some searching. That matches what Howard says the file is for.
Ahrefs concludes that “the cons outweigh the pros right now”. We differ on one point: a generated file has almost no upkeep, so the cost of adding one is close to zero. Its security warning still stands. It says agents trust this file and that a stale or compromised one misleads every agent that reads it, so treat the file like code.
How to add llms.txt to an Astro site
There are three routes. Start with the smallest one that fits your site.
Add a static file
For a small site, create public/llms.txt and write it by hand. Astro copies public/ into the build untouched. The catch is that you keep it up by hand too.
Generate it with an endpoint
If your pages come from a content collection, generate the file. An endpoint is a page that returns something other than HTML, and a file named llms.txt.ts builds /llms.txt.
// src/pages/llms.txt.ts
import type { APIRoute } from "astro";
import { getCollection } from "astro:content";
export const GET: APIRoute = async ({ site }) => {
const posts = await getCollection("blog", ({ data }) => !data.draft);
const links = posts.map((p) => `- [${p.data.title}](${new URL(`/blog/${p.id}`, site)}): ${p.data.description}`);
const body = `# My Site\n\n> One sentence on what this site is.\n\n## Blog\n\n${links.join("\n")}\n`;
return new Response(body, { headers: { "Content-Type": "text/plain; charset=utf-8" } });
};
We ran this on a fresh copy of Astro’s blog template. Two things to set first:
- Set
siteinastro.config. Without it,siteisundefinedhere and the build stops withInvalid URL. - Give the collection a
draftfield, or remove the filter. The blog template has no such field. The build still passes, butastro checkreports an error until you adddraft: z.boolean().optional()to the schema.
If you use a coding agent, give it this sample, the address of the proposal and your collection’s name. Then run the checks below on what it writes.
Use a theme that includes it
Vesper builds the file from the same list of public pages as its sitemap. A new article appears on the next build, and a hidden or draft page stays out. It works the same way if you run the theme on EmDash, a content management system.
npm also has Astro integrations for this, such as astro-llms-txt and astro-llms-md. We haven’t tried them, so we name them without a recommendation.
How to check your llms.txt
- Run
npm run build, thennpm run preview, and open/llms.txt. - Check that the file starts with one
#heading. - Check that every link is a full address and opens.
- Check that no draft or hidden page is listed.
- To learn whether anything reads it, look for
/llms.txtin your server or CDN logs.
Lighthouse, Chrome’s site audit tool, has an llms.txt audit. A missing file reads as Not Applicable, so you don’t need one to avoid a failure there.
Common mistakes
Adding it to rank better. Google says it ignores the file.
Copying your sitemap into it. Pick the pages that matter. That is the point of the file.
Listing hidden pages. The file is public. Build it from the same list as your sitemap.
Using it to block bots. It blocks nothing. To ask crawlers to stay out, use robots.txt. Vesper has a setting for AI training crawlers.
Publishing it and telling nobody. Ahrefs advises linking the file from your HTML or docs, or mentioning it wherever agents get instructions about your site.
Keeping it by hand on a site that changes. It goes stale. Generate it.
Trusting a promise with no data. If a tool or guide says this file raises traffic or citations, look for a source and a date. That includes this page.
Should you add llms.txt?
Add one if your build can generate it, or your site is small enough to keep it right. It is worth the most if people point agents at your site: docs, developer tools, products with a lot of detail.
Skip it for now if it would be another file to keep up by hand on a large site, or if your pages aren’t yet real text in real HTML. Fix that first.
Never add it to rank.
Our themes include it because it comes with the theme and costs the buyer nothing to keep. We promise no result. To get the file we showed, start with Vesper, which is free and MIT licensed.


