When Code Writes Itself: The Dawn of Just‑in‑Time Software
As the speed of code generation goes up, and the cost goes down - the marginal cost of code approaches zero, and suggests an incoming paradigm shift for software and the way that it's built
This post also available on the Zerg AI blog: https://zergai.com/blog/when-code-writes-itself
Software development is currently undergoing a revolution in response to the stellar improvements of code generation capabilities of the leading frontier AI models. This has led products like Cursor, Windsurf and Devin to undergo historic revenue and adoption ramps, as software developers eagerly embrace the increase in efficiencies - and honestly, the fact that these improvements take away much of the droll and mundane aspects of development and replace it with the fun of rapidly building new and exciting things.
However, the trend powering this transformation is not slowing down. Code generation is getting both exponentially faster and cheaper due to both improvements of the underlying frontier models, as well as optimizations across the stack and infrastructure powering them. This is means that code is transitioning from a commodity to the true abundance of a marginal cost of zero, and this stands to power and even more meaningful paradigm shift in the way we think about building software.
Late last year, I wrote a post about “Just-in-Time” Software, and since then I’ve been working on building a system that employs these principles. As such, we’ve put together a more in-depth white paper on the subject of just-in-time-software, but the long short of it is that not only is the idea of Just-in-Time software already working in with Zerg, that is delivering production ready components to mission critical industries like cyber security - we are now entering into an era where software will generate itself directly from specification - making static code bases a thing of the past. This is a true tectonic shift, where developers will experience productivity increases that previously would have been thought impossible and the subject of science fiction.
From Copilots to Code That Writes Itself
Over the last couple of years, AI “copilot” tools have helped developers write code faster. GitHub Copilot can autocomplete functions, and ChatGPT can suggest snippets. Yet, despite these valuable assistants, development teams still manage sprawling codebases that need constant upkeep. The code may be written faster, but it remains as a persistent artifact – one that requires debugging, refactoring, and maintenance long after the AI (or humans) helped generate it.
Just-in-Time Software flips this script. Instead of enduring a growing pile of code that we must continuously tend, what if the code only existed for the instant it’s needed? In fact, this already happens in small ways. When you ask ChatGPT to analyze data, often it will generate a bit of Python code, execute it, and then discard that code. Nothing is checked into a repository – the code is ephemeral. Now imagine this at enterprise scale: for every user request or new requirement, an AI could spin up custom-tailored code, run it to produce results, then dispose of it. No persistent codebase, no long-term baggage.
Today’s AI-assisted coding is like having a power steering in a car – easier, but you’re still driving and owning the car. By contrast, Just-in-Time Software is more like an on-demand taxi: you describe your destination, a vehicle appears to take you there, and when the ride is over the vehicle drives off, needing no further attention from you. The goal is software that builds itself when needed and vanishes when done. This represents a fundamental shift from the slow, handcrafted processes of today toward a rapid, adaptive feedback loop of continuous generation and execution.
The Burden of the Persistent Codebase
Why change the current model of software development? Simply put, maintaining a large, monolithic codebase has huge costs. Code has traditionally been treated as an upfront investment followed by endless maintenance. Feature by feature, year after year, we accumulate millions of lines of logic strung together, plus the obligation to fix, update, and adapt that code as the world around it changes.
Think of a typical enterprise application: it’s built by dozens of developers over many years. Teams come and go, each adding layers of complexity – different architectural patterns, libraries, and “best practices” locked in by historical choices. Over time, this codebase grows more brittle. Integration points break when a partner API changes. Legacy modules become landmines no one dares to touch. Technical debt piles up, and engineering talent gets trapped in an endless cycle of patching and firefighting rather than innovating.
This persistent codebase approach is like a ship that’s been at sea for years: encrusted with barnacles, patched in countless places, hard to steer, and in constant need of care to keep it afloat. It works, but it’s labor-intensive. Even modern AI coding assistants don’t solve this core problem – they help you add more code to the ship faster, but the ship only grows larger and more complex.
Just-in-Time Software proposes a bold alternative: what if you didn’t keep the ship at all? What if each feature or task was a lifeboat that appears precisely when needed and then is disassembled after use? By eliminating the concept of a permanent codebase, we eliminate the barnacles and the baggage. We free engineering teams from the tyranny of legacy code, allowing them to focus on defining what the software should do, not how to contort an aging code structure to do it.
What Is “Just-in-Time” Software?
The term “just-in-time” might ring a bell from manufacturing. In lean manufacturing, just-in-time production means producing goods exactly when they’re needed, minimizing inventory. In software, Just-in-Time Software means generating code exactly when it’s needed, minimizing the persistent “inventory”1 of code. It’s an approach where software is assembled on the fly from a specification and real-time context, rather than crafted in advance and stockpiled in a code repository.
In practical terms, Just-in-Time Software uses AI agents to generate and run code based on a problem description or goal, then throw that code away after achieving the goal. There is no long-lived codebase – the only thing that persists is the specification and the results. Each execution is like a single-use app, spun up to serve a purpose and then retired. The next time you need software to solve a problem, it generates a fresh solution tailored to that moment’s requirements.
Crucially, this is not the same as simply using an AI coding assistant to help a human developer. It’s a deeper paradigm shift. Rather than a human writing code with AI’s help, the AI writes and maintains the code directly in real time. The human’s role shifts to defining the desired outcomes, constraints, and oversight. The AI handles the heavy lifting of creation and upkeep automatically.
If this approach to building software that is performant and reliable sounds ambitious, it’s because it is. Yet, we have already built out a a system that manifests this philosophy and end goal: Zerg, which showcases just-in-time, self-writing software in action.
Introducing Zerg: A Glimpse into the future of Just-in-Time Software
One of the first real-world implementations of Just-in-Time Software is Zerg, an autonomous AI system initially developed for high-stakes cybersecurity environments. The name “Zerg” (a nod to the swarming alien race in StarCraft) is fitting, it unleashes a coordinated swarm of AI systems that work in parallel to build and maintain software components. Think of each autonomous AI as an expert engineer that never gets tired, never stops monitoring, and can collaborate with fellow agents instantly.
How Zerg Works: The with a manifest, say, the API specifications for an integration, your compliance requirements, and any business rules. Zerg ingests this and turns it into the living spec it must uphold. From there, Zerg generates code on demand to meet that spec. If you need a service integrated, Zerg writes the integration code, tests it immediately, and delivers a production-ready component that meets the manifest’s criteria.
Once deployed, Zerg monitors the manifest and target environment 24/7 for any drift from the spec or changes in user requirements. For example, if an upstream API schema changes or a new edge-case is added to the manifest, Zerg detects it and will automatically patch or regenerate the code as needed. This is like having an on-call engineering team of AIs that instantly responds at any hour, except instead of issuing alerts, they just fix the problem on the fly. No ticket queues, no panicked all-hands fire drills.
The business impact of this approach is dramatic. Zerg essentially collapses multi-week sprints into same-day deliveries. Tasks that used to take a team of humans months can be handled by the AI swarm in a matter of hours. In one early success story, an integration that would have consumed months of dev time was completed with only a half-day of a human engineer’s attention for final tweaking and validation. The rest was handled autonomously. Across components, this translated to thousands of engineering hours saved for that organization.
So what will engineers have left to do? A lot actually. Generative software is a power tool, and cannot choose what nail to hammer or house to build. Equipped with the leverage of generative software, engineers no longer have to worry about the 98% boiler plate that used to be a requirement of attempting to solve audacious problems. I’ll take the example of graphics, which is a field I spent a lot of time in, often the crux of a new technique hinges on only a few lines of code that express a new mathematical or algorithmic concept. However, to actually test or bring that to practice, thousands if not millions of lines of code are necessary. Up until now, the ratio of glue to substance has dominated the kinds of problems and work that engineering teams ultimately deem worth the squeeze and generative software can completely flip this equation around.
Consider how this will impact the velocity of technology teams. Adding a new feature or adapting to a new requirement no longer incurs a heavy cost in developer time, and teams can be incredibly agile. A CTO can respond to customer needs or new requirements immediately, knowing the AI agents will churn out the necessary changes by next morning. Time-to-fix shrinks from days or weeks to minutes as continuously regenerated code catches and patches issues before users even notice. Downtime plummets, because the software self-heals proactively. And since the AI handles the repetitive grunt work, human engineers are freed to focus on creative architecture and strategic projects, rather than writing boilerplate or chasing bug reports.
Our early adopters already see clear ROI. Talented (and expensive) engineering talent can focus on innovation instead of constant maintenance and managing technical debt. Moreover, the software itself becomes more reliable and secure: by removing human error from much of the code-writing and by constantly testing, incidents caused by regressions or missed updates drop significantly. In regulated industries or fast-moving markets, this kind of responsiveness isn’t just a nice-to-have, it can be the difference between leading and lagging behind.
Zerg is already proving that the Just-in-Time Software paradigm isn’t just academic musing, but real and deployable. It shows that even mission critical domains like cybersecurity, where there are many moving parts and constant updates – can be managed by a fleet of tireless AI agents, with humans in the loop only for high-level guidance and final oversight.
Implications of Just-in-Time Generative Software
If software can truly write and re-write itself on the fly, the implications are enormous. We’re talking about nothing less than a fundamental shift in how we think about software development. It’s a shift from manually managing static artifacts (codebases, branches, build pipelines) to orchestrating dynamic processes that produce software just-in-time. Here are a few strategic implications and opportunities this new paradigm opens up:
Speed and Adaptability: Companies that embrace just-in-time generation will operate on real-time development cycles. When a new market opportunity or customer request comes up, they can ship a solution immediately. This compresses the product feedback loop to near-zero. Business strategy can be more experimental because the cost of trying out a new feature is so low – if it doesn’t work out, you haven’t sunk months into building and integrating it, you simply drop the manifest and move on.
Reduced Maintenance and Tech Debt: The traditional 70/30 split – where 70% of software cost is maintenance – could be turned on its head. Continuous regeneration and self-healing mean the maintenance is largely automated. Organizations can dramatically reduce the slog of patching, updating dependencies, and battling rot. This doesn’t just save money; it also liberates developer creativity. Developers become more like product designers and strategists, since the repetitive coding tasks are handled by AI. The talent you have can focus on differentiation instead of upkeep.
New Roles and Skills: The role of a software engineer will evolve. Instead of crafting every line of code, engineers will specify desired outcomes, constraints, and high-level architecture. It’s less writing code, more directing code. Deep domain expertise and fundamental understanding become even more important, engineers will be designing outcomes and letting generative software flesh out the rubber-meets-the-road implementation of it. In a way, we move up another level of abstraction: from writing in programming languages to writing in requirements or even plain English and letting the AI grow that to code.
Companies that master just-in-time software will gain a massive competitive edge. They’ll iterate faster, ship more reliable products, and respond to change with agility that others simply can’t match. This paradigm opens new strategic opportunities: smaller teams delivering outsized output, new kinds of products that were too costly to maintain before, and possibly even new business models.
Embracing the Just-in-Time Revolution
Just-in-Time Software represents a leap in abstraction, where we stop treating code as a precious artifact to be managed and start treating it as a byproduct of a higher-level intent. Code becomes transient, valuable only insofar as it achieves the goal and utterly disposable once it has done so.
For those willing to embrace this shift, this is a thrilling time. It means that a startup can potentially compete with far larger incumbents by leveraging autonomous code generation to move faster and pivot effortlessly. It means that tech teams can focus on creative problem-solving and leave the drudgery to the machines. It means customers (and users) get software that molds itself to their needs, instead of the other way around.
Like any paradigm shift, the move to living, self-writing software won’t happen overnight. But it’s clearly underway. We can already see hints of it in how AI agents solve problems with ephemeral code, and in platforms like Zerg delivering 24/7 autonomous coding capacity to organizations. The trajectory is set: software development is moving from an artisanal craft to an automated, adaptive process.
We are witnessing the dawn of a new era – one where living software continuously adapts, and the winners will be those bold enough to ride this wave from the start.
The Goal - https://en.wikipedia.org/wiki/The_Goal_(novel)