The scope of a subpath llms.txt: one file for one stretch of URLs

Which URLs a subpath file covers, how “the most specific one applies” is decided, and practical layouts for multi-documentation sites and versioned documentation.

About 3 min read

The proposal specifies that llms.txt can live at the site root or at any subpath; a file covers every URL under the path it sits in; and when several files apply at once, an agent should use the most specific one. (These are proposed semantics; there is no assurance that every agent implements them.)

How scope is worked out

https://example.com/llms.txt          → covers the whole site
https://example.com/docs/llms.txt     → covers /docs/** and is more specific than the root file
https://example.com/docs/v2/llms.txt  → covers /docs/v2/**, the most specific

When an agent reads /docs/v2/api/ref.html, all three files “apply”, and by convention it takes /docs/v2/llms.txt.

When to use subpath files

  • Several product lines or documentation sites share one domain: one file per product directory keeps the content focused.
  • Versioned documentation: one file each for v1 and v2, so links from the old version do not get mixed into the index of the new one.
  • Publishing rights for only part of the paths (common on shared hosting): one of the motivations behind the proposal’s design is that anyone who can publish content at a path can provide a file.

When not to use them: a single-product, single-version site. One root file is enough; several files only add synchronization cost.

Layout in practice

/llms.txt                 site-wide index: product overview + entry links to each documentation area
/docs/llms.txt            documentation area index: sections + links to core pages
/docs/v2/llms.txt         version index: v2 pages only

A higher-level file uses entry links to point to the lower-level files (- [V2 documentation index](/docs/v2/llms.txt): entry point to the versioned documentation). An agent can drill down along the links and does not need to guess paths.

How this relates to the checking tool

Our online check takes a file address and checks files one at a time (root or subpath alike). “Automatic discovery from the root address” currently tries only common locations, so submit subpath files directly by their file address. Each file gets its own report; overlapping scopes do not merge conclusions.

Test environment and results

Environment: the llmstxtdb check engine (the scopePath concept matches the directory model of this site), 2026-10-07. Checking the root file and a subpath file of the same origin separately produced two independent reports that do not overwrite each other (in the directory model of this site, Site.scopePath is modeled on exactly these semantics). Scope resolution is a convention of the proposal; agent-side behavior is outside what this guide commits to.