How to delete dead code: our 205,163-line commit
The most useful commit we made in a month had 65 additions and 205,163 deletions. It touched 1,415 files. Nothing in it makes a film look better, and it still changed every film we made afterwards. This post is about how to delete dead code when the dead code is a whole product direction, and why leaving it in place costs more than it seems.
The problem: the old path kept pulling agents back
In the A/B test HTML beat our JSON scene format, and we decided to drop JSON. Deciding is cheap. The JSON engine, its gates, its skills, its tests and its Go renderer were all still in the tree, and our agents read the tree.
An agent that greps for "how do I add a layer" finds a layer system. An agent that opens skills/ finds a skill for a format we no longer wanted anyone to use. Every leftover file is an instruction. A doc that says "do this" is hard to out-vote with a different doc that says "do that", so we did not try. We removed the old path.
What we tried
Our first step was to stop new work on JSON and mark it frozen. That is not the same as deleting it. For the site, we did exactly that for about 20 hours: commit 44be6195f froze a vendored copy of the engine into site/public (+50,586 lines) so the pages built on it kept working while we sorted out what to keep. Freezing added a lot of code. It did not remove any pull on agents. At 21:19 the same day we deleted it as well.
The lesson from the freeze is plain: a frozen copy is still code, and it still counts.
What we built: one big commit, then ordered follow-ups
We split the work by how safe each piece was to remove.
- One commit for the core.
420928c23deleted the format, the engine, the tools, the gates, the tests, the skills and the Go renderer. The result was 1,415 files changed, +65 and -205,163. Tracked files fell from 3,534 to 2,133. - A restore tag. The tag
json-finalmarks the last state with the format. Any file comes back withgit checkout json-final -- <path>. That gives a cheap answer to "what if we need it". - Hooks next.
000366b1adropped the JSON gates from the pre-commit and pre-push hooks, so commits no longer ran checks for a format that was gone (-107 lines). - Scripts and routers.
3913b499cmade the Makefile a set of thin aliases and deleted routers and dead scripts: 70 files, -2,481 lines. - The site.
170c70020removed the frozen engine copy, its data and the pages built on it: 1,792 files, -127,750 lines.6506927c7then removed the JSON-era films and every mention of the format. - The leftovers. A week later we stripped the scene registries, the three.js layer builder and the theme colour markers (
70b79ef66,a5619a0d6,d70663eaa). These were small, but they were the bits an agent could still stumble into.
Across the repo the deleted lines were not concentrated in one place. core/ lost 34,139 lines, films/ 33,733, tests/ 29,864, quality/ 29,733, harness/ 23,501 and blocks/ 17,221. A migration plan would have taken each of those one by one. A single deletion did not need a plan for each.
The measured result
The numbers we can stand behind come straight from git show --shortstat:
| Commit | Files | Added | Removed |
|---|---|---|---|
420928c23 delete the format |
1,415 | 65 | 205,163 |
170c70020 remove the site engine copy |
1,792 | 511 | 127,750 |
3913b499c thin Makefile, hooks, scripts |
70 | 158 | 2,481 |
We do not have a before-and-after number for agent success that isolates this commit. Other changes landed the same week, so we will not claim one. What we can say is what the agents can no longer find: layer types, JSON validators and the old make targets are gone from the tree.
What we would tell you if you are about to delete a lot of code
- Tag before you delete. A restore tag turns "are we sure?" into a cheap question. It also removes the strongest reason to keep the files.
- Delete, do not freeze. A frozen copy kept our site building for about 20 hours and then cost us a second deletion of 127,750 lines.
- Remove the guards at the same time. Gates and hooks that check a deleted thing get in the way of every other commit. We dropped ours two minutes after the main commit.
- Do the small leftovers too. A registry with one stale entry is a trap for the next agent. They are worth a short follow-up each.
- If agents read your repo, your repo is your prompt. Dead code is dead prompt. For more on that idea see Documentation as a budget and One owner per rule.
The rest of the move to a plain web page is in The whole film format fits in one screen. The code is at github.com/Vandit1604/vawe, and the current page format is in the docs. If you are comparing frameworks, see /remotion-alternatives.
In the code
git checkout json-final -- <path>: restore any deleted file.420928c23(2026-09-30): the 1,415-file deletion.170c70020(2026-09-30): the site loses its engine copy and the pages built on it.3913b499c(2026-09-30): thin Makefile aliases and fast hooks.d70663eaa(2026-10-07): the last theme markers and stage CSS go.