← /for/

Scratch for Sanity

Your AI rewrites Sanity documents as files on your computer: every published document, every type, about 10x faster than over an API. Portable Text stays structured, image assets stay locked, and you approve every change before it publishes back. Try it now free → or book a demo with Curtis

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

How it works

  1. 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.
  2. 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.
  3. 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

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.

Use AI to edit Sanity

Scratch connects your AI agent to Sanity. Pull a folder, let the agent edit the files, review every diff, and publish only what you approve.

See it run on your own content.

Curtis runs these calls himself. Thirty minutes, no pitch, no slides. He connects your platforms live and shows you your content as an editable, reviewable diff. Bring anything sticky: a refresh, a migration, or a rebrand.

Book a 30-minute demo call → or try it free

cookies

strictly necessary
required for the site to work. always on.

analytics
google analytics & posthog — anonymous usage, so we can improve the site.