Where do the AI rules live?
Keep them in CLAUDE.md, so the rules apply every time Claude Code starts work on the site. CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. A project CLAUDE.md can be stored in either `./CLAUDE.md` or `./.claude/CLAUDE.md`.
Commit the file, because the memory docs say project instructions are shared with your team through version control. Then the rules travel with the repository and reach every session, not only yours.
Which rules should go in CLAUDE.md?
Only rules that change the output. Write the robots.txt rule, the answer rule and the metadata rule, and leave out style preferences the site does not need. Each rule should name a file, a field or a page, so Claude Code can check it.
Keep the robots.txt rule strict. Google's robots guide says: "Google can't index the content of pages which are disallowed for crawling," so a block on a public page also keeps its content out of the index.
How do I check the result?
Check the live page in Search Console, not in the editor. Run URL Inspection on one key page, then click View crawled page to read the HTML that Google received.
Repeat the check after each build. Keep a short log of the rule changes, so the before and after results stay easy to compare in the next report.
Common mistakes
Writing rules Claude Code cannot check, such as make it rank. Rules should point at a file, a field or a page. Another mistake is a robots.txt block left over from a test build, which hides the site until someone reads the file line by line. A long CLAUDE.md that nobody reads is a third, so keep the AI rules in one short section.