Why does Google need robots.txt and a sitemap?
A sitemap lists the URLs you want Google to find, and robots.txt tells crawlers which URLs they can access. Google's robots.txt guidance says the file must be located at the root of the site host to which it applies, and the file must be named robots.txt. A rule applies only within the protocol, host and port where it is posted, so check the live address rather than a local copy.
Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. It can write both files in the same change as your pages, then you confirm both URLs load in a browser after you deploy.
What should each page title and description say?
Each page needs its own title and meta description. Google's snippet guidance says identical or similar descriptions on every page of a site aren't helpful when individual pages appear in search results. Google also says there's no limit on how long a meta description can be, while the snippet is truncated in Google Search results as needed.
Ask Claude Code to write these from each page's content, then read a sample of pages yourself. Check that the description says what the page answers, and keep titles short so they read clearly in search results.
Where do the SEO rules live?
The rules belong in CLAUDE.md, so every new session starts with them. CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session.
Add rules such as one unique title and description per page, a sitemap regenerated on each build, and a robots.txt that never blocks public pages. Review the file when a rule changes, since Claude follows what is written there.
Common mistakes
A robots.txt that blocks the site stops crawlers from reading it, so check it after every change. Google's robots.txt guidance also says the file is not a mechanism for keeping a web page out of Google, so use noindex for pages that must stay out of results. Sitemaps must be UTF-8 encoded, so ask Claude Code to write the file in that encoding and open it in a browser before you submit it.