The Hermit Crab Method
or: declare technical bankruptcy, it's cheaper now
A snail secretes its shell from its own body. Shell and flesh are fused. It grows by accretion, layer on layer, and it can never leave. If the shell cracks, the snail is in trouble, because the shell is the snail.
That's your legacy codebase. That's the ten-year-old payments system where the spec isn't written down anywhere because the spec is scar tissue — ten thousand edge cases discovered via incident reports, calcified into the walls, distributed across git blame and dead Slack threads. You didn't build that shell. You secreted it. And now you live in it, because you can't imagine leaving.
A hermit crab grows no shell at all. It keeps the body soft, borrows a shell somebody else made, and the moment the shell pinches, it walks out and finds a new one. Zero sentiment. Borrowed, disposable, gone.
I'm telling you to stop being a snail.
It works, but it's 96 tables
Here's what happened to me. I built one feature. One. When I came back and actually looked at the database, there were 96 tables.
Before that feature, there were 45 — which I was already mad about. Then an agent expanded along whatever axis was locally easiest, and 45 became 96. Not because the agent was dumb. Because that's how agents were reinforcement-learned: reinvent the wheel, build the abstraction beside the abstraction, never delete anything. Every wheel gets reinvented because reinventing wheels is what got rewarded.
The best part: at one point I watched Claude Code and Codex argue with each other for three hours about multi-tenancy. Claude Code would write a linter to verify every SQL statement scoped to the organization's data. Codex would come in with a counterexample — ooh, what about this case — and write a test for it. Claude Code would patch it. Rinse, repeat, for three hours. Two intelligent agents, locked in an arms race, optimizing around an abstraction that neither of them ever stopped to question. They weren't solving multi-tenancy. They were solving each other.
That's the generative process, caught on camera. And here's the thing that should scare you: all of it worked. The tests passed. The linter linted. The code ran.
It works, but it's 96 tables.
The old math is dead
Technical debt used to be expensive to pay off because rewriting code was expensive. Humans are slow. So we refactored in place, carefully, forever, and we got attached to the code because the code cost us so much.
The math has flipped. With a big legacy codebase, every agent task starts with the agent reading through the mess to reconstruct the mental model — files, docs, drift between them, 600 SQL functions, abstractions stacked on abstractions built by agents less intelligent than the one currently reading them. You pay that tax on every single change. And here's the ugly part: when a smarter agent lands in a dumber agent's codebase, it doesn't fix the patterns. It follows them. It takes the mess and spreads it, politely, consistently, at superhuman speed.
Meanwhile, the rewrite costs... nothing? I rebuilt my entire codebase in about 20 minutes of a Claude Code session, on credits that were going to expire anyway. I opened a markdown file, typed out every system that was in my head and every system that should have been there, and had the agent build it from the ground up. When I said "this should be about 12 tables," it pushed back where I had holes in my model and we landed at 16. Fair. Somewhere between 12 and 20 was right. 96 was not.
Reading the old code to understand it would have cost more than replacing it. Let that sink in. The artifact is now cheaper to regenerate than to comprehend.
Each codebase is a falsifiable experiment
Here's the actual thesis, the thing underneath the workflow tip.
Cheap rewrites are the mechanism. Molting on a cycle is the method. But the thesis is this: each codebase is a falsifiable experiment on the main abstraction.
My first codebase tested the hypothesis "the agent is a component you puppeteer with deterministic logic around it." Customer reality falsified it. When I dug into what was actually happening, the whole architecture was working against the agent instead of out from it. The 96 tables weren't the disease — they were the symptom of a wrong root abstraction, and no amount of in-place refactoring can fix a wrong root, because refactoring preserves the root by definition. Only a rewrite lets you re-ask what the body plan is.
The new codebase tests a different hypothesis: the agent is the abstraction, and everything else has to prove its existence outward from it. Will this one fail too? Obviously. Give it three months of customer contact and I'll find the seam I can't currently predict, and I'll be pissed, and then I'll be grateful, because I'll know something I don't know now. Your initial assumptions never survive contact with reality — and once you've touched reality, you have a better model to bring back into the next shell. That's not failure. That's the experiment returning data.
But experiments only count if you record the result. So before I abandoned the old shell, the postmortem got written: what I wanted, what it became, where it broke. And the new codebase carries epitaphs — files that literally say if you're trying to copy the structure of this file, don't; here's how to use it instead. That accumulated record — which seams move, which are welded — is the crab. The code is just the current shell.
The part where I get to say I told you so
I was saying this months ago and people called me crazy. "You can't just throw it away, you have to read all of AI's code." No. You don't. Nobody does. Here we are: AI writes more code than you could read in a lifetime, and it works, and it's still wrong in ways no human will ever catch by reading.
That's the real stakes. This isn't a productivity hack — it's a scalable oversight strategy. Review-by-reading is dead. The only oversight that scales is (1) a hard external oracle that faces reality, and (2) the willingness to throw the soft body away whenever the experiment falsifies.
Bun proved this at real scale: the whole runtime got rewritten in Rust with Claude Code. Nobody held that system in their head. They didn't need to. The test suites and the ecosystem's expectations held it — Node compatibility is an oracle screaming from the outside. The shell was never the code. The shell is the verification layer. The code is the soft part. Soft is good. Soft is what lets you molt.
Okay, but what's my oracle?
If you're the staff engineer staring at 96 real tables with no test suite worth trusting: you can't hermit-crab yet, and you shouldn't. A crab without a shell is just lunch.
Your first molt isn't a rewrite. It's building the shell: the tests, the contracts, the public interfaces, the oracle that can tell you whether behavior held. Harden the boundary that faces reality. Then the body becomes disposable. I swapped my agent runtime out entirely — completely different substrate — and it didn't matter, because I'd already defined how the system should interact with the world, and the harness confirmed nothing broke. Once the shell is external to the code, the code stops being precious.
Then stop secreting. Start borrowing. Get attached to the oracle and the record of what each shell taught you — never the shell itself. When it pinches, and it will pinch, walk out.
It works, but it's 96 tables. Go count yours.