The Coding Agent Bootstrap

by Martin Monperrus

Compiler writers discovered decades ago that a new language implementation passes a meaningful milestone when it can compile itself. This property, called self-hosting, is not merely a curiosity: it validates that the implementation is expressive enough to describe its own behavior.

The same milestone has been reached for AI coding agents: given only a specification, a coding agent can implement itself.

The Experiment

The experiment has three steps, each building on the previous one.

Step 1: specification. A large language model (LLM) was prompted to write a specification for a coding agent: a program that receives a task in natural language and produces or modifies source code to perform the task. The resulting document defines the agent’s interface, its expected behavior, and the constraints it must respect. It is available at https://github.com/ASSERT-KTH/meta-circular/blob/main/spec.md.

Step 2: first implementation. Claude Code, an existing coding agent, was given the specification and asked to implement it (model Sonnet 4.6). The result is a working Python program (agent.py) that satisfies the spec. No single change was needed.

Step 3: self-implementation. The newly generated agent was given the same specification and asked to implement it again. It succeeded. The agent implemented itself.

The Meta-Circular Concept

Lisp to coding agents The term meta-circular comes from the Lisp tradition. In 1960, John McCarthy presented a Lisp interpreter written in Lisp itself [1]. The interpreter is called meta-circular because the language in which it is written is the same language it interprets.

The coding agent experiment follows the same pattern. The agent that was generated in step 2 is, in the terminology above, a meta-circular agent: it is an implementation of “coding agent behavior” produced by a system that itself exhibits “coding agent behavior.” When the step-2 agent reproduces itself in step 3, it demonstrates meta-circularity in the operational sense: the agent is a fixed point of its own implementation procedure.

Self-hosting Let F be the function that maps a specification to an implementation satisfying that specification. Let s be the coding agent specification and a0 the first implementation (produced by Claude Code). Then:


a0 = F(s, Claude Code)


a1 = F(s, a0)

The claim is that a1 is observationally equivalent to a0: both satisfy s. If we define equivalence operationally as “passes the same tests against the spec,” then the sequence a0, a1, a2, … converges immediately. The first self-generated implementation already satisfies the spec. This is the coding-agent analogue of a self-hosting compiler: the first generation is good enough that the second generation is indistinguishable from it under the spec. The spec, not the bootstrap tool, is the stable artifact.

Implications

Code review This result has a practical implication. If a specification is sufficient to generate an agent, and the agent is sufficient to re-generate itself from the same specification, then the specification is the true locus of correctness. Improving the agent means improving the specification. The implementation becomes, in principle, disposable and regenerable at any time. Reviewing the agent means auditing its specification [5].

Security implications. Ken Thompson’s 1984 Turing Award lecture, “Reflections on Trusting Trust,” noted that once a self-hosting compiler exists, a trojan horse inserted into the compiler binary can reproduce itself through every subsequent compilation. This fundamental trust question can now be transplanted to coding agents: which artifacts do we trust? the specification, the model weights, the first-generation agent, or the environment in which it runs?

Attractor by StrongDM is the same [6]. The main difference is that Attractor is way more complex: Attractor’s spec is ~34900 words, ours is 926 words. This makes our repo more appropriate for learning. The other cool thing about Attractor is that the repo only contains the spec.

codeagent> Implement Attractor as described by https://github.com/strongdm/attractor

Conclusion

A coding agent can bootstrap itself. Starting from a specification and a first implementation produced by an existing agent, a newly generated agent re-implements the same specification correctly.

This reproduces, in the domain of AI coding agents, the classical bootstrap sequence known from compiler construction, and instantiates the meta-circular property known from Lisp.


Acknowledgements

I’d like to thank StrongDM, the recent hyperactive AI-augmented developers and all participants of the Bellairs’26 Workshop on Continuous Software Engineering.

To cite this post

@misc{coding-agent-bootstrap,
  author={Martin Monperrus},
  title={The Coding Agent Bootstrap},
  year = {2026},
  howpublished = {https://www.monperrus.net/martin/coding-agent-bootstrap}
}

References

[1] J. McCarthy, “Recursive functions of symbolic expressions and their computation by machine, Part I,” Communications of the ACM, vol. 3, no. 4, pp. 184-195, 1960.

[3] K. Thompson, “Reflections on Trusting Trust,” Communications of the ACM, vol. 27, no. 8, pp. 761-763, 1984.

[5] A. Osmani, “Code Review in the Age of AI,” Elevate (Substack), Jan. 5, 2026. https://addyo.substack.com/p/code-review-in-the-age-of-ai

[6] StrongDM, “Attractor,” GitHub repository, 2026. https://github.com/strongdm/attractor