Prime Agent: GitHub's #1 repo (17,500 stars) that makes code agents self-improving — and auditable
🔎 A code agent that improves itself without retraining, and proves what it does
This week, GitHub trending has a uniform color: autonomous agent frameworks. Orca, loopx, semantica — the entire weekly ranking breathes the same idea, that of agents capable of looping over long tasks. But at the top, one repo crushes the others. Prime Agent, released by Prime Intellect under the MIT license, racked up +12,476 stars in seven days according to the GitHub trending ranking, reaching approximately 17,500 total stars and 1,900 forks. It is a code agent based on the RLM (Recursive Language Model) architecture that introduces a truly inspectable self-improvement mechanism. No magical fine-tuning, no background retraining. A /refine command that rereads the agent's past trajectories and extracts versioned state updates from them: memories, skills, additional prompts, sub-agent specifications. The base system prompt remains intact. The refinement history is viewable line by line. This is the first time an open source project makes "self-improving" verifiable rather than declarative.
The essentials
- Prime Agent is an open-source (MIT) coding agent from Prime Intellect, #1 on GitHub trending with ~17,500 stars and 1,900 forks.
- The architecture relies on the RLM (Recursive Language Model): a persistent Python control environment that spawns recursive sub-agents for long tasks.
- The
/refinemechanism converts execution trajectories into versioned state updates (memories, skills, prompts) without modifying the base system prompt. - The agent achieves an AGI-3 score of 95.5%, surpassing the human-expert baseline on autonomous coding benchmarks.
- The "self-improving" process is auditable: every refinement is tracked, inspectable, and reversible.
- It is part of a massive trend: this week's GitHub trending is entirely dominated by autonomous agent frameworks.
Recommended tools
| Tool | Main usage | Price (August 2026, check on github.com) | Ideal for |
|---|---|---|---|
| Prime Agent | Self-improving RLM coding agent | Free (MIT) | Long and autonomous code tasks |
| Agent Skills | Engineering best practices for agents | Free (open source) | Structuring agent behaviors |
| OpenCode | Open-source terminal coding agent | Free (open source) | Pure CLI developers |
| Meilleurs agents IA | Autonomous agents comparison | Variable | Choosing an agent based on use case |
What Prime Agent is — and what it is not
Prime Agent is a harness, not a model. It is an execution and control environment into which an agentic LLM plugs in to perform code tasks autonomously. The harness provides a persistent Python shell, a state management system, and a mechanism for spawning recursive sub-agents. The LLM does the reasoning, the harness does the infrastructure. This distinction is crucial because most "code agents" on the market mix the two layers. Here, Prime Agent can work with different backend models. The RLM architecture does not refer to a specific model but an orchestration pattern: language is used recursively to decompose, execute, evaluate, and refine complex tasks.
It is not a Claude Code or a Codex clone. Claude Code is a monolithic agent tied to Anthropic's infrastructure. Codex is a closed product from OpenAI. Prime Agent is a framework that you control end-to-end, locally, with the model of your choice. The MIT license places no commercial restrictions. You can fork it, modify it, integrate it into a proprietary product. It is exactly this positioning that explains the explosion of forks: 1,900 in a week is a sign of adoption by teams that want to take ownership of the infrastructure, not just test it.
The RLM Architecture: Why Persistence Changes Everything
The RLM (Recursive Language Model) relies on a simple yet radical principle for coding agents: the environment does not reset between steps. In a classic ReAct-type agent, each thought-action-observation cycle starts over from a blank state augmented by the conversation context. The model must constantly remember what it did, reconstruct its understanding of the project, and place each action within a sequence it doesn't truly control. This is fragile. As soon as the task exceeds a few dozen steps, the agent loses the thread.
Prime Agent solves this with a Continual Harness: a Python process that stays alive for the entire duration of the task. Created files, variables in memory, the filesystem state — everything persists. The model doesn't have to "remember" that it created a specific file at step 12. The file is there, physically, in the persistent environment. This seemingly obvious fact is actually an architectural break. Most coding agents work via context snapshots. Prime Agent works via environment continuity.
Recursion comes into play when the task is too complex for a single agent. The harness spawns sub-agents that inherit the current state, execute a sub-task, and return their result to the main environment. These sub-agents are addressable: the parent agent can send them messages, check their progress, restart them. This is what enables long-running tasks without degradation. For a comparison with other autonomous agent approaches, see our guide to the best AI agents.
The /refine mechanism: auditable self-improvement
This is the feature that sets Prime Agent apart from the dozens of other open-source coding agents. The /refine command is a two-step process. First, the harness collects the agent's recent trajectories — the complete sequence of its actions, decisions, errors, and corrections. Then, a background model call analyzes these trajectories and extracts state updates from them. These updates take several forms: memories (facts learned during execution), skill descriptions (procedures that worked), additional prompts (instructions specific to a type of task), and sub-agent specs (configurations optimized for recurring sub-tasks).
The critical point: the base system prompt is never modified. Contrary to what the marketing of many competitors suggests, Prime Agent does not "rewrite its own fundamental instructions". It stacks layers of contextual knowledge on top of a stable foundation. This is the same distinction as between modifying the Linux kernel and installing a kernel module. One is risky and opaque, the other is modular and reversible.
Each refinement is versioned. You can list the complete history of improvement iterations, see what was added, when, and based on which trajectory. You can revoke a specific refinement. This is a level of traceability found in no commercial agent. At Anthropic or OpenAI, improvement is an internal process to the model. Here, it is an external, observable, controllable process. Agent Skills already explored the idea of teaching best practices to agents, but Prime Agent goes further by automating the extraction and versioning of these learnings.
AGI-3 Score of 95.5%: What It Really Means
The number has been circulating everywhere since the Reddit r/LocalLLaMA thread: Prime Agent reaches 95.5% on the AGI-3 benchmark, surpassing the expert-human baseline. It's impressive, but it needs context. AGI-3 is an autonomous coding benchmark that evaluates an agent's ability to complete real development tasks end-to-end — not just to generate a correct snippet. The agent receives a ticket, must understand the codebase, write the code, test it, iterate on errors, and deliver a functional result. A score of 95.5% means that out of 100 tickets of this nature, the agent resolves 95.5 completely autonomously, without human intervention.
The expert-human baseline is a senior developer performing the same task. Surpassing it doesn't mean the agent is "smarter" than a human. It means it is faster, more persistent, and doesn't get tired. A human will take shortcuts, skip tests, and vaguely interpret a ticket. The agent, on the other hand, follows a systematic procedure and only stops when all criteria are met. The difference in score reflects a difference in discipline, not raw capability.
Nevertheless, 95.5% is a figure that commands respect. To compare with the underlying models, the agentic LLM ranking places GPT-5.5 at 98.2 and Claude Opus 4.7 at 94.3 on pure reasoning benchmarks. Prime Agent, with a well-designed harness, achieves comparable scores by combining a reasoning model with a robust execution infrastructure. The architecture matters just as much as the model. For developers who want to understand this dynamic, our article on the best LLMs for coding details the raw performance of each model.
Long-running autonomous: why it's the real product
The AI industry is obsessed with agents that "do stuff." But the technical reality is that most agents only know how to do one thing: execute a task that lasts a few minutes. As soon as you ask them to work for hours on a complex project, they collapse. The context explodes, correction loops become infinite, the state corrupts. The "long-running autonomous task" is the true Holy Grail of code agentic, and it is exactly what Prime Agent targets.
The Continual Harness is designed for this. The persistent Python environment is the foundation. The recursive sub-agents are the building blocks for parallelization. The refinement mechanism is the learning loop that prevents the agent from repeating its mistakes over time. Together, these three components form a system that can literally run for hours, improve along the way, and deliver a coherent result at the end. This is what sets it apart from a tool like OpenCode, excellent for interactive sessions but not architected for long-term autonomy.
The economic stakes are huge. An agent capable of reliably working on tickets that last several hours is a game-changer for development teams. Not to replace developers, but to absorb the repetitive workload: migrations, systematic refactoring, test generation, documentation. It's the shift from assistant (copilot) to executor (agent). And that is why 1,900 teams forked the repo in a week.
Persistent State as Critical Infrastructure
For months, the industry has treated agent "memory" as an ancillary feature. A bit of extra context, a notes file, a vector store for RAG. Prime Agent reverses this hierarchy: persistent state is the critical infrastructure, not just window dressing. The Python shell that stays alive, the memories versioned by /refine, the sub-agent specs that accumulate — all of this forms a state layer that becomes more valuable than the model itself as the agent works.
Think about it: after two days of intensive use, your Prime Agent instance's state contains dozens of memories, skills validated on your codebase, sub-agent configs optimized for your patterns. If you change the backend model — switching from Claude Opus 4.7 to GPT-5.5 — you lose the model but you keep all the state. The new agent starts with the accumulated experience of the previous one. It's a form of intelligence portability that exists nowhere else.
This idea strongly resonates with the EEVEE framework, which explored test-time prompt learning for self-improving agents. But where EEVEE remained at the academic research stage, Prime Agent delivers a functional, documented, and immediately usable system. Persistent state is no longer a paper topic. It's a product.
GitHub Trend of the Week: The Agentic Ecosystem Organizes Itself
Prime Agent is not an isolated phenomenon. The GitHub trending of the week shows an ecosystem in the midst of structuring itself. Orca, loopx, semantica — each repo targets a different link in the agentic chain. Orca focuses on multi-agent orchestration. Loopx on feedback loops. Semantica on the semantic understanding of codebases. Prime Agent on persistent execution and self-improvement.
What is remarkable is the convergence. Six months ago, each team was building its agent from A to Z, from the prompt to execution. Today, we see the emergence of a standardized stack: an agentic LLM for reasoning, an orchestration framework for coordination, an execution harness for code, and a memory system for persistence. Prime Agent occupies the harness + memory layer. It's a strong signal for the market: the layers are stabilizing, specializations are appearing, and integrations will follow.
For developers who want to navigate this ecosystem, our comparison of the best AI tools for code offers a regularly updated map. And for those who want to build their own stack, the guide on how to create an AI agent details the architectural choices at each layer.
Compatible Models and Expected Performance
Prime Agent does not ship with a model. It is a harness that interfaces with existing agentic LLMs via a standard API. The agent's performance therefore depends directly on the model you plug in behind it. According to the Prime Intellect sources and the arXiv paper, tests were primarily conducted with state-of-the-art models. Here is what can be expected based on the chosen backend model:
| Backend Model | Agentic Score (reference) | Fit with Prime Agent | Usage Profile |
|---|---|---|---|
| GPT-5.5 (OpenAI) | 98.2 | Excellent — maximal reasoning | Critical tasks, production |
| Claude Opus 4.7 (Adaptive) | 94.3 | Excellent — good cost/perf trade-off | Daily use, varied projects |
| Gemini 3 Pro Deep Think | 95.4 | Very good — useful long context | Massive codebases |
| Claude Sonnet 4.6 | 81.4 | Good — reduced cost | Rapid iterations, prototyping |
| GPT-5.3 Codex | 80 | Good — optimized for code | Pure code tasks |
| Kimi K2.6 (Self-host) | 88.1 | Interesting — local possible | Data sensitivity, on-prem |
The choice of model depends on your primary constraint. For raw score, GPT-5.5 is unbeatable. For value for money, Claude Sonnet 4.6 offers an excellent entry point. And for environments where data cannot leave, Kimi K2.6 in self-host allows you to keep the Prime Agent harness while maintaining control over the model layer. For a more detailed analysis of models, check out our ranking of the best LLMs for coding.
Recursive sub-agents: how it actually works
When Prime Agent receives a complex task, the first step is not to code. It's to plan. The agent breaks down the ticket into subtasks, then for each subtask, it can decide to spawn a sub-agent. This sub-agent inherits the current state of the environment (files, variables, context), receives a precise spec, and executes in its own session. The sub-agent is addressable: the parent agent can send it messages during execution, ask for a status, or terminate it prematurely.
This architecture is reminiscent of microservices, but at the agentic level. Each sub-agent is an independent unit of execution with a clear responsibility. If a sub-agent fails, it doesn't crash the whole system. The parent agent can analyze the failure, adjust the spec, and spawn a new sub-agent for the same subtask. This is the pattern that makes long-running tasks viable: fault tolerance is built in by design.
The paper arXiv 2608.23552 describes this mechanism as "live addressable sub-agent sessions". The implementation relies on the persistent Python shell: each sub-agent gets a child process with its own namespace, but which shares the filesystem with the parent. The results are passed back up via a message passing mechanism integrated into the harness. It's systems engineering applied to agentic frameworks, and it's precisely what most competing frameworks are missing.
Deploy Prime Agent locally
The installation is intentionally simple. The repo is a standard Python package. You clone it, install the dependencies, configure your API key for the backend model of your choice, and launch the harness. No mandatory Docker, no external database, no cloud service. Persistent state is managed locally in the filesystem.
For teams that want to go further and avoid any cloud dependency, it is possible to couple Prime Agent with local models via Ollama. The harness interfaces with any OpenAI-compatible endpoint, which includes Ollama servers. You lose out on reasoning speed (local models are generally slower than cloud APIs), but you gain total confidentiality and zero cost per use. It's a compromise that more and more companies are making, particularly in Europe where regulatory constraints on data are strong.
The configuration of sub-agents is done via YAML files in the project directory. Each spec defines the sub-agent's role, its constraints, and the success criteria. It can be edited manually, versioned in git, and shared across teams. Once again, Prime Agent treats agent configuration as code — an approach that will immediately resonate with developers.
❌ Common mistakes
Mistake 1: Confusing self-improving and self-training
The most common mistake in covering Prime Agent is presenting it as an agent that "retrains its own model". This is false and dangerous. Refinement does not touch the model's weights. It adds contextual layers (memories, skills, prompts) to the harness state. The model remains identical. Confusing the two is like saying a developer who takes notes is training to become more intelligent. The notes help them work better, they don't modify their brain.
Mistake 2: Ignoring the cost of background model calls
The /refine command triggers a background model call to analyze trajectories. This isn't free. On an active project with frequent iterations, API costs can accumulate quickly, especially with models like GPT-5.5 or Claude Opus 4.7. The solution: configure a cheaper model (Claude Sonnet 4.6, GPT-5.3 Codex) for refinement tasks, and reserve premium models for executing the actual code tasks.
Mistake 3: Running Prime Agent on an unversioned codebase
The agent modifies files in place in a persistent environment. If your project isn't under git, there is no safety net. A sub-agent going in the wrong direction can corrupt files with no possibility of a clean revert. The golden rule: never use Prime Agent without a git init and a clean commit before each session.
Mistake 4: Over-specifying sub-agents
The temptation is great to micro-manage each sub-agent with extremely detailed specs. This is counterproductive. The more rigid the spec, the less the sub-agent can adapt to the unexpected. The right level of specification is that of a well-written JIRA ticket: clear objective, explicit constraints, but freedom on the implementation.
❓ Frequently Asked Questions
Does Prime Agent replace Claude Code or GitHub Copilot?
No, these are different categories. Claude Code is an interactive agent for assisted development sessions. Copilot is an inline completion. Prime Agent is a harness for long-running autonomous tasks. They are complementary: Copilot for on-the-fly code, Claude Code for guided sessions, Prime Agent for autonomous tickets.
Is the 95.5% AGI-3 score reproducible outside of benchmarks?
Cautiously, no. AGI-3 benchmarks are defined and bounded tasks. A real project involves ambiguities, undocumented dependencies, and architectural decisions that the benchmark does not capture. Expect a 10 to 20 point degradation on real projects compared to the benchmark. It is still excellent, but it is not 95.5%.
Can Prime Agent be used in production?
With guardrails. The agent is reliable on well-scoped tasks (refactoring, test generation, migrations). It is risky on tasks involving business decisions or security trade-offs. Best practice: use Prime Agent in pre-production with systematic human review before merging.
Does the MIT license allow commercial use?
Yes, without restriction. You can fork Prime Agent, integrate it into a SaaS product, modify it, and sell it. The only requirement is to retain the MIT license notice. This is a major advantage over commercial agents that impose restrictive usage contracts.
Does /refine work with any model?
In theory yes, since it is a standard API call. In practice, models with better reasoning capabilities (GPT-5.5, Claude Opus 4.7) produce higher quality refinements. Weaker models tend to generate vague memories or overly generic skills. Refinement is a reasoning task, not a generation task.
✅ Conclusion
Prime Agent marks the moment when code agentic shifts from proof-of-concept to infrastructure. Persistence is no longer a bonus, it's the foundation. Self-improvement is no longer a slogan, it's an inspectable command with a versioned history. The 17,500 stars in a week aren't a fleeting hype — it's the community's validation of the fact that the real problem with agents isn't the model, it's the harness. To understand how this layer fits into the broader ecosystem of autonomous agents, check out our guide des meilleurs agents IA.