Prime Agent: Self-Improving Terminal Coding Assistant

Prime Agent: Prime Intellect’s Self-Improving Terminal Coding Harness

Prime Intellect open-sourced Prime Agent on 6 August 2026 under an MIT licence. It is a terminal coding and research agent built around two ideas that most harnesses don’t implement: treating context as a program variable rather than a chat transcript, and letting the agent revise parts of its own scaffolding while a task is running.

This article covers what it actually does, how to install it correctly, what the benchmark numbers do and don’t prove, and where the sharp edges are.

Before you start

  • macOS or Linux for the official installer. Windows has a separate platform note in the docs rather than first-class installer support.

  • Node.js 22.8.0 or newer, only if you want to run from a source checkout.

  • Comfort with the terminal, and enough Python to read what the agent executes on your behalf.

  • Either a subscription login (Claude Pro/Max, ChatGPT Plus/Pro via Codex, GitHub Copilot) or an API key from a supported provider.

  • A repository you are willing to let an agent modify — ideally a disposable clone or a clean worktree.

What Prime Agent Is

Inserted image

Prime Agent is a harness, not a model. It is the scaffolding that sits between you and whichever language model you point it at, and it is designed for work that runs long: multi-file refactors, migrations, research loops, evaluation runs that need to survive a closed laptop lid.

This distinction matters more than it sounds, and it is the point most coverage gets wrong. Prime Agent doesn’t compete with Claude or GPT — it runs them. Prime Intellect’s headline benchmark result was produced by Prime Agent driving Claude Opus 5. The comparison the project actually makes is against each model’s native harness, not against the models themselves.

The project is built on top of pi by earendil-works, which supplies the underlying agent runtime and TUI. Prime Intellect credits this in the repository, and it’s worth knowing if you plan to read the source.

The Architecture

Recursive Language Model (RLM)

Conventional agents treat context as an append-only transcript. Every turn, the accumulated history gets resent to the model. For a task that spans hundreds of steps over a large codebase, this is both expensive and lossy — you eventually hit compaction, and compaction throws away detail.

The RLM approach inverts this. The model is given one built-in tool: a persistent IPython kernel. Everything else — reading files, editing them, running shell commands, managing memory, spawning subagents — happens as Python code inside that kernel.

The practical consequence is that intermediate results stay as Python objects rather than being serialised back into prompt text. If the agent parses a 20,000-line log file, it keeps the parsed structure in a variable and runs functions over it. The model never has to read the file into context to work with it. Prime Intellect reports that this is where the token savings come from: running functions over data rather than spending tokens reading data through tools.

The kernel runtime bootstraps itself on first use. If you’d rather point it at an existing Python environment that already has ipykernel, set PRIME_AGENT_KERNEL_PYTHON.

A useful mental model: the IPython kernel is the agent’s desk, not its memory. Variables, imports, and half-finished analysis sit on it between turns, the same way a developer leaves files open and a REPL running while working through a problem.

Continual Harness

The second abstraction is where the “self-improving” label comes from — and where it needs qualifying.

The /refine command reviews the current trajectory and applies small, evidence-backed updates to the harness’s supplemental state: additional prompts, memories, reusable skill descriptions, and subagent specifications. Refinements are recorded with history, and snapshots support rollback. By default they are local to the session.

What /refine explicitly does not do is rewrite the immutable base system prompt. Descriptions of Prime Agent as an agent that “modifies its own system prompt” overstate the mechanism. The base instructions are fixed; what accumulates is a layer of learned context on top of them. This is a deliberate safety boundary, and it’s a meaningful one.

Prime Intellect is also clear that /refine doesn’t replace the work of packaging and reviewing genuinely new executable skills. It captures lessons; it doesn’t ship code on your behalf.

Core Capabilities

Programmatic tool calling. Rather than selecting from a fixed schema of tools, the model writes code. This is more expressive, easier to audit after the fact, and cheaper in tokens because the model does the thing instead of narrating that it is about to do the thing.

Recursive subagents. The model calls await rlm("subtask") from inside IPython to spawn an independent child agent. The call returns immediately at admission with a handle — it never returns the answer directly. Children report back via explicit agent_message replies to the parent, or by writing results to files. Child agents share the same runtime, providers, tools, skills, and session machinery as the parent.

Direct agent-to-agent messaging. Running agents and retained subagents can discover one another and exchange messages without routing everything through you.

Daemon-backed continuity. Sessions, IPython state, schedules, and subagents keep running when the terminal detaches. Closing the TUI detaches from the agent rather than necessarily killing it. Reattach with prime-agent attach.

Long-horizon controls. /goal keeps an objective and its progress alive across turns. /heartbeat and prime-agent schedule re-enter a session periodically or at a set time. /autonomous runs unattended within configured turn, token, and time budgets, optionally gated by user-defined quality checks — though the docs note the obvious caveat that a passed gate only verifies what that gate checks, and hitting a budget limit is not evidence of success.

Executable skills. Skills are importable Python packages, and a built-in skill creator can turn a recurring workflow into a project-level or personal skill.

Provider flexibility. Prime Agent is not tied to one model family. Subscription logins and API-key providers are both supported, and you can switch models mid-session with /model or adjust reasoning depth with /effort.

Installation

The stable installer:

bash

curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh

For the latest beta built from main:

bash

curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh -s -- beta

Both fetch versioned release artifacts, verify a SHA-256 checksum, and install the prime-agent command.

Then start it in the directory you want it to work on:

bash

cd /path/to/project
prime-agent

On first launch, run /login and pick a provider. Alternatively, export an API key before launching:

bash

export ANTHROPIC_API_KEY=sk-ant-...
prime-agent

Running from source

If you want to read or modify the code, clone it. Note that the npm workspace identifiers inside the source tree are not the public install path — running the package entry point directly will not work. Use the provided launcher:

bash

git clone https://github.com/PrimeIntellect-ai/prime-agent
cd prime-agent
npm ci
./prime-agent.sh

The source runner preserves the directory it was invoked from, so /path/to/prime-agent/prime-agent.sh works from inside another project.

The Benchmark Results, Honestly

Inserted image

Prime Agent with Claude Opus 5 scores 95.5% on ARC-AGI-3, edging past the reported human-expert baseline of 95.4%. Prime Intellect’s framing is that the gain is not benchmark-specific — they report improvements across multiple models relative to those models’ own harnesses, at lower total token usage. Other reported results include EmulatorBench, where the agent built SEGA Genesis and Game Boy Color emulators from scratch in Rust against diagnostic tests, plus long-horizon runs on Factorio and MazeBench.

Two caveats belong next to that number.

First, part of the community has questioned whether the ARC-AGI-3 run complies with the benchmark’s official evaluation rules. That question is open at the time of writing and has not been independently resolved.

Second, “surpasses the human expert baseline” is a claim about one interactive reasoning benchmark, not a general statement about capability. Treat it as a signal that harness design is underexploited — which is genuinely the interesting finding here — rather than as a leaderboard trophy.

How It Differs From Conventional Assistants

Against a plain chat interface, the difference is stark: persistent execution state, no re-prompting, no context loss between turns.

Against modern agentic CLIs — Claude Code, Codex, and similar — the difference is narrower and more specific. Those tools also maintain sessions and edit files. What Prime Agent adds is the single-tool IPython model instead of a fixed tool schema, first-class recursive subagents with direct messaging, daemon-backed sessions that survive terminal disconnects, and a harness layer the agent can revise mid-task. Whether that’s worth switching for depends heavily on whether your work is long-horizon enough to benefit.

Against nothing at all, the honest answer is that this is a research-oriented tool. It is explicitly built for evaluations and long-running autonomous work, and it shows in the ergonomics.

Security: Read This Part

Prime Agent executes model-generated Python and project commands with your user permissions. The worker and kernel processes exist to improve lifecycle isolation and recovery — Prime Intellect states plainly that they are not a security sandbox.

In practice:

  • Run it against a disposable clone, a clean worktree, or something you have checkpointed and can restore.

  • Only use repositories, instructions, skills, and extensions you trust. A malicious AGENTS.md or skill package is code execution.

  • Anything untrusted belongs in an external sandbox or a restricted environment, not in your working directory.

  • /autonomous mode compounds all of the above. Watch the first few runs before you stop watching.

FAQ

Is Prime Agent open source? Yes, fully, under the MIT Licence, at PrimeIntellect-ai/prime-agent on GitHub.

Does it work with local models? Yes. The provider layer supports API-key providers and cloud setups alongside subscription logins; see the providers documentation for the full list and the relevant environment variables.

What exactly is a Recursive Language Model? An approach that treats context as a variable and subagent delegation as function calls inside a persistent REPL, rather than treating context as a fixed transcript and tools as a fixed schema.

Can it really improve itself? Within limits. It refines supplemental prompts, memories, skill descriptions, and subagent specs — with recorded history and rollback — and never touches the immutable base system prompt.

Do I need to know Python? Not to use it, but you should be able to read Python well enough to sanity-check what it is about to run in your repository.

Resources

Leave a Comment

Your email address will not be published. Required fields are marked *