
Prime Intellect · Prime Agent: Open-Source Self-Improving RLM Coding Agent for Long-Running Work
Prime Agent is Prime Intellect's open-source (MIT) terminal coding and research agent. Instead of a fixed set of tool calls, it works through a persistent Python REPL where files, shell commands, tools, and recursive subagents are all called as code, and it can refine its own prompts, memories, and skills as it goes. It suits developers and AI researchers who run long, autonomous coding tasks or evaluations and want to choose their own models.
Best for
Developers and AI researchers who run long or autonomous coding and research tasks in the terminal, want parallel subagents and a harness that learns from its own sessions, and are comfortable sandboxing an agent that executes code with their permissions
Not ideal for
Teams that need a stable, supported product, an IDE extension or GUI, or a hosted cloud agent, and anyone who cannot isolate an agent that runs model-written Python and shell commands on their machine
Who it's for
Developers, AI researchers, and evaluation teams who run long-running or autonomous agent workloads from the terminal
Prime Agent is one of the most research-driven open-source terminal agents: rather than adding tools, it gives the model a Python REPL and lets it orchestrate subagents, process context, and edit its own harness state in code. That design pays off on long, autonomous, or context-heavy work, where background sessions, budgets, gate commands, and parallel subagents matter more than a polished interactive experience, and it makes Prime Agent a natural harness for evaluation work. For everyday pair programming, the benefit is less clear, since no model has been trained around this design and the project ships changes almost daily. Treat the self-improvement as a useful, auditable memory and skills layer rather than a guarantee of better results, run it in a sandbox or disposable worktree, and read its published benchmarks as Prime Intellect's own measurements.
Who should use it
Developers and researchers who run long autonomous coding tasks, benchmarks, or evaluations; people who want parallel subagents and programmatic context handling in an open-source agent; and teams experimenting with agents that accumulate reusable skills and memories across sessions.
Who should skip it
Developers who want a stable, supported tool with an IDE extension or GUI, teams that need a hosted cloud agent, and anyone who cannot sandbox an agent that executes model-written code with their permissions.
Open source
Free
Note: Prime Intellect does not charge for Prime Agent itself. Model usage is billed by the provider or subscription you sign in with, including Prime Intellect's own Prime Inference if you choose it.
Available models
Unattended implementation with a test gate
Autonomous mode keeps the agent working within turn, token, and time budgets, and a gate command such as a test suite must pass before the run is allowed to finish, with failed output fed back for another attempt.
Parallel codebase investigation
The parent agent can spawn named subagents to study different modules at once, steer them mid-run with follow-up messages, and collect their results in code, without filling its own context with every file.
Long-horizon agent evaluation
Prime Intellect built Prime Agent as a runtime for long autonomous evaluations: sessions survive terminal disconnects, goals and heartbeats keep runs moving, and every session and subagent stays inspectable in the Agents View.
Prime Agent vs. Pi Coding Agent
Prime Agent is built on top of Pi. Pi stays minimal: a small set of file and shell tools, no built-in subagents or MCP, and TypeScript extensions for everything else. Prime Agent adds a persistent Python REPL as the main tool, recursive subagents with agent-to-agent messaging, self-refining harness state, a background daemon, and autonomous mode. Pi fits developers who want a small agent to shape themselves, and Prime Agent fits people who want long-running orchestration built in.
Prime Agent vs. Claude Code
Claude Code is Anthropic's proprietary coding agent, tuned for Claude models and available in the terminal, IDEs, desktop, and web. Prime Agent is open source and provider-neutral, and it centers on a Python REPL, recursive subagents, and self-refining harness state for long autonomous runs. Claude Code fits teams standardized on Claude that want a mature, supported product, and Prime Agent fits users who want an open, model-agnostic harness they can inspect and modify.
Prime Agent vs. OpenCode
OpenCode is an open-source terminal coding agent with Build and Plan modes, a desktop app, and support for many model providers. Both are open source and model-agnostic, but Prime Agent replaces the usual fixed tool schema with a Python REPL and adds a background daemon, persistent subagents, agent-to-agent messaging, and `/refine`. OpenCode fits developers who want a conventional, interactive coding agent, and Prime Agent fits long-running and research workloads.
What is Prime Agent?
Prime Agent is an open-source coding and research agent from Prime Intellect. It runs in your terminal, works through a persistent Python REPL where tools and subagents are called as code, and can refine its own prompts, memories, skills, and subagent specs over time. It is built on top of the Pi coding agent.
Is Prime Agent free and open source?
Yes. Prime Agent is released under the MIT license and is free to install. You pay for model usage through whichever provider, API key, or subscription you connect with `/login`.
What does "self-improving" mean in Prime Agent?
Prime Agent keeps supplemental prompt notes, memories, skills, and subagent specifications as durable harness state. The `/refine` command reviews the session and applies a small, recorded edit to that state, which can be rolled back by ID. It never rewrites the base system prompt or the model's weights.
How do I install Prime Agent?
Run `curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh` on macOS or Linux, or `irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex` in PowerShell on Windows, then start `prime-agent` in your project directory and run `/login` to choose a provider.
Which models and providers does Prime Agent support?
Prime Agent is model-agnostic. Its provider layer includes Anthropic, OpenAI, Google, Amazon Bedrock, Mistral, Azure, and Prime Intellect's own Prime Inference, and release notes add ChatGPT (Codex) and xAI Grok subscription sign-in. Claude subscription sign-in is offered with a warning that it may violate Anthropic's terms, so an Anthropic API key is the safer choice.
Is Prime Agent safe to run on my machine?
It runs model-generated Python and project commands with your user permissions, and the README says its worker and kernel processes are not a security sandbox. Prime Intellect recommends working in a disposable clone or clean worktree and using an external sandbox for untrusted code, instructions, or skills.
Prime Agent vs Pi: what is the difference?
Prime Agent is built on top of Pi. Pi is a deliberately minimal terminal agent that leaves out subagents and MCP and expects you to add features through extensions. Prime Agent adds a persistent Python REPL as the main tool, built-in recursive subagents with agent-to-agent messaging, self-refining harness state, a background daemon, an MCP catalog, and autonomous mode for long runs.
Earendil Inc.
Developers who want a small, model-agnostic terminal agent they fully control and are willing to extend with their own tools, and teams embedding an agent loop in their own software
Free
Anomaly
Developers who want a terminal-based AI coding agent with no vendor lock-in, the ability to bring any LLM provider, and undo control over agent file changes
FreeAnthropic
Developers and teams who want deep codebase reasoning, multi-file changes, and persistent project instructions in a terminal-friendly or IDE-native workflow
PaidPrime Agent is built on top of the Pi coding agent and organized around two ideas from Prime Intellect's research. The first is the Recursive Language Model (RLM): the model's only built-in tool is a persistent IPython kernel, its context and session history are available there as variables, and file edits, shell commands, MCP tools, and subagents are Python functions. Calling `rlm.spawn(...)` starts a real child agent with its own model, kernel, and history, so the agent can fan work out in parallel, keep children around for follow-ups, and message parents, siblings, or children directly. The second is the Continual Harness: supplemental prompt notes, memories, skills, and subagent specifications are stored as durable state the agent can create, update, and delete. `/refine` reviews the session and applies a small, recorded edit to that layer, never to the immutable base system prompt, and a bad refinement can be rolled back by ID. Around this sits infrastructure for long-running work. A background daemon owns every session, so agents keep running when the terminal closes and can be reattached. An Agents View lists running, idle, and saved sessions and their subagents. `/goal` keeps an objective active across turns, heartbeats and schedules re-enter a session later, and autonomous mode keeps working within turn, token, and time budgets and can require a command such as a test suite to pass before it stops. You sign in to model providers with `/login`; the repository lists clients for Anthropic, OpenAI, Google, Amazon Bedrock, Mistral, Azure, and Prime Intellect's own Prime Inference, and release notes add ChatGPT (Codex) and xAI Grok subscription sign-in. Prime Intellect also positions it as a harness for research evaluation. Its launch post reports 95.5% RHAE Best@1 on ARC-AGI-3 with Opus 5 in autonomous mode, the best of three runs (95.0, 95.2, 95.5) with only the task prompt adapted, and the arXiv paper describes the harness as raising ARC-AGI-3 RHAE Best@1 from 30% to 95.5%. These are Prime Intellect's own results. The tradeoffs: it runs model-generated Python and commands with your user permissions, and the README states its worker and kernel processes are not a security sandbox. It is pre-1.0 and changes almost daily. The one-line installer currently ships the TypeScript release, while the repository's main branch holds a Rust port that is published only as nightly builds. Prime Intellect also notes that no model has yet been trained around this harness design, so it may be less predictable with some models than their native harnesses.
Version 0.9.6 added `/plugins` as a searchable picker for external MCP services with browser OAuth and connection verification, a bundled `mcp` skill for calling any connected service, and model and reasoning-effort pickers for ACP clients such as Zed.
Version 0.9.5 shipped standalone macOS and Linux builds that run without Node, verified updates with offline rollback, xAI Grok subscription sign-in, an optional backup model for when the primary provider is unavailable, and GLM 5.3 as the default Prime Inference model.
Prime Intellect published "Prime Agent: A Self-Improving RLM Harness" on arXiv, describing the REPL, Continual Harness, agent-to-agent messaging, and evaluations on ARC-AGI-3, long-context coding, GPU kernels, emulator construction, and Factorio.
Prime Intellect launched Prime Agent as an open-source, self-improving coding harness built around the Recursive Language Model and Continual Harness, installable with a one-line script.
Are you the founder? Claim this listing →