.Rewriting Decap with less than $1K in Claude tokens

I've been rewriting Decap for two years. The year before that I built my own CMS from scratch and scrapped it. And ten years ago I wrote the first version: a schema-to-form generator my first clients ran, which grew into a content-model editor and came close to release in the JAMstack era. It died under monorepo maintenance and early architectural mistakes. It became the source of my ideas and the source of everything I wanted to avoid.

I love Decap because after all this time they are still loyal to the MIT license. And I love the architecture: git-based at its core, and in theory it works with any OAuth or backend. Everything in this fork builds on those properties. Martin Jagodic and the team at PM are keeping this open source project alive: releases every month, and the new Plate-based richtext widget shows the modernization is coming from inside too.

Claude didn't do this for me, at least not the important bits. The agents typed most of the code, I wrote the rest myself. The expensive part was everything else: ten years of trial and error, and a migration done one dependency at a time.

The last six months I ran a 24/7 pool of Claude agents with different roles: 825 commits, 190k lines of strict TypeScript, 3,600 tests, and $948.94 in Claude tokens. Workers build, a reviewer checks their work, an optimizer cuts the fat that agents accumulate, and an operator guards the gated paths nobody touches without my approval: package.json, the lockfile, CI, and the docs that define what the project is. And a psychologist 'agent' diagnoses and tweaks the agents themselves: when corrections and constraints pile up over time, they get careful, stop taking initiative, stop attempting new things.

Running a pool like that is a skill of its own. I built my own process for it, on techniques Matt Pocock teaches AI engineers: grill the requirements until they stop being vague, write a plan, cut it into thin vertical slices, hand the slices to agents, keep every context window small, review as a human. That discipline carried the project through 535 tickets.

The textbook ends there, because process tells you what agents should do, not how to lead them. The biggest lesson wasn't technical: management styles transfer to AI agents. When I micromanaged, prescribing every step, throughput dropped and the agents stopped thinking. When I was too lax, the codebase drifted. Giving them more responsibility, inside a small set of hard gates, made them reason about consequences: they wrote down learnings, questioned tickets, refused shortcuts. This only holds for the top models. The smaller ones need the micromanagement. I'm still figuring out where the optimum is.

What came out is a CMS that maps around a business instead of the other way around. Your dashboard can show your processes instead of a generic entry list, your views can follow how your team works, and your content lives in the backend that fits the infrastructure you already have (twelve ship in the box). It's not built for weekend sites, although with AI everyone is moving up the value chain.

For developers, the before and after:

  • Lerna, 41 packages → one package, 35 subpath exports
  • webpack + Babel → Vite on Rolldown
  • Jest + Cypress → Vitest + Playwright
  • Slate → Lexical, with Portable Text as the document model
  • Immutable.js → gone
  • 27% TypeScript → 100%, strict, pure ESM

Every file is rewritten in TypeScript; Decap CMS still has a lot of untyped, legacy JavaScript. The hardest dependency to remove was Immutable.js: it sits in every corner of a mature Redux codebase, so taking it out means touching every reducer, every selector, every component that assumed .get() and .toJS(). Upstream's issue for it has been open since 2020, and I understand why: a change that wide cannot be reviewed or tested in one go. The migration went one dependency at a time, everything green before the next one started.

Everything in the UI is replaceable: the root view, the routes, eleven render slots, your own widgets, blocks, backends and formats. The modularity costs you nothing if you skip it. It should be a drop-in replacement:

import CMS from '@laikacms/decap-cms';

CMS.init({ config });

One import gives you everything you were used to in Decap, with some breaking changes. Subpath exports let you assemble your own build down to 267 kB gzip.

It's built AI-native: an AI adapter in the core that edits entries through JSON Patch, Anthropic and OpenAI supported, an MCP server on the way. The repo itself is built for agents too: an AGENTS.md constitution, decision docs that record the why, invariant tests that stop an agent from silently breaking the public API.

It's becoming easier and easier to build software, so why buy into an expensive vendor-locked CMS when you can pay a developer and a Claude subscription and roll your own? Your content model belongs to you. A tool you build on should not be able to change its mind about you. That's why this is MIT licensed, and stays MIT. Forever.

I've started contributing upstream and I'm looking forward to building more with Martin and the Decap team.

https://github.com/laikacms/decap-cms