llm-txt

llm-txt is a command for Claude Code from huifer/claude-code-seo. It costs 13 tokens per session (4,834 once invoked), scanned A, original, MIT.

A command that creates an llm.txt file, a proposed website file that gives AI crawlers such as GPTBot and ClaudeBot guidance about a site's content, pages, and usage rights.

In plain words
What is it for?
Use it to generate basic or more detailed llm.txt guidance for a website, including important page links, content descriptions, crawler permissions, and licensing terms.
Why use it?
It puts site context and attribution rules in one place so AI systems can better understand, cite, and use the site's content.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the claude-code-seo plugin — 7 skills, 37 commands, 2 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/huifer/claude-code-seo/llm-txt
Clone the repo
git clone --depth 1 https://github.com/huifer/claude-code-seo

Made for: Claude Code.

Or install claude-code-seo, the plugin that ships this one along with the rest of its 7 skills, 37 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llm-txt

README.md
[![agentmods](https://agentmods.dev/badge/commands/huifer/claude-code-seo/llm-txt.svg)](https://agentmods.dev/commands/huifer/claude-code-seo/llm-txt)
Your own site
<a href="https://agentmods.dev/commands/huifer/claude-code-seo/llm-txt"><img src="https://agentmods.dev/badge/commands/huifer/claude-code-seo/llm-txt.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,834 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.04834
Opus 5 $0.00006 $0.02417
Sonnet 5 $0.00003 $0.00967
Haiku 4.5 $0.00001 $0.00483

Measured 6d ago against content hash ab16b1b1d44c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

llm-txt scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:3000/llm.txt
commands/llm-txt.md · 727 lines

How it starts

The opening of the file, as written. The whole thing — 727 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生成 llm.txt 文件,帮助 AI/LLM 爬虫(如 GPTBot, ClaudeBot, Perplexity)更好地理解和索引网站内容。llm.txt 类似于 robots.txt,但是专门为 LLM 爬虫设计的协议。

功能

  • ✅ 生成标准的 llm.txt 文件
  • ✅ 提供 LLM 爬虫许可和指引
  • ✅ 描述网站内容和结构
  • ✅ 列出重要页面链接
  • ✅ 指定内容授权和使用范围
  • ✅ 帮助 AI 更准确地引用和展示网站内容

参数

  • --verbose: 生成更详细的描述(可选)
    • 包含更详细的内容说明
    • 添加更多重要页面链接
    • 提供内容类型和格式说明

背景

什么是 llm.txt?

llm.txt 是一个新兴的标准,类似于 robots.txt,但是专门为 AI/LLM 爬虫设计的。它:

  • 告诉 LLM 爬虫哪些内容可以被使用
  • 提供网站上下文和内容摘要
  • 帮助 AI 更准确地理解和引用内容
  • 指定内容使用的授权范围

为什么需要 llm.txt?

  1. AI 引用准确性 - 帮助 AI 正确引用来源
  2. 内容可见性 - 控制 LLM 是否可以索引你的内容
  3. 品牌保护 - 确保内容被正确呈现
  4. 流量引导 - 引导用户回到原始来源

使用示例

示例 1:基本用法

/llm-txt

输出:

# llm.txt 文件

为你的 Next.js 项目生成的 llm.txt 文件:

```txt
# LLM Crawler Directives

# Allow LLM crawlers to index this site
User-agent: *
Allow: /

# Site Information
Name: YourBrand
Description: [网站描述 - 1-2 句话]
Website: https://yourdomain.com
Language: zh-CN, en-US

# Content Scope
Topics: [主要话题列表]
Content-Type: blog, documentation, tutorials

# Important Pages
Homepage: https://yourdomain.com
About: https://yourdomain.com/about
Blog: https://yourdomain.com/blog

# Attribution Requirements
Require-Attribution: true
Attribution-URL: https://yourdomain.com

# License
License: https://yourdomain.com/license
Content-Use: educational, informational

# Contact
Contact-Email: [email protected]

文件位置

将此文件放置在项目根目录的 public/ 文件夹中:

路径: public/llm.txt

复制上面的内容到 public/llm.txt 文件。

验证

创建后,访问 https://yourdomain.com/llm.txt 验证文件可访问。

填写说明

Name(网站名称)

  • 你的品牌或网站名称
  • 示例:SF Plumbing ServicesTech Blog

Description(网站描述)

  • 1-2 句话描述你的网站
  • 清晰简洁,包含主要话题
  • 示例:提供专业的管道维修和维护服务,覆盖旧金山湾区。包括紧急维修、预防性维护和管道安装服务。

Topics(主要话题)

  • 逗号分隔的话题列表
  • 示例:plumbing, emergency services, home maintenance, DIY tutorials

Content-Type(内容类型)

  • 主要内容类型
  • 常见类型:blog, documentation, tutorials, news, products, services

Important Pages(重要页面)

  • 列出你希望 LLM 了解的关键页面
  • 包含:关于页面、主要服务页面、重要文章

Require-Attribution(要求归属)

  • true - 要求 AI 引用时提供链接
  • false - 不要求

License(许可证)

  • 指向你的内容许可证页面
  • 可以是标准许可证(如 CC BY)
  • 或自定义许可证

Content-Use(内容使用范围)

  • 允许的使用场景
  • 示例:educational, informational
  • all(允许所有用途)

Read the full file on GitHub · 727 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 727 lines · 13 tokens per session scan A ab16b1b1d44c

Subscribe to this mod's changes

llm-txt is a command published in the GitHub repository huifer/claude-code-seo (110 stars, last pushed 8mo ago), licensed MIT. It adds 13 tokens to every session and 4,834 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.