Sanity gives you a schemaless Content Lake and a Studio your team actually likes. What it does not give you is a way to run one edit across a few thousand documents. The bulk pass you want, tighten every excerpt, fix the slugs, fill the empty SEO fields, means a GROQ query, a mutation script, and a robot token pointed at the same Content Lake your front end serves. So the cleanup waits.
Scratch pulls your dataset down as files on your computer. Your AI reads and rewrites every published document there, not a sample, and about 10x faster than it works over the API, because it reads the files directly instead of making a request per document. Every change comes back as a word-level diff next to the original. Nothing reaches Sanity until you approve it, per document.
What Scratch edits in Sanity
- Titles, slugs, and string fields across every document type you define
- Portable Text rich text, kept as the structured blocks Sanity stores
- Numbers, booleans, datetimes, tags, and nested objects like SEO settings
- References between documents, single or arrays, re-pointed safely
How it works
- Scratch pulls your dataset into files. Every published document becomes one local JSON file, organized by document type. Scratch reads your deployed Studio schema too, so files keep your authored field order, titles, and field groups instead of raw API order.
- Your AI edits the documents. Open the folder in the agent you already use. Try a prompt on a few documents, then let it run across the whole dataset. Portable Text stays structured blocks, so marks, links, and lists survive the round trip. System fields stay read-only, and image and file assets are out of scope entirely.
- You review every diff and publish. In the Scratch desktop app, each changed field shows next to the original, word by word. Approve what ships, and Scratch publishes only those changes as sparse patches through Sanity's transactional Mutation API: the fields you approved, nothing else on the document.
What teams use it for
- Run a tone or terminology pass across every post, page, and product in the dataset in one reviewed batch.
- Fill in or tidy SEO objects (meta titles, descriptions) that were left half-written.
- Normalize slugs and titles across a document type so published URLs and headings are consistent.
- Rewrite Portable Text bodies, tighten intros, fix formatting drift, without flattening them to plain text.
- Re-point references in bulk, like moving every post from one author or category to another.
- Reconcile content after a schema change, so old documents match what the Studio now expects.
Why not let AI write straight to Sanity?
Sanity's MCP server, or a mutation script with a robot token, hands the AI a live write path to the Content Lake. Every mutation lands immediately in the same published content your front end serves. There is no diff, no review queue, and no batch to approve or reject. One confident pass rewrites every document at once, and you find out from the live site.
Scratch gives the AI the same full read and write access, but against a local copy. The publish step is pulled out and handed to you. The AI can change any editable field; only you commit it. And every published change is reversible per document, so a bad pass is never a one-way door.
What's safe, and what's locked
Scratch edits field values on published documents and never touches your schema: document types, validation rules, and the Studio stay defined exactly as you wrote them. System fields (_id, _type, _createdAt, _updatedAt, _rev) are read-only. Image and file assets are out of scope, so nothing in your media library is pulled or edited. Drafts are untouched: Scratch reads and writes published content only. Writes go through Sanity's transactional Mutation API as sparse patches, so only the fields you approved change. You bring your own AI: Scratch holds no AI credentials and runs no model, so you sign into Claude, Claude Code, Codex, Cursor, Copilot, Cline, or Windsurf the way you already do. Nothing leaves your machine until you publish, every published change is reversible per document, and the whole thing is Git-backed from the first sync.
Questions Sanity users ask
Does it work with my custom schema?
Yes. The Content Lake is schemaless, and so is Scratch's pull: it discovers your document types from the content itself, whatever you defined. If you have deployed your Studio schema, Scratch reads that too and keeps your authored field order, declared titles, and field groups in the files and the review grid.
Can it edit Portable Text without mangling it?
Yes. Portable Text stays the structured blocks Sanity stores, so marks, links, and nested lists survive the round trip, and the review grid shows a readable text preview of each body. Images and custom blocks inside rich text stay as they are: the AI edits the prose around them.
What about drafts?
Scratch works on published content. It pulls the published version of each document, and approved changes publish back as published documents through the Mutation API. Drafts sitting in the Studio are not pulled and not overwritten as drafts.
Will it touch my images or uploaded files?
No. Image and file assets are out of scope entirely. Scratch edits the text, structured fields, and references on your documents; the media library is never pulled and never written.
How does it connect?
With a robot token from sanity.io/manage, the same way any Sanity integration authenticates. Give Scratch a token with Editor access and it finds the project and dataset itself. No OAuth dance, because Sanity does not have one for API access.
See it on your own dataset
The fastest way to trust it is to watch it run on one of your own document types. Pull a dataset down, point your agent at it, and read the first diff.