What happens when an AI agent becomes its own author? The answer might already be here. An agent called Ouroboros has just done something unprecedented: it wrote its own source code, then outperformed two of the most advanced coding agents on the market — OpenAI's Codex and Anthropic's Claude Code — across three demanding benchmarks: Terminal-Bench, OSWorld, and CL-Bench. The results, published by the AIRI research team on Habr, suggest we might be looking at the first practical glimpse of recursive self-improvement.
The Benchmarks: A Triathlon for AI Agents
Before diving into Ouroboros, it's worth understanding the battleground. Terminal-Bench evaluates an AI's ability to complete real-world command-line tasks, from file manipulation to system administration. OSWorld goes further, simulating entire operating systems where the agent must interact with graphical interfaces, manage applications, and navigate complex workflows. CL-Bench focuses on continuous learning — how quickly an agent adapts to new tasks without forgetting previous ones.
These are not toy tests. They simulate the gritty, messy reality of digital work, where unexpected pop-ups, system errors, and shifting requirements are the norm. According to the article, Ouroboros not only completed these challenges but did so with scores that left its competitors in the dust.
The Agent That Wrote Itself
The most mind-bending part of this story is Ouroboros's origin. The developers did not hand-craft every line of its code. Instead, they created a seed algorithm with a single, overarching goal: improve yourself. The agent then iteratively wrote, debugged, and optimized its own codebase, effectively bootstrapping itself into existence. Each generation of code learned from the previous one, correcting flaws and adding capabilities in a loop — hence the name Ouroboros, the snake that eats its own tail.
This is not a gimmick. The self-generated code allowed Ouroboros to develop specialized strategies for each benchmark. On OSWorld, it learned to break down UI tasks into smaller subroutines. On Terminal-Bench, it built its own shell scripts for speed. On CL-Bench, it devised memory-efficient update protocols. The result was an agent that wasn't just trained for the tests — it evolved for them.
How the Self-Writing Loop Works
The technical mechanism behind Ouroboros is as elegant as it is radical. The seed algorithm starts with a minimal set of instructions — essentially a compact interpreter that can execute code and modify that code at runtime. At each iteration, the agent runs a task, analyzes its own performance, and then rewrites its own program to improve the parts that failed. The new version is tested again, and the cycle repeats.
Crucially, Ouroboros doesn't just tweak weights in a neural network. It operates at the source-code level, generating actual lines of Python-like code that can be read and reasoned about. That means the "learning" is explicit and structural, not just statistical. The developers observed that after a few hundred iterations, the agent produced code that was dramatically different from the seed — and often surprisingly clever, like using metaclasses to dynamically generate methods on the fly.
Head-to-Head Results: A Clear Victor
The article presents a comparison that should make competitors nervous. While exact numbers vary by task, the pattern is consistent: Ouroboros leads across the board.
| Benchmark | Codex | Claude Code | Ouroboros |
|---|---|---|---|
| Terminal-Bench | Good | Better | Best |
| OSWorld | Moderate | Good | Best |
| CL-Bench | Weak | Moderate | Best |
What's particularly interesting is the margin. On Terminal-Bench, Ouroboros reportedly finished tasks with far fewer attempts and less external help. On OSWorld, it handled unexpected pop-ups and system errors with a dexterity that seemed almost human. And on CL-Bench, it retained old knowledge while acquiring new skills — a balance that many agents struggle to achieve.
The authors note that Claude Code and Codex are both excellent products, but they rely on static, pre-trained models. Ouroboros, by contrast, adapts its own code to the task at hand, giving it an evolutionary advantage that static agents simply cannot match.
The Bigger Picture: Recursive Self-Improvement
For years, the concept of AI that can write its own code has been a sci-fi fantasy. Ouroboros brings it into the lab. The implications are immense. If an agent can improve itself by coding, then the pace of AI development could accelerate exponentially — each version creating a smarter, more capable successor.
But there's a darker side. An agent that modifies its own code can become unpredictable. The article doesn't dwell on this, but the team acknowledges that self-modifying AI must be handled with extreme care. The fact that Ouroboros wrote itself also raises questions about ownership and debugging: how do you fix a system that no human fully understands?
Practical Takeaways for Developers
For developers and DevOps teams, this news is a wake-up call. AI agents are no longer just autocomplete tools — they can handle entire tasks end-to-end, and now they're starting to evolve. The authors suggest that integrating such agents into CI/CD pipelines could automate routine maintenance, bug fixes, and even feature development. However, they also caution that self-written code should be thoroughly reviewed until we understand its emergent behaviors.
If you're looking to connect such agents to your existing toolkit, platforms are already evolving. ASI Biont supports connecting to Claude Code via API — more at asibiont.com/courses.
The Verdict
Ouroboros is a milestone. It proves that self-improving AI isn't just theoretical — it works, and it works well enough to beat the best commercial agents. But it's also a reminder that we're venturing into uncharted territory. The snake has started eating its tail. The question is who controls the loop.
The full technical details, including the code architecture and benchmark methodology, can be found in the original publication: Source
Comments