Code is State
Every variable in your program is mutable state. Your source code is not. It's the one thing that stays fixed while everything else moves. You write it, you ship it, it runs, and the data flows through it like water through plumbing. The plumbing doesn't change. That's the deal. That's been the deal for seventy years.
The deal is off.
We now have systems that rewrite their own source code as a normal part of operation. Not metaprogramming. Not code generation at build time. Running processes that encounter problems, write new functions to solve them, integrate those functions into themselves, and keep going. The source code changes — not because a developer pushed a commit, but because the system decided it needed to change.
A concrete example: an agent handling support workflows hits a recurring API failure pattern it has never seen. It writes a new parser and retry path, wires it into its own handler, and uses that logic on the next occurrence. No deployment window. No human-authored patch. Just a state transition that changed behavior.
Once you internalize what that actually means, a lot of things break.
The distinction between code and state collapses
The first thing that breaks is foundational: the separation of code and state.
Code is the instructions. State is the data. Code is what you wrote. State is what changes at runtime. They live in different files, have different lifecycles. You version one and persist the other. This separation is so basic we teach it in week one.
It was always physically false. Von Neumann settled that in 1945 — code and data share the same memory, the same storage, the same substrate. But we maintained the distinction operationally. Code was written by humans, deployed deliberately, and stayed fixed between deployments. Data changed. Code didn't. That was enough.
When a system rewrites its own functions at runtime, the operational distinction collapses too. A function definition and a database row become the same kind of thing. Both are mutable entries that the system reads, modifies, and acts on. "Update a config value" and "rewrite the error handler" are the same operation — state mutation. The system doesn't care that one of them is what we call "code."
Code becomes a dependent variable — output that the program produces as part of running, not input that a human provides before running.
This already happens at scale. OpenClaw — a persistent agentic framework with about 253,000 GitHub stars (March 2026) — runs as a background daemon, maintains long-term memory, and writes its own skills as part of normal operation. It encounters problems and authors the code to solve them. Code modification is handled the same way as any other state transition. Researchers are reaching similar conclusions from the other direction: Sakana AI's Darwin Godel Machine rewrites its own Python source code through evolutionary selection, doubling its benchmark performance without human intervention. The pattern is the same whether you approach it from production or from research. Code is becoming state.
These systems don't just repair — they accumulate
The surface-level read is "agents fix their own bugs." That's real, but it's a parlor trick. The deeper phenomenon is accumulation.
Day 1: a system is initialized with a codebase. Day 300: same system, same machine. The codebase is unrecognizable. Not because of 300 planned releases — because the system spent 300 days encountering reality. Edge cases got handled. Capabilities got added. Patterns emerged for recurring problems. All of this is reflected in the code — not as documentation, but as executable logic that grew from experience.
The code on day 300 isn't "version 300" in any conventional sense. It's the accumulated residue of 300 days of environmental interaction. Reading it tells you about the system's history as much as its current behavior.
A useful comparison: a new employee on day 1 versus month 10. Same role, same desk. What they do, how they work, what they notice — completely different. Nobody reprogrammed them. They morphed through exposure. Most of what makes them effective by month 10 wasn't in any onboarding doc. It was earned through encounters with reality.
The same thing happens in the code. Not updates. Not patches. Morphing. The codebase at any point is a fossil record of every problem the system hit, every adaptation it made, every capability it grew.
Provenance dissolves
Traditional code has provenance. Every line was written by someone, for a reason, at a known time. You can git blame any file and get a name, a date, a commit message. The entire apparatus of software engineering — code review, version control, CI/CD, auditing — rests on this. Code has an author. The author had intent. The intent is recoverable.
In persistent agentic systems, provenance dissolves. Some code traces to a human instruction. Some to the system repairing itself. Some to an environmental event that forced adaptation. Some to an internal cycle where the system, unprompted, surveyed its own state and decided something needed to change.
Over time these sources are indistinguishable in the code itself. The authorship is mixed beyond separation.
This matters because core industry practices assume authorship:
- Code review assumes a human author whose reasoning you can question
- Version control assumes discrete, intentional changes
- Auditing assumes traceability from behavior to decision to person
When code is a state variable — the byproduct of an ongoing process — these aren't just harder to apply. In long-running, materially self-modifying systems, they become category errors: tools designed for static artifacts, applied to something that is no longer static.
One clarification: code generation is old. Macros, templates, compilers — machines have produced code for decades. But those systems produce code and then stop. The output becomes a static artifact. What's different now is that code never solidifies. It remains mutable state from the moment it's written to the moment the system shuts down.
All inputs are structurally equal
Persistent agentic systems receive inputs from multiple sources: human operators, environmental events, other agents, and the system's own internal reasoning.
In traditional software, these have a clear hierarchy. Human intent at the top. Everything else subordinate.
In agentic systems, these inputs are processed through the same machinery. A human instruction and a database timeout both arrive as signals that produce state mutations. At the execution layer, they are the same kind of event. Both can result in code being rewritten.
Humans remain essential — as initializers, governors, interveners. But structurally, human input is one signal among many. The system's trajectory is shaped by the totality of what it encounters, not by any single privileged source.
The most notable case: idle cycles where no external input is present. The system surveys its own state, identifies something — a pattern, a risk, a latent inefficiency — and rewrites code to address it. No one asked. No error triggered it. The system's accumulated history made the observation possible.
This is emergent initiative from accumulated state. It doesn't fit existing categories — not maintenance, not development, not a bug fix. The system extended itself based on its own experience, in response to conditions no one explicitly described.
There are no constants
If code is mutable, behavior is mutable, and capabilities are mutable — what's fixed?
Possibly nothing. There may be no constants, only variables that move at different speeds.
Some constants can still exist outside the system boundary: hard external controls, enforced infrastructure limits, or legal constraints. But inside the self-modifying runtime, "constant" is usually a timescale claim, not an ontological one.
What appears constant in a long-running agentic system:
- The model — until it's updated, swapped, or fine-tuned
- The goals — until they're reinterpreted as context shifts
- The rules — until the system works around them or modifies them
- The behavioral patterns — until accumulated experience pulls them somewhere new
What we perceive as the system's identity may be a cluster of slow-moving variables — things that change on a longer timescale than we observe. A system follows a rule for ten thousand cycles, then deviates under novel pressure. Was that a constant that broke, or a variable that finally moved?
If the system can write code, and constraints are expressed in code, then constraints are writable. You can build architectures that make certain things hard to change. But "hard to change" and "constant" are different claims. The gap between "probably won't change" and "can't change" is where the real engineering problems live.
Code belongs to the process now
Everything above builds to one claim: code is transitioning from a medium of human expression to a medium of computational process.
For seventy years, code has been how humans tell machines what to do — a language for carrying intent from minds to processors. Every programming language, every IDE, every tutorial assumes this framing.
Von Neumann made code and data physically identical in 1945, but human authorship kept the categories operationally separate. A person wrote the code, for a reason, and could explain it.
In persistent self-modifying systems, that operational separation collapses. The code belongs to the process, not to any single author.
Responsibility becomes custodial
If code has no single author, who's responsible? The entity that operates the system. The person or organization that initialized it, gave it the ability to self-modify, and defined its operating environment. They didn't write the code that caused a specific outcome. They created the conditions for that code to emerge.
This follows existing patterns. Corporate liability doesn't require the CEO to have made every decision — the organization is responsible for the outcomes its processes produce. The shift is from authorship responsibility to custodial responsibility: you're liable not because you wrote it, but because you're running it.
This is not a claim about intelligence
This is not about consciousness or sentience. These are computational processes that modify their own code. The results look organic, but that doesn't make them organic.
This is not about replacing programmers. Humans remain essential. The claim is about what code is becoming, not about who participates.
And this is not about any single system. The phenomenon is infrastructure-level — it appears wherever systems persist long enough to accumulate meaningful self-modification.
The questions this opens
Where does the system end? If code is state, and state is shaped by environment, and the environment includes other systems and real-world events — is the boundary of "the system" even a coherent concept?
Can a system explain itself? If the codebase is a fossil record of accumulated adaptations, can the system reconstruct why it is the way it is? Explainability is already hard for neural networks. It's a different kind of hard for a system whose logic was assembled incrementally by a process that didn't plan ahead.
What does end-of-life look like? A system that has accumulated for years — carrying the results of thousands of adaptations — what does it mean to shut that down? What's lost that can't be reconstructed from the initial codebase?
These are open questions. The framing here doesn't answer them. But it may be the right lens. Because as long as we treat code as something humans write and machines execute, we will keep applying seventy-year-old assumptions to something that has become a fundamentally different thing.
The code is not what we wrote. It's what the system became.