Primo + Claude Code

Build and edit a website with Claude Code.

Pull your whole site down as files, point Claude Code at the repo, and let it edit anything — components, content, pages, routes — the way it would in a SvelteKit app. Push it back, and your client edits the same files live in the browser. No data layer to instrument, no API between the code and the content.

Claude Code edits the site. Your client edits the same site.

Claude Code is happiest with a whole codebase in front of it — files it can read, grep, and edit across. Primo gives it exactly that: primo pull brings your entire site down as plain files. Blocks are Svelte components, content and config are YAML. Claude Code edits them like any other repo.

When you primo push, those files sync to a relational database on the server, and your client edits the same site visually — on the rendered page, in the fields each block declared. The editor generates itself from each block's fields.yaml; there's no glue code to write to make a field editable.

That's the difference from a git-backed headless CMS. With Tina, your files get indexed into a GraphQL data layer and you instrument each field with useTina before it's editable. Primo has neither the data layer nor the per-field wiring — the editor and the renderer read the same files and rows directly.

Why Claude Code fits Primo

Whole-codebase edits

Claude Code reads and edits across the entire repo. A Primo site is the repo — pages, blocks, content, config — so there’s nothing it can’t reach.

Just files, no API

No GraphQL layer, no useTina wiring, no SDK to call. Components are .svelte, schema is fields.yaml, content is YAML. Claude Code edits files.

Client edits the same source

After push, your client edits on the rendered page in the fields your blocks declared — the same source Claude Code just edited. One source of truth.

The loop with Claude Code

Four steps. The CLI is the real Primo CLI — primo pull, primo push. What’s Claude-Code-specific is how you invoke the agent in step three.

i. primo pull

Pull the site as files.

Brings your whole site into the repo — Svelte blocks, YAML content and config, pages, routes. Auth is a PRIMO_TOKEN you generate per site in the admin.

$ primo pull <your-site-host>
✓ pulled 14 blocks · 6 pages · content + config
ii. primo dev

Run the local preview.

Starts the local dev server. It watches the export folder and auto-imports your file changes so you see them as Claude Code edits.

$ primo dev
▸ dev server on http://localhost:5173 · watching files
iii. claude

Let Claude Code edit anything.

Open Claude Code in the repo and describe the change. It edits across the whole codebase — components, content, new pages — no fields to instrument first.

$ claude "redesign the pricing page and add a /vs/tina comparison"
✎ editing blocks/pricing · creating pages/vs/tina.yaml
iv. primo push

Push it back, hand off the browser.

Only changed files upload. They sync to the database on the server, and your client edits the same site live — on the page, in the fields your blocks declared.

$ primo push
✓ pushed 3 changed files · live

MIT · open source. The CLI is the same one your editors authenticate with — no separate API surface to learn. The same pull, edit, and push loop works with any CLI coding agent.

Questions

Can I use Claude Code as a CMS?

Yes. With Primo, Claude Code edits your whole site as files in a repo — components, content, schema, and routes — then primo push syncs it to a server where non-technical clients edit the same source visually. There’s no separate admin or API between Claude Code and the content.

How does Claude Code edit a Primo site?

You run primo pull <your-site-host> to bring the site down as files, then open Claude Code in that repo. Blocks are Svelte components and content is YAML, so Claude Code edits them like any codebase. primo dev previews changes locally; primo push deploys them.

How is this different from TinaCMS with an agent?

Tina indexes your files into a GraphQL data layer and you instrument each field with useTina before it’s editable. Primo has neither — the editor generates itself from each block’s fields.yaml, and the editor and renderer read the same files and database rows directly. Less for the agent to wire up, and nothing between the code and the content.

Do my clients need Claude Code to edit the site?

No. Claude Code is how you build and change the site as code. After you push, your client edits on the rendered page in the browser — click and type — with no terminal and no agent involved.

How does Claude Code authenticate to push?

The CLI reads a PRIMO_TOKEN from your environment, which you generate per site in the admin. primo pull <host> clones the project and primo push uploads only changed files. It’s the same auth an editor uses — no separate API.

Build it with Claude Code. Hand it to a human.

One command to spin up a workspace. Point Claude Code at the repo, then hand your client the browser.

$ npx primo-cli init my-workspace
✓ workspace ready · server.yaml written

MIT · open source · free forever