Skip to main content
skill CX Codex

robots-txt — Claude Code skill: audit and configure robots.txt

A skill that configures robots.txt, catches accidental blocks, and helps you decide which crawlers to let in. Useful for technical SEO and AI bot rules.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add kostja94/marketing-skills --skill robots-txt -a claude-code
npx skills add kostja94/marketing-skills --skill robots -a claude-code
Open on GitHub

What robots-txt does

The skill walks through robots.txt directive by directive: User-agent, Disallow, Allow, Sitemap, Clean-param. It also draws the line between crawl control and index control — robots.txt closes paths, noindex removes pages from results. Mixing those up is a common mistake.

Path formats get their own table. Disallow and Allow take a root-relative path only, Sitemap takes an absolute URL only. Get that wrong and the rule does nothing. The skill also flags what you must not block: CSS, JS and images, because Google needs them to render the page. Pages carrying noindex stay crawlable too, otherwise the crawler never reads the directive.

For AI crawlers there is a token list with recommendations. Search bots such as OAI-SearchBot and Claude-SearchBot are usually left open; training bots such as GPTBot and ClaudeBot get closed. One thing worth checking: ChatGPT-User no longer honours robots.txt, so blocking it needs server-side controls. The anthropic-ai token is retired and has no effect.

What it helps with

  • set up robots.txt for a new site
  • find an accidental block on important paths
  • decide which AI crawlers to allow and which to block
  • separate crawl control from index control
  • check path formats inside directives

Example prompts for the agent

  • audit my robots.txt for accidental blocks
  • set up robots.txt: block /admin/ and /api/, keep search bots allowed
  • which AI crawlers should I block so my content stays out of training

How to install robots-txt

1Skills CLI (Vercel)

npx skills add kostja94/marketing-skills --skill robots-txt -a claude-code
npx skills add kostja94/marketing-skills --skill robots -a claude-code

2Manually: put the files in place

~/.claude/skills/robots/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/robots/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about robots-txt

How do I install robots-txt in Claude?

Run npx skills add kostja94/marketing-skills --skill robots-txt -a claude-code. The skill file then sits at ~/.claude/skills/robots/SKILL.md.

What does robots-txt do?

It helps you configure and audit robots.txt: directives, path formats, what must not be blocked, and rules for AI crawlers.

How is robots.txt different from noindex?

robots.txt controls crawling at path level but does not remove a page from search results. noindex controls indexing at page level. Pages using noindex must not be blocked in robots.txt.

Source text

SKILL.md · MIT
---
name: robots-txt
description: When the user wants to configure, audit, or optimize robots.txt. Also use when the user mentions "robots.txt," "crawler rules," "block crawlers," "AI crawlers," "GPTBot," "allow/disallow," "disallow path," "crawl directives," "user-agent," "block Googlebot," "fix robots.txt," "robots.txt blocking," or "search engine crawling." For indexing, use indexing.
metadata:
  version: 1.2.0
---

# SEO Technical: robots.txt

Guides configuration and auditing of robots.txt for search engine and AI crawler control.

**When invoking**: On **first use**, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On **subsequent use** or when the user asks to skip, go directly to the main output.

## Scope (Technical SEO)

- **Robots.txt**: Configure Disallow/Allow, Sitemap, Clean-param; audit for accidental blocks
- **Crawler access**: Path-level crawl control; AI crawler allow/block strategy
- **Differentiation**: robots.txt = crawl control (who accesses what paths); noindex = index control (what gets indexed). See **indexing** for page-level exclusions.

## Initial Assessment

**Project context:** Read root `contextus.md` when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.

Identify:
1. **Site URL**: Base domain (e.g., `https://example.com`)
2. **Indexing scope**: Full site, partial, or specific paths to exclude
3. **AI crawler strategy**: Allow search/indexing vs. block training data crawlers

## Best Practices

### Purpose and Limitations

| Point | Note |
|-------|------|
| **Purpose** | Controls crawler access; does NOT prevent indexing (disallowed URLs may still appear in search without snippet) |
| **Advisory** | Rules are advisory; malicious crawlers may ignore |
| **Public** | robots.txt is publicly readable; use noindex or auth for sensitive content. See **indexing** |

### Crawl vs Index vs Link Equity (Quick Reference)

| Tool | Controls | Prevents indexing? |
|------|----------|-------------------|
| **robots.txt** | Crawl (path-level) | No—blocked URLs may still appear in SERP |
| **noindex** (meta / X-Robots-Tag) | Index (page-level) | Yes. See **indexing** |
| **nofollow** | Link equity only | No—does not control indexing |

### When to Use robots.txt vs noindex

| Use | Tool | Example |
|-----|------|---------|
| **Path-level** (whole directory) | robots.txt | `Disallow: /admin/`, `Disallow: /api/`, `Disallow: /staging/` |
| **Page-level** (specific pages) | noindex meta / X-Robots-Tag | Login, signup, thank-you, 404, legal. See **indexing** for full list |
| **Critical** | Do NOT block in robots.txt | Pages that use noindex—crawlers must access the page to read the directive |

**Paths to block in robots.txt**: /admin/, /api/, /staging/, temp files. **Paths to use noindex** (allow crawl): /login/, /signup/, /thank-you/, etc.—see **indexing**.

### Location and Format

| Item | Requirement |
|------|-------------|
| **Path** | Site root: `https://example.com/robots.txt` |
| **Encoding** | UTF-8 plain text |
| **Standard** | RFC 9309 (Robots Exclusion Protocol) |

### Core Directives

| Directive | Purpose | Example |
|-----------|---------|---------|
| `User-agent:` | Target crawler | `User-agent: Googlebot`, `User-agent: *` |
| `Disallow:` | Block path prefix | `Disallow: /admin/` |
| `Allow:` | Allow path (can override Disallow) | `Allow: /public/` |
| `Sitemap:` | Declare sitemap absolute URL | `Sitemap: https://example.com/sitemap.xml` |
| `Clean-param:` | Strip query params (Yandex) | See below |

### Path Format Rules (Critical)

Different directives use different path formats — a common source of errors:

| Directive | Format | Correct | Wrong |
|-----------|--------|---------|-------|
| Disallow / Allow | **Root-relative path only** (starts with `/`) | `Disallow: /admin/` | `Disallow: https://example.com/admin/` |
| Sitemap | **Absolute URL only** | `Sitemap: https://example.com/sitemap.xml` | `Sitemap: /sitemap.xml` |

**Wildcards**: `*` matches any character sequence (`Disallow: /tmp/*`). `$` marks exact URL ending (`Allow: /news/.html$`).

**Priority**: More specific paths take precedence. `Allow: /shop/shoes/` overrides `Disallow: /shop/`. Path matching is case-sensitive: `Disallow: /PDF/` does not match `/pdf/`.

### Critical: Do Not Block

| Do not block | Reason |
|--------------|--------|
| CSS, JS, images | Google needs them to render pages; blocking breaks indexing |
| `/_next/` (Next.js) | Breaks CSS/JS loading; static assets in GSC "Crawled - not indexed" is expected. See **indexing** |
| Pages that use noindex | Crawlers must access the page to read the noindex directive; blocking in robots.txt prevents that |

**Only block**: paths that don't need crawling: /admin/, /api/, /staging/, temp files.

### AI Crawler Strategy

robots.txt is effective for all measured AI crawlers. Set rules per user-agent; check each vendor's docs for current tokens.

| User-agent | Purpose | Typical | Notes |
|------------|---------|---------|-------|
| **OAI-SearchBot** | ChatGPT search | Allow | Respects robots.txt |
| **GPTBot** | OpenAI training | Disallow | Respects robots.txt; shares crawl data with OAI-SearchBot if both allowed |
| **ChatGPT-User** | User-initiated browsing | N/A | **No longer respects robots.txt** (Dec 2025); use server-side controls instead |
| **Claude-SearchBot** | Claude search | Allow | Respects robots.txt |
| **Claude-User** | Anthropic user-initiated browsing | Allow | Respects robots.txt (unlike ChatGPT-User) |
| **ClaudeBot** | Anthropic training | Disallow | Respects robots.txt |
> **Deprecated**: ~~anthropic-ai~~ — retired by Anthropic, replaced by ClaudeBot / Claude-User / Claude-SearchBot. References to `anthropic-ai` in robots.txt have no effect.
| **PerplexityBot** | Perplexity search | Allow | Respects robots.txt |
| **Google-Extended** | Gemini training | Disallow | Respects robots.txt |
| **CCBot** | Common Crawl (LLM training) | Disallow | Respects robots.txt |
| **Bytespider** | ByteDance | Disallow | Respects robots.txt |
| **Meta-ExternalAgent** | Meta | Disallow | Respects robots.txt |
| **AppleBot** | Apple (Siri, Spotlight); renders JS | Allow for indexing | Respects robots.txt |

**Allow vs Disallow**: Allow search/indexing bots (OAI-SearchBot, Claude-SearchBot, PerplexityBot); Disallow training-only bots (GPTBot, ClaudeBot, CCBot) if you don't want content used for model training.

**Important — ChatGPT-User exemption**: As of December 2025, **ChatGPT-User** no longer respects robots.txt directives. OpenAI considers it a proxy for human-initiated browsing. If you need to block it, use server-side controls (WAF rules, IP rate-limiting), not robots.txt. See **site-crawlability** for AI crawler optimization (SSR, URL management).

### Clean-param (Yandex)

```
Clean-param: utm_source&utm_medium&utm_campaign&utm_term&utm_content&ref&fbclid&gclid
```

## Output Format

- **Current state** (if auditing)
- **Recommended robots.txt** (full file)
- **Compliance checklist**
- **References**: [Google robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt)

## Related Skills

- **indexing**: Full noindex page-type list; when to use noindex vs robots.txt; GSC indexing diagnosis
- **page-metadata**: Meta robots (noindex, nofollow) implementation
- **xml-sitemap**: Sitemap URL to reference in robots.txt
- **site-crawlability**: Broader crawl and structure guidance; AI crawler optimization
- **rendering-strategies**: SSR, SSG, CSR; content in initial HTML for crawlers

© kostja94 · MIT · kostja94/marketing-skills

Similar skills

Everything for SEO and GEO →

From the same set125

cookie-policy-page-generator A skill entry for building a Cookie Policy page that has moved elsewhere. It installs for compatibility only, with no page rules left inside. CX Codex +1 1,400installs brand-visual-generator A skill that helps define or audit visual identity: typography, color palette, spacing, design tokens and frontend aesthetics. CX Codex +1 1,400installs conversion-optimization Guides conversion rate optimization, hypothesis design, and A/B test planning. Useful when users drop off during signups, checkout, or landing page visits. CX Codex +1 1,400installs keyword-research An SEO research skill that finds target keywords, reads search intent and builds a topical map. Useful when you need a content plan tied to search demand. CX Codex +1 1,500installs seo-strategy A skill that plans SEO from scratch, audits an existing site and tells you what to do next. Useful when you don't know where to start. CX Codex +1 1,300installs schema-markup Generates Schema.org JSON-LD structured data for rich snippets and AI search engines. Helps match page content to supported search engine formats. CX Codex +1 1,300installs generative-engine-optimization A skill that walks through GEO and AEO strategy: how to get cited in Claude, Perplexity, AI Overviews and Copilot answers instead of only ranking. CX Codex +1 1,300installs affiliate-marketing Plans an affiliate program for AI/SaaS products: commission model, partner recruitment, tracking, and fraud prevention. CX Codex +1 1,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor