What SEO rules should I put in AGENTS.md or CLAUDE.md?

Put a short list of checkable rules for every new page: one question and one H1, a unique title and description, a canonical, hreflang, text rendered on the server, JSON-LD that matches the visible text, a sitemap entry, sourced facts, and never touching pages that already work. Rules guide the agent; they do not prove the live page is right.

Facts

Which file should hold the rules, AGENTS.md or CLAUDE.md?

Use AGENTS.md if more than one coding agent works in the repository, because Codex and Cursor read it and Claude Code reads or imports it. Keep CLAUDE.md for Claude-only notes, with an import line so Claude also gets the shared rules:

# CLAUDE.md
@AGENTS.md

What rules should I copy?

These rules are short, concrete and checkable, which is what the agents' own docs recommend. Paste them as a section of the file:

## SEO rules for new pages

- Only add new content pages. Never change the home page or a page that already works.
- One question per page. The H1 is that question; the first paragraph answers it.
- Unique <title> (up to 60 characters) and meta description (70 to 165).
- Self-referencing rel="canonical" on every page.
- Each language version links the others with hreflang; canonical stays in its own language.
- The text is in the server-rendered HTML, not loaded only by JavaScript.
- JSON-LD describes only what the page visibly says.
- Every number or date in a fact links to the source that states it. Invent nothing.
- Add the page to the sitemap and link to it from a related page.
- A page is done when it is checked on the live URL, not when the build passes.

Why each rule?

Each rule answers a known way pages fail:

RuleWhy
Canonical on every pageGoogle treats rel=canonical as a strong signal, a sitemap only as a weak one
hreflang between languagesGoogle uses hreflang alternates for language versions, with a canonical in the same language
Server-rendered textCrawlers that do not run JavaScript see an empty page otherwise
JSON-LD matches visible textGoogle's structured data guidelines forbid marking up hidden content
Never touch working pagesA rewrite can lose traffic a page already earns

What can rules not guarantee?

Rules cannot guarantee the published result: Claude Code's own docs say the file is context, not enforced configuration. A failed deploy, a wrong canonical or an empty render only shows on the live URL, so check each page there and watch indexing in Search Console.

Step by step

  1. Pick the file. Use AGENTS.md at the repository root; add @AGENTS.md to CLAUDE.md if you keep one.
  2. Paste the rules. Copy the rule block and adapt the paths and languages to your site.
  3. Keep it short. Stay well under 200 lines; move rules for one folder into a nested file.
  4. Check live. After each deploy, open the new URLs and confirm title, canonical, content and JSON-LD.

Common mistakes

  • Writing vague rules like "follow SEO best practices" that the agent cannot check.
  • Keeping both CLAUDE.md and AGENTS.md without an import, so Claude Code never reads the shared rules.
  • Pasting a long SEO manual that buries the rules that matter.
  • Treating the rule file as proof that the published pages are right.

How easyIndex solves it

easyIndex gives your coding agent the page rules step by step over MCP, audits each page when submitted and checks it on the live site after publishing; a step completes on evidence easyIndex checks, not on the agent's report.

It never changes your site or repository, and it works with Claude Code, Codex, Cursor or any MCP client, for US$ 30 per website a month after a 7-day free trial.

Frequently asked questions

Does Claude Code read AGENTS.md?

Yes, from v2.1.277 when there is no CLAUDE.md; with a CLAUDE.md, add the line @AGENTS.md to include it.

Will these rules get my site cited by ChatGPT?

No rule can promise that. They make pages clear and crawlable; citing them is ChatGPT's decision.

Should I add llms.txt to the rules?

It is optional. Server-rendered pages, canonicals and a sitemap matter first.

Can a subfolder have its own rules?

Yes. Agents read the nearest AGENTS.md in the directory tree, so a nested file can hold rules for that folder.

Continue reading

Last verified on .

SEO rules for AGENTS.md or CLAUDE.md