The Prime Agent Mental Model: Programmable Work, Durable State, and Responsible Autonomy

Prime Agent is best understood as a system for changing the life of model-assisted work, not merely the style of a chat. The final question is how its persistent Python control surface, recursive agents, durable sessions, continual harness, and background policies cooperate—and when that added machinery is justified. This synthesis gives the reader a decision-ready model: which layer carries a need, what evidence each layer can provide, and where the product's own permissions and limits require an external safeguard.

One task, several kinds of scarcity

A repository task can run short of more than tokens. It can run short of attention when several files and hypotheses compete for the model's focus. It can run short of time when a check or child investigation continues after the user leaves. It can run short of coordination when independent questions need separate treatment but their results must later be reconciled. It can run short of reusable knowledge when the same failure or procedure has already been solved once and should not be rediscovered from scratch.

Prime Agent addresses these shortages with related but noninterchangeable layers. The RLM runtime gives the model a programmable control surface: a persistent Python environment in which files, command results, parsed data, skills, and child-agent admissions can become working objects. The TypeScript host remains authoritative for provider calls, sessions, queues, scheduling, safety policy, and child lifecycles. That boundary makes the Python environment powerful without turning it into an ungoverned second agent system.

When a task contains separable questions, rlm.spawn adds an independent execution path. The parent admits a child with a focused prompt and name, receives an admission handle rather than an answer, and later receives findings through an explicit message or file. The child has its own session and context, while a parent-scoped registry keeps the relationship addressable. The parent still has to compare and synthesize the results. Recursion allocates attention; it does not manufacture agreement or correctness.

When the terminal disappears or the conversation grows too large, daemon workers, session artifacts, session trees, and compaction address continuity. The worker can remain the owner after the client detaches. The transcript can preserve a branching history, and a compacted view can keep the working path within the model's context window. The full history remains available for revisiting, but the summary is lossy. The kernel can retain useful working state, but a decisive finding still belongs in an inspectable artifact if another person must verify it.

When a task repeats, the continual harness addresses a different scarcity. It can hold a prompt note, memory, Python-backed skill description, or subagent specification outside the token history. /refine can apply small evidence-backed edits, with local state as the default and global state as an explicit wider-scope choice. This is not the same as keeping a longer conversation. It is an editable layer for selected behavior, and its value depends on testing the lesson after it is recorded.

The layers form a causal chain, but they do not collapse into one “memory” feature. Python state helps coordinate the present turn. A child session distributes present attention. A transcript and artifact directory preserve a task across time. Compaction creates a workable view of history. Harness state preserves a reusable pattern. A goal stores an objective, while a schedule or heartbeat supplies a trigger and autonomous mode decides whether another bounded continuation should be injected. Each layer answers a different question about the work's life.

This division is the central architectural insight. A product that placed all of these responsibilities in the chat transcript would make context, process ownership, reuse, and automation hard to distinguish. Prime Agent instead gives each concern a state and a transition: code runs in a persistent control environment, authoritative lifecycle operations cross to the host, independent work becomes a child session, continuity becomes a worker and artifact problem, and reusable behavior becomes scoped harness state.