Prime Agent: A self-improving RLM agent
TL;DR Highlight
Prime Agent uses one IPython REPL for sub-agents and scores 95.5% on ARC-AGI-3
Who Should Read
Backend or AI developers building coding-agent harnesses or weighing sub-agent orchestration designs
Core Mechanics
- The only tool is IPython
- The model uses a persistent IPython kernel as its sole tool.
- Sub-agents and other harness features are called as functions inside the kernel.
- Context is treated as a variable (RLM)
- RLM (Recursive Language Model) treats context as a variable and sub-agent delegation as function calls.
- Past history stays in variables, so it remains accessible in long sessions.
- The agent edits its own harness
- The agent can create, read, update and delete prompts, sub-agents, skills and memory.
- /refine reads the trajectory and applies only the smallest relevant edit, leaving the base system prompt untouched.
- Prior refinement history allows rollback by ID.
- Sub-agents run async and in parallel
- await rlm("task") returns a child handle immediately, not the answer.
- Results come back via agent_message.send, and sub-agents persist so they can be messaged later.
Community Reactions
- Models may not need a harness anymore
- One commenter built an RLM harness with a local MCP server, logging, memories and project rules, and it worked well for a while.
- Foundation models then caught up, and storing context in .md files in directories became enough.
- Code bloat and self-improvement limits
- A commenter criticized the repo for files near 10K LOC and a switch statement over 1000 lines.
- Another said using LLMs for harness engineering mostly added bloat.
- Doubts about cost and real-world proof
- One commenter expects it to burn tokens at current economics.
- Another says there are no concrete examples on real tasks.
- Someone asked how it does on other benchmarks or everyday programming.
- Complaints about the installer
- A commenter says it installs into the homebrew directory without being a homebrew package, with no uninstall method.
How to Apply
- Try the parallel delegation pattern via a prompt
- Paste the prompt below into your coding agent and have it summarize a large repo module by module.
- Compare quality and token usage against a single-context run.
- Add a gate command as a finish condition
- For unattended agent tasks, require a test or lint command to pass before finishing.
- Feed failure output back to the agent and set max turns, tokens and time limits.
- Build a loop that promotes repeated failures to memory or skills
- Periodically extract recurring failure patterns from agent logs.
- Edit one memory note or skill at a time instead of the whole system prompt, and keep a change history.
- Have the agent process long data with code
- Don't load large logs or documents into context whole.
- Instruct the agent to filter and aggregate with Python and read only the results to save tokens.
Try It
# Paste into Claude Code or ChatGPT (with code execution) — simplified version of the paper's method
You are an agent that handles large inputs with code instead of reading them directly.
Rules:
1. Do not load {{document or directory}} into context whole; first inspect the file list, sizes and structure with Python.
2. Split the work into independent subtasks, delegate each to a sub-agent (or separate call), and receive only summaries.
3. Store intermediate results in variables or files, and retrieve them only when needed.
4. At the end, give the combined answer along with the list of subtasks you used.
Task: {{question}}
Next to try: ask it to compare answer quality and token usage against reading everything at once.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.