The lava layer: why AI code is slowly petrifying your codebase
4m read time

The lava layer: why AI code is slowly petrifying your codebase

We are building faster than ever, but at what cost? Exploring the invisible accumulation of code that no one truly understands and why your application is turning into impenetrable rock.

These days, things move so fast it's almost intoxicating. You enter a prompt, watch the lines of code fly across your screen, and within ten minutes, you have a feature that used to take three days. It feels like flying.

But anyone who has ever been near a volcano knows this: liquid lava flows at lightning speed and looks impressive, but as soon as it cools, it turns into solid rock.

In software engineering, we call this the Lava Layer. And right now, we're pouring this layer onto our codebases at a record pace. The layer has a twin that never hardens, by the way: code churn, the lava you can still measure.

The Illusion of Ownership

When you write an algorithm yourself, you build a mental map. You know why that if statement is there, why you chose that specific array method, and which edge cases you've accounted for (consciously or unconsciously). That's not abstract knowledge; it's the intuition you need when something breaks at 3 AM.

With AI-generated code, that map is missing. You aren't an architect; you're a curator. You look at the code, see that it "works" (after all, the tests are green, right?), and you click merge.

At that moment, the first crust of the lava layer forms. You've added code that is technically functional, but whose "soul" no one on the team truly understands.

The Refactoring Trap

The real problem only surfaces six months later. Business requirements change (as they always do), and that complex module the AI spat out needs to be overhauled.

In a healthy codebase, that's a matter of surgical intervention. But with a lava layer, no one dares to touch it. Because the original logic didn't emerge from a human thought process, but from a statistical probability, the connections are often fragile and illogical to our brains.

The result?

  • Fear-driven development: "Don't touch that module, because we don't know what might break."
  • Hacks-on-hacks: Instead of improving the code, you build around it. The lava layer gets thicker and thicker.
  • Loss of velocity: The initial gain you achieved with the AI agent is now being paid back with interest because every change takes three times as long.

On top of that, the agent itself performs worse and worse in such a frozen codebase: your agent's suffering is your tech debt speaking.

How Do You Recognise the Lava Layer?

You can measure the petrification of your project quite simply. Ask yourself and your team the following questions:

SymptomCauseDanger Level
"The AI understands it better than I do"You've lost control over the logic.🔴 Critical
"I don't dare to adjust this unit test"The test is an echo chamber for the AI's mistake.🟠 High
"Let's just throw this file away and prompt it again"You're gambling, not building.🔴 Critical

Bust Out the Jackhammer

Does this mean we should go back to the typewriter? Of course not. But we need to stop pouring liquid lava.

  1. Limit the scope: Let the AI write small, manageable functions. No complete classes or complex orchestration layers. Make it search before it writes, too, or you end up with twenty near-identical helpers for one job.
  2. The 15-minute rule: If you can't fully explain the code the AI generates to a junior developer within 15 minutes, it doesn't go into the repo.
  3. Review like a skeptic: Don't treat AI code as a suggestion from a brilliant colleague, but as a pull request from an enthusiastic intern who's had way too much caffeine.
  4. Schedule the jackhammer: the layer that has already hardened only comes out in a deliberate cleanup pass, planned like backups, not saved for a quiet week.

Speed is wonderful, but maintainability is what keeps your business upright. A codebase consisting entirely of AI lava is a sprint champion in the short term, but a statue in the long term: beautiful to look at, but completely immobile.

Stay in control. Remain the owner. And don't let the lava harden.

(4 of 38)
01You don't have an AI problem. You have a process problem.02Why you should never ship code you don't understand03Stop copy-paste engineering04The lava layer: why AI code is slowly petrifying your codebase05The brilliant parrot problem: what AI actually does when it 'thinks'06The prompt is not the spec07The bureaucracy of bots: why we are checking the checker08The day Claude deleted my production database09The arms race for your trust: Mythos, Cyber and the security hype10Stop letting your agents write Markdown11Your agent's suffering is your technical debt speaking12You can't spot the bug if you didn't write the code13One in four: the security debt nobody's counting14Your 10x developer is gated by a 0.1x pipeline15Benchmarks said frontier. Developers said "dumb."16Caveman vs context-mode: small mouth, or smaller room?17Code churn is the lava you can still measure18The ceiling is made of concrete19The token-saver tax: walking back my Caveman advice20Even the malware is AI slop now21ThePrimeagen was right22Tokenmaxxing is what happens when you measure the wrong thing23They just asked the bot nicely: your support agent is the attack surface24Speed got cheap. Judgement didn't.25Your coding agent has no world model. You built it one.26The Ferrari has a limiter: a day with Claude Fable 527The off-switch was never yours28An open MCP server is worse than an open database29The most resilient job is eating its seed corn30The off-switch works both ways now31AI writes the tests. Mutation testing checks if they work.32How to get better at reading code: a practice routine33Learning to program in the age of AI: what I would learn first34Who is responsible for AI-generated code? You are, and 2026 wrote it down35When not to use AI for coding: the tasks I still do by hand36Hiring junior developers in 2026: the collapse is a hiring decision37Software estimation with AI: the typing was never the estimate38Slopsquatting: checking that the package exists is not a defence