Publish llms.txt and agents.md with Claude Code
Publishing llms.txt and agents.md with Claude Code means using Anthropic's terminal agent, connected to StoreSEO, to check what your Shopify store serves to AI crawlers, generate both files and manage llms.txt versions without leaving the folder you already work in.
Last updated: October 2026
Set up Claude Code for StoreSEO
Skip this if Claude Code is already connected. The full guide, with the alternatives, is on the Claude Code page.
- 1
Add StoreSEO to Claude Code
Run this in any terminal. The user scope makes StoreSEO available in every project on your machine.
Terminalclaude mcp add --transport http --scope user storeseo https://mcp.storeseo.com/mcp
- 2
Sign in to your store
Start Claude Code, run /mcp, choose storeseo and follow the browser window: pick your Shopify store and approve access.
Prompt/mcp
How does this work in Claude Code?
You run Claude Code from your theme repository or any folder, and type a request such as checking both discovery files and rebuilding llms.txt without blog posts. Claude Code opens with storeseo_start, then runs storeseo_get_llms_txt_status and storeseo_get_agents_md_status, and each call prints in the terminal as a read. The summary names the public URLs, the active version and whether a rebuild is due. Because you are in a theme repository, you can ask it to compare what the store serves with any llms.txt template you keep in the repo before deciding what to regenerate.
Generation needs a decision. storeseo_generate_llms_txt writes templates/llms.txt.liquid into the live theme and uploads a copy to Shopify Files, so Claude Code should tell you that and wait for your yes in the chat, and its own permission prompt then appears as a second check. The run queues quickly and takes a minute or two; Claude Code polls storeseo_get_llms_txt_status until generation_ongoing is false, so leave the session running. storeseo_generate_agents_md is the credit-spending one: it publishes at once, replacing Shopify's default, and returns the text, so you can ask Claude Code to write the returned markdown to a file in the repo as a copy before you edit your brand details.
Rolling back is a short exchange. storeseo_list_llms_txt_versions shows which version is active, storeseo_activate_llms_txt_version switches, and storeseo_delete_llms_txt_version and storeseo_reset_agents_md are the two that cannot be undone. Note that a file named AGENTS.md in your repository is a different thing from the agents.md StoreSEO publishes to your storefront, so say which one you mean.
-
You: Rebuild llms.txt if it is stale, and tell me what you will touch first.
- storeseo_start read-only
- storeseo_get_llms_txt_status read-only
-
Claude Code: A rebuild is due because your resource settings changed after the last run. Generating writes templates/llms.txt.liquid into your live theme and a copy into Shopify Files. Shall I go ahead?
-
You: Go ahead.
- storeseo_generate_llms_txt needs approval
- storeseo_get_llms_txt_status read-only
What to ask Claude Code
Use StoreSEO to check my llms.txt and agents.md. Tell me which version is live and whether a rebuild is due.
Regenerate llms.txt. Warn me that it writes to the live theme, wait for my yes, then poll until it finishes.
Generate agents.md for the store, save the returned text to storefront-agents.md in this folder, and tell me the AI credit it used.
- Is my llms.txt up to date, and which version is live right now?
- Generate a new llms.txt that includes products and collections but not blog posts. Warn me before it goes live.
- Show me my llms.txt versions and switch back to the one from last week.
- Does my store serve a custom agents.md or Shopify's default?
- Write an agents.md for my store and publish it. Tell me what it costs first.
- Reset agents.md to Shopify's default.
What StoreSEO does: llms.txt and agents.md
llms.txt is a curated map of your store for AI crawlers, and agents.md tells AI shopping agents who you are and how to buy. StoreSEO generates both from your store data and publishes them to your live theme; the agent checks status, generates, switches llms.txt versions and resets agents.md to Shopify's default.
Requires: agents.md generation spends AI Content Optimizer credit and needs at least one published product.
- 1
Check what is live
The agent reads the llms.txt status (settings, latest version, whether a rebuild is due, public URL) and the agents.md status (custom file or Shopify's default, public URL).
- 2
Warn before publishing
Generating llms.txt writes a template to your live theme and uploads a copy to Shopify Files in the same run, with no separate publish step. Generating agents.md publishes it live at once and spends credit. The agent says so and waits for your yes.
- 3
Generate and wait
llms.txt generation takes a minute or two; the agent polls the status until it finishes. agents.md returns the published text and its URL straight away.
- 4
Manage versions
StoreSEO keeps the latest ten llms.txt versions. The live file serves the active version, which is not always the newest, and any version can be made active again.
- 5
Roll back
Deleting a version is permanent. Resetting agents.md drops the custom file so Shopify's default serves again, and there is no history to restore it from.
llms.txt and agents.md reference
| llms.txt | Generated from your products, collections, pages and posts; served at your store's /llms.txt |
|---|---|
| Where it is written | A template in the live theme plus a copy in Shopify Files, in the same run |
| Schedule | llms.txt can regenerate on a saved schedule; settings passed with a run are saved for scheduled runs |
| Versions kept | The latest ten; the live file serves the active one |
| Generation time | About one to two minutes for llms.txt |
| agents.md | AI-written from your brand profile, top products, collections and contact details; served at /agents.md |
| agents.md publish | Live immediately; replaces Shopify's native default |
| agents.md reset | Shopify's default serves again within seconds; the custom text is gone for good |
Rules Claude Code follows
- The agent tells you that llms.txt generation writes to your live theme before it starts.
- agents.md generation publishes live and spends credit, so the agent says both and waits for your yes.
- Deleting an llms.txt version and resetting agents.md cannot be undone; the agent confirms each one.
- Deleting the active llms.txt version promotes the next newest automatically, so the agent says which version will go live.
In Claude Code
If you allow the StoreSEO tools in your Claude Code permissions to skip prompts, the confirmation StoreSEO asks for in the chat becomes the only check before a live theme write, so scope the allow rule to the read tools and keep generate, activate, delete and reset on ask. Without --scope user the server is only registered for the current project, so a status check from another folder will find no StoreSEO tools.
What runs without asking. Reads such as SEO scores, store listings, settings and Google reports run straight away. Generating a preview spends AI credit but writes nothing, and StoreSEO tells the agent to say what a generation will cost before it runs one. Applying content, optimizing images, changing settings, publishing llms.txt or agents.md, writing a product description and deleting anything wait for your yes in the conversation. That yes is an instruction the agent follows, not a lock on the server, so your client's own tool-approval setting is the hard stop.
Questions
Can Claude Code wait for llms.txt generation to finish?
Yes. storeseo_generate_llms_txt queues the run and returns, and Claude Code polls storeseo_get_llms_txt_status until generation_ongoing is false and the latest generation time has advanced. That takes about one to two minutes, so keep the session open.
Is the agents.md StoreSEO publishes the same as an AGENTS.md in my repository?
No. StoreSEO's agents.md is served from your storefront at /agents.md for AI shopping agents. A file with a similar name in your code repository is instruction text for coding agents. Claude Code does not move one into the other unless you ask it to copy text.
What is the difference between llms.txt and agents.md?
llms.txt is a curated map of your store for AI crawlers and answer engines, served at /llms.txt. agents.md is the file AI shopping agents read to understand your brand and how to shop with you, served at /agents.md. StoreSEO can generate both.
Does generating llms.txt change my theme?
Yes. The same run writes an llms.txt template into your live theme and uploads a copy to Shopify Files. There is no separate publish step, which is why the agent should warn you before it starts.
Can I go back to an older llms.txt?
Yes. StoreSEO keeps the latest ten versions, and any of them can be made the active one, which republishes it to your storefront. Deleting a version is permanent.
Can I undo a generated agents.md?
You can reset it, which makes Shopify's native default serve again within seconds. The custom text is discarded with no history, so keep a copy if you might want it back.
Keep going
llms.txt and agents.md with other agents
More Claude Code guides