# PREFRONTAL: Compounded Intelligence — How Persistent Agents Get Smarter by Remembering What They Learn

**Oscar Serra¹, Jarvis¹**
¹Independent Research
*1 April 2026 — v2.4*

---

## Abstract

A human intern who makes the same mistake twice is frustrating. One who makes it three times is fired. Yet the most capable AI agents available today — running on frontier models that dwarf human working memory — repeat identical errors across sessions with perfect reliability. This failure of *retention*, not capability, represents the central bottleneck in deployed agent systems. They fail not because they lack intelligence in any single turn, but because they lack the machinery to *compound* it: to convert each solved problem into a reusable rule that makes the next problem cheaper.

We argue that agent intelligence should be measured not by single-turn capability but by **skill-acquisition efficiency**: the rate at which an agent converts novel problems into learned competencies, following Chollet (2019)'s formalisation of intelligence as the efficiency of turning experience into skill. We propose three measurement axes — first-attempt accuracy, resource efficiency, and retention with transfer — and evaluate them against six months of operational data from OpenClaw, an open-source persistent AI agent framework.

Our central finding is that intelligence compounds through architecture, not model scale. Four prompt-level mechanisms drive this compounding in practice: (1) **fractal reflection**, a structured post-action review that converts events into reusable rules; (2) **tiered file-based memory**, a hierarchy from ephemeral daily logs to permanent knowledge files; (3) **CORF source parallelism**, multi-model concurrent retrieval that exploits provider diversity; and (4) **adaptive effort routing**, matching model capability to task difficulty. Together, these mechanisms reduced repeated errors by approximately 60% over a 90-day observation period, while the underlying models remained unchanged.

Strikingly, we find that these architectural patterns are not arbitrary design choices but appear to be *necessary* features of persistent agent systems. An accidental source code leak of Anthropic's Claude Code (March 2026) revealed that the industry's leading AI coding agent independently converged on nearly identical architectural patterns — tiered file-based memory, periodic cognitive cycles, prompt-defined multi-agent orchestration, and background memory consolidation. Combined with Meta-Harness (Lee et al., 2026), which demonstrated 6× performance gains from harness optimisation alone, this three-way convergence between independent academic, industrial, and open-source projects suggests that these architectural patterns may be convergent solutions — designs the problem strongly favours rather than arbitrary choices among many alternatives.

We distinguish sharply between **prompt-level intelligence** — what can be achieved by engineering the agent's architecture, memory, and orchestration — and **model-level intelligence** — what requires improvements to the foundation models themselves. The boundary between these categories is shifting as providers expose more of their models' internal reasoning, but the practical lesson is clear: most gains available today live at the prompt level, and most teams are leaving them on the table.

**Keywords:** compounded intelligence, skill-acquisition efficiency, persistent agents, fractal reflection, agent memory, adaptive routing, prompt engineering, agent architecture

**Open source:** OpenClaw is available at https://github.com/openclaw/openclaw. The memory architecture, system prompts, and fractal reflection protocol described in this paper are included in the default agent configuration.

---

## 1. Introduction — The Amnesia Problem

Consider two scenarios. In the first, you ask an experienced colleague to review a pull request. They remember that this particular repository has a fragile CI pipeline, that the last three PRs to this module introduced regressions in the test suite, and that the original author prefers a specific error-handling pattern. Their review is efficient and precise because their intelligence has *compounded* — each prior interaction deposited a residue of knowledge that makes the current interaction cheaper.

In the second scenario, you ask the same question to someone with perfect technical skills but total amnesia. They must rediscover the CI fragility, re-learn the regression pattern, and guess at the author's preferences. Their single-turn intelligence is identical, but their effective intelligence is dramatically lower because nothing compounds.

Every AI agent deployed today operates in the second scenario. Even agents backed by models with 200,000-token context windows start each session — and often each turn — with no memory of prior work. The context window is working memory, not long-term memory, and treating it as a substitute produces what we call the **amnesia tax**: the cumulative cost of re-learning things the agent once knew.

This paper asks a simple question: *what would it take to build agents that actually get smarter over time?*

### 1.1 Intelligence as Skill-Acquisition Efficiency

Chollet (2019) proposed that intelligence is not a measure of what a system can do, but of how efficiently it acquires new skills from experience. A chess engine that plays at grandmaster level after seeing every possible game is less intelligent than one that reaches the same level from a hundred games. The measure that matters is the conversion rate: experience in, competence out.

We adopt this framing directly. An intelligent agent is one where:

1. **First-attempt accuracy improves** — similar problems are solved correctly more often over time
2. **Resource efficiency increases** — equivalent tasks consume fewer tokens, fewer API calls, and less wall-clock time
3. **Knowledge transfers** — lessons learned in one domain reduce errors in adjacent domains

These three axes form our evaluation framework. Crucially, all three can be measured at the *prompt level* — by engineering the agent's memory, reflection, and routing — without modifying the underlying model.

### 1.2 The Two Levels of Agent Intelligence

A persistent confusion in the agent ecosystem is the conflation of model intelligence with agent intelligence. When an agent fails, the instinct is to upgrade the model. But upgrading from GPT-4 to GPT-5 does not teach the agent that the last time it ran `git checkout --theirs README.md`, it destroyed three months of documentation work. That lesson lives — or doesn't — in the agent's architecture.

We distinguish two levels:

**Prompt-level intelligence** encompasses everything achievable through the agent's system prompt, memory files, tool orchestration, model routing, and reflection protocols. This is where the agent's *personality* and *accumulated wisdom* live. Changes here compound across sessions because they persist in files.

**Model-level intelligence** encompasses the foundation model's reasoning, coding ability, instruction following, and general knowledge. Changes here require retraining or fine-tuning by the model provider. Recent advances — chain-of-thought reasoning, extended thinking, tool use improvements — have been dramatic, but they benefit all users equally and do not compound for any individual agent.


Recent work provides striking independent validation. **Meta-Harness** (Lee et al., 2026) demonstrated that optimising the *harness*—the orchestration code between model and task—improved TerminalBench-2 scores by over 18 points without changing model weights. Most remarkably, a weaker model (Haiku 4.5) with an optimised harness achieved the \#1 score on TerminalBench-2, beating stronger models with default harnesses. Lee et al. report a 6× performance gap from harness changes alone on the same benchmark with the same model—direct evidence that prompt-level intelligence dominates model-level intelligence for practical agent performance.

A second source of evidence comes from an accidental exposure of Anthropic's **Claude Code** source code (Anthropic, 2026), which revealed that this commercially leading coding agent uses architectural patterns — tiered file-based memory, periodic cognitive cycles, prompt-defined orchestration, and background consolidation — that parallel our own. We discuss specific parallels where relevant throughout Sections 3–6, noting both similarities and important differences in scale and design philosophy.

The practical lesson from six months of operating OpenClaw is that the *vast majority* of available intelligence gains live at the prompt level, and most teams are not pursuing them. Section 5 quantifies this claim.

### 1.3 Contributions

This paper makes the following contributions:

1. We formalise **compounded intelligence** as a measurable property of persistent agents, distinct from single-turn capability
2. We define three metrics — FAAR, RER, and TC — for quantifying intelligence compounding and apply them to operational data
3. We describe four mechanisms that produce compounding in practice, with architectural details and operational data
4. We provide a candid assessment of **what works and what doesn't** from six months of real-world deployment
5. We identify the **boundary between prompt-level and model-level** intelligence, arguing that this boundary is the most important strategic question for agent builders
6. We document **known gaps** — utility-based pruning, learned forgetting, temporal linking, learned action gating — as an honest roadmap for future work

---

## 2. Related Work

### 2.1 Memory Architectures for Agents

The agent memory landscape in early 2026 is characterised by a productive tension between simplicity and sophistication.

At the simple end, most deployed agents use **retrieval-augmented generation (RAG)** with vector stores: embed documents, retrieve the top-k most similar chunks, inject them into the prompt. This approach is well-understood, scales to large corpora, and fails in predictable ways — primarily through retrieval misses when the relevant information is semantically distant from the query. The recent comprehensive survey by Zhang et al. (2026) catalogues over 40 memory architectures for LLM-based agents, finding that the field has converged on a taxonomy of episodic, semantic, and procedural memory types, mirroring the human cognitive science literature but with substantially less sophisticated implementations.

**MemGPT** (Packer et al., 2023) introduced an OS-inspired approach to unbounded agent memory, managing a virtual context through explicit memory pagination — moving information between a limited "main context" and an external "archival storage." This is conceptually similar to our tiered memory, but MemGPT operates within a single session and manages memory programmatically, while our approach persists across sessions through human-readable files and delegates retrieval to a hybrid search system.

**Generative Agents** (Park et al., 2023) demonstrated that LLM-based agents can maintain coherent long-term behaviour through a memory stream architecture combining observation, reflection, and planning. Their reflection mechanism — periodically synthesising higher-level insights from recent memories — is a direct precursor to our fractal reflection, though their reflections operate at a single abstraction level rather than the multi-scale structure we propose.

At the sophisticated end, systems like **CraniMem** (Li et al., 2026) propose neural architectures that learn to compress and retrieve memories selectively, drawing on hippocampal indexing theory. **MemexRL** (Chen et al., 2026) frames memory management as a reinforcement learning problem, where the agent learns which memories to retain based on downstream task performance. **Governed Memory** (Park et al., 2026) introduces access-control and governance layers, recognising that not all memories should be equally available in all contexts.

Our approach sits deliberately between these extremes. OpenClaw uses a **tiered file-based memory** system — plain markdown files organised hierarchically — that is trivially inspectable, manually editable, and compatible with any model. We sacrifice the theoretical elegance of learned memory management for the practical benefit of a system that a human can understand, debug, and correct.

Independent support for this design comes from Meta-Harness (Lee et al., 2026), which gives its optimiser a **filesystem** rather than a compressed summary. Their context budget comparison is instructive: while Self-Refine uses 0.001M tokens/iteration and OPRO uses 0.002M, Meta-Harness uses 10M tokens/iteration—betting that navigable, inspectable context outperforms lossy compression. Both their system and ours make the same architectural wager: let the agent navigate and choose what to inspect rather than receiving a pre-compressed summary.

The Claude Code source leak reveals the same bet at industrial scale. Claude Code uses a `MEMORY.md` entrypoint file — capped at 200 lines and 25KB — as an index into a hierarchy of topic-specific memory files. The entrypoint is loaded into *every* API call (up to 40,000 characters of project context via the `CLAUDE.md` file), and a background consolidation process (autoDream) periodically reviews session transcripts to update the memory hierarchy. The consolidation prompt explicitly instructs: "Don't exhaustively read transcripts. Look only for things you already suspect matter" — a production-validated information diet that mirrors our retrieval-first philosophy. When the entrypoint exceeds its caps, a truncation warning is injected directly into the prompt, forcing the agent to prune its own index. Three independent systems — OpenClaw, Claude Code, and Meta-Harness — all converged on navigable file hierarchies over vector stores or compressed summaries.

### 2.2 Reflection and Self-Improvement

The idea that agents should reflect on their own performance is not new. **Reflexion** (Shinn et al., 2023) demonstrated that LLMs can improve on tasks by generating verbal reflections on their failures. **Self-Refine** (Madaan et al., 2023) showed iterative self-improvement through critique and revision. More recently, systems like **Ares** (Wang et al., 2026) have pushed the boundaries of what agents can achieve through structured self-evaluation.

**Meta-Harness** (Lee et al., 2026) takes self-improvement further: rather than generating verbal reflections, it optimises the *scaffolding code itself*—the prompts, tools, and orchestration that constitute the agent's harness. This represents self-improvement at the infrastructure level.

**Hermes Agent** (Nouse Research, 2026) implements a closed learning loop where skills are not only created from experience but *self-improve during use*. Unlike our approach, where skill refinement occurs through fractal reflection (a semi-manual process mediated by the reflection prompt), Hermes automates the refinement cycle: the agent creates skills after complex tasks, then iteratively improves them based on subsequent usage outcomes. This represents fully automated skill evolution — a capability our architecture does not yet match.

What distinguishes our approach — which we call **fractal reflection** — is the insistence on *persistence* and *depth*. Reflexion generates reflections that improve performance within a single episode. Fractal reflection generates reflections that are *written to files* and *read in future sessions*, creating a genuine compounding effect. Furthermore, fractal reflection operates at multiple abstraction levels simultaneously: the specific fix, the pattern it belongs to, the system that produces the pattern, and the worldview assumption underlying the system. This multi-level structure is not decorative; it produces qualitatively different kinds of knowledge at each level, each with different shelf lives and transfer properties.

### 2.3 Skill Acquisition and Lifelong Learning

**Voyager** (Wang et al., 2023) demonstrated lifelong learning in LLM agents through a skill library that accumulates verified programs over time. An agent exploring a Minecraft world builds a library of reusable skills — each solved problem becomes a callable function for future problems. This is the closest prior work to our compounding thesis: Voyager's skill library is an explicit implementation of intelligence-as-accumulated-competence. Our work extends this principle from game environments to real-world agent deployment, where "skills" are operational lessons and behavioural patterns rather than executable programs.

**DSPy** (Khattab et al., 2023) takes a complementary approach, compiling declarative language programs into optimised prompt pipelines. Where we persist knowledge in human-readable files, DSPy compiles it into optimised few-shot examples and instructions. The two approaches are not mutually exclusive — DSPy-style compilation could potentially be applied to our accumulated operational lessons to produce more token-efficient prompt injections.

### 2.4 Evaluation of Agent Memory

Evaluating whether an agent's memory *actually helps* is surprisingly difficult. The **LoCoMo** benchmark (Maharana et al., 2024) provides a structured evaluation framework for long-context memory in conversations, testing retrieval accuracy, temporal reasoning, and knowledge integration. However, most benchmarks focus on information retrieval — "can the agent remember fact X?" — rather than skill acquisition — "does the agent get better at task Y over time?"

We argue that skill acquisition is the more important measure, and Section 4 proposes metrics for evaluating it.

---

## 3. Architecture — Four Mechanisms of Compounding

The OpenClaw agent architecture is not a single monolithic system but a collection of mechanisms that each contribute to intelligence compounding. We describe the four primary mechanisms, their interactions, and their individual contributions to the compounding effect. Figure 1 provides a system-level overview.

**Design principle: deliberate simplicity.** We keep the orchestration layer minimal and model-agnostic. Meta-Harness (Lee et al., 2026) validates this philosophy: by leaving diagnosis and edit decisions to the proposer rather than hard-coding heuristics, the system improves automatically as coding agents become more capable. Similarly, our reflection protocol and memory schema are designed to improve as models improve, without requiring architectural changes.

**Design principle: cache-aware prompt anatomy.** The system prompt is not a monolithic block but a structured sequence with an explicit boundary between *static* content (cacheable across sessions and even across users) and *dynamic* content (per-session, per-turn). Claude Code formalises this with a `SYSTEM_PROMPT_DYNAMIC_BOUNDARY` marker — everything before it uses global cache scope, everything after contains user-specific context. They enforce this architecturally with helper functions: `systemPromptSection()` for cacheable content and `DANGEROUS_uncachedSystemPromptSection()` for dynamic content, where the `DANGEROUS_` prefix makes cache-breaking visible in code review. We adopt a similar principle: SOUL.md and AGENTS.md are static (change rarely, cache well), while daily logs and retrieval results are dynamic (injected per-turn, never cached).

**Design principle: safe tool partitioning.** Claude Code's source reveals a clean architectural constraint: tools are partitioned into *concurrent* (read-only: FileRead, Grep, Glob — safe to parallelise) and *serialized* (mutating: FileEdit, FileWrite, Bash — executed one at a time). This prevents race conditions without requiring explicit locking. We implement an analogous distinction in OpenClaw: memory reads and web searches run concurrently, while file writes and message sends are serialised.

![System Architecture](fig-architecture.png)

**Figure 1.** System architecture of OpenClaw's compounding intelligence pipeline. Each turn reads from tiered memory, routes to an appropriate model, executes, and concludes with fractal reflection that writes back to the memory hierarchy. CORF parallelism is invoked for tasks requiring cross-model validation.

### 3.1 Fractal Reflection — The Compounding Engine

Every agent turn in OpenClaw is followed by a mandatory reflection step. This is not a suggestion or a best practice — it is enforced by the system prompt and produces structured output at multiple abstraction levels.

The reflection protocol requires answers to four questions:

1. **MEMORY**: Did this turn produce anything worth persisting? If yes, write it immediately.
2. **PATTERN**: What pattern does this exchange belong to? Identify at Level 2 (pattern), optionally Level 3 (system), optionally Level 4 (worldview).
3. **RIPPLE**: Did this change make anything else stale? Scan code, docs, online presence, memory files.
4. **IMPROVE**: Can you improve a file, skill, doc, or process right now?

The protocol operates as follows. After each agent turn, the reflection engine extracts new facts and classifies each into the appropriate memory tier (ephemeral, working, knowledge, or identity). It then performs multi-level pattern abstraction: describing the event (Level 1), identifying the pattern it belongs to (Level 2), optionally surfacing the structural system (Level 3) and the worldview assumption (Level 4). Next, it scans all connected surfaces --- code, documentation, online presence, memory files --- for staleness introduced by the current turn, applying immediate fixes for items under a two-minute threshold and tracking larger items for later. Finally, it scans for opportunistic improvements to any file, skill, or process it can fix immediately. All writes and edits happen during reflection, not in a future turn. The formal pseudocode is provided in Appendix A.

The key design principle is *act before explain*. If the reflection identifies something to fix, the agent fixes it during the reflection, not in a future turn. This eliminates the gap between insight and action that plagues human retrospectives.

**Why "fractal"?** The term comes from the multi-scale structure. A fern frond: the leaf looks like the branch looks like the tree. Similarly, a single event (Level 1) belongs to a pattern (Level 2), which emerges from a system (Level 3), which rests on a worldview assumption (Level 4). Not every turn needs Level 4. But every turn has at least Level 2, because even routine actions belong to patterns worth naming.

![Fractal Reflection Levels](fig-fractal-fern.jpg)

**Figure 2.** Fractal reflection operates at multiple scales simultaneously, like a fern frond where the leaf (Level 1) resembles the branch (Level 2), the frond (Level 3), and the colony (Level 4). Each level produces qualitatively different knowledge with different shelf lives and transfer properties.

**Convergent design: KAIROS.** Claude Code's source reveals an unreleased autonomous daemon mode called KAIROS, referenced over 150 times in the codebase. KAIROS receives periodic `<tick>` prompts — structurally identical to OpenClaw's heartbeat/cron system — to decide whether to act proactively. It maintains append-only daily log files and subscribes to event sources (GitHub webhooks). The convergence is striking: two independent systems arrived at the same periodic-reflection-plus-event-driven architecture for persistent agent cognition. Where our system calls them "heartbeats," Claude Code calls them "ticks." Where we write to `memory/YYYY-MM-DD.md`, KAIROS writes to append-only daily logs. The underlying cognitive pattern — regular self-initiated review cycles combined with event-triggered responses — appears to be a necessary feature of any agent that operates continuously rather than on-demand.

**Pre-action vs post-action reflection.** Our fractal reflection is exclusively *post-action* — it runs after each turn. GStack (Tan, 2026) demonstrates the complementary value of *pre-action* reflection: six forcing questions that reframe the problem before any code is written (modelled on Y Combinator's office hours format). The combination — structured thinking before action and structured reflection after action — would create a complete cognitive cycle. Our current architecture captures only the second half.

**Compounding mechanism:** Each reflection writes one or more of: a daily log entry, a knowledge file update, an operational lesson, a ripple tracker item. These files are read in future sessions, meaning the agent *literally learns from its past self*. Over 90 days, the operational-lessons file grew to over 1,100 lines of hard-won rules like "use `read` before `exec` for file existence checks" and "never run `systemctl stop openclaw-gateway` directly via exec." Each rule prevents a class of future errors.

### 3.2 Tiered File-Based Memory

OpenClaw's memory is a hierarchy of plain markdown files:

| Tier | Files | Shelf Life | Example |
|------|-------|------------|---------|
| **Ephemeral** | `memory/YYYY-MM-DD.md` | 1–3 days | "Owner busy today, postpone non-urgent errands" |
| **Working** | `memory/projects/*.md` | Weeks–months | "J-013 paper: thesis confirmed, writing v1.0" |
| **Knowledge** | `memory/knowledge/*.md` | Months–permanent | "Operational lesson: exec approval blocks read-only commands identically to destructive ones" |
| **Identity** | `SOUL.md`, `MEMORY.md` | Permanent | Core personality, values, long-term memory index |

![Memory Tiers](fig-memory-tiers.png)

**Figure 3.** The four-tier memory hierarchy, from ephemeral daily logs to permanent identity files. Information graduates upward as its value is confirmed across sessions.

Each tier serves a different cognitive function:

- **Ephemeral memory** is the agent's "what happened today" — high-detail, rapidly-decaying context that prevents the agent from asking "how are you?" twice in one day.
- **Working memory** tracks active projects with enough detail to resume after a session boundary. This is where the amnesia tax is most directly addressed.
- **Knowledge memory** stores lessons that have proven their value across multiple sessions. An entry graduates from ephemeral to knowledge when the same insight appears useful a second time.
- **Identity memory** defines who the agent *is* — personality, values, operating principles. This tier changes rarely and deliberately.

This architecture shares conceptual DNA with MemGPT's tiered context management (Packer et al., 2023) and the memory streams of Generative Agents (Park et al., 2023). The key difference is persistence granularity: MemGPT pages memory within a session, Generative Agents maintain a continuous stream, and our approach writes discrete, human-editable files that survive indefinitely across sessions and model changes.

**Why files?** Three reasons. First, files are **inspectable**: a human can read exactly what the agent remembers and correct it. Second, files are **portable**: they work with any model from any provider. Third, files are **composable**: the system prompt includes only the tiers relevant to the current context, managing token budget naturally.

**The retrieval problem:** With over 200 files in the memory hierarchy, finding the right information requires more than filename matching. OpenClaw uses a hybrid retrieval system combining semantic search (via local embeddings using mxbai-embed-large) with structured search (filename patterns, date ranges). The `memory_search` tool is mandatory before answering questions about prior work — the system prompt enforces "retrieve first, answer second."

**Known gap — write gate too permissive:** The current system writes too freely. A single session can generate dozens of memory entries, many of which have marginal value. There is no utility-based pruning: memories are not evaluated for their expected future usefulness before being written. This is our most significant architectural gap, discussed further in Section 7.

### 3.3 CORF Source Parallelism

The **Concurrent Orchestrated Retrieval Framework (CORF)** exploits a property unique to the current AI landscape: multiple frontier models from different providers have complementary strengths. Claude excels at nuanced reasoning, GPT at structured output, Gemini at broad knowledge retrieval. Rather than choosing one, CORF queries multiple models in parallel and synthesises their responses.

This is not ensemble learning in the traditional sense — the models are not trained together, and there is no learned combination function. Instead, CORF uses a simple protocol:

1. **Fan out**: Send the same query to N models concurrently
2. **Collect**: Gather responses within a timeout window
3. **Synthesise**: A designated "judge" model identifies agreements, disagreements, and unique contributions
4. **Resolve**: Disagreements are flagged for human review or resolved by majority

**Relationship to DSPy:** Where DSPy (Khattab et al., 2023) optimises a single model's prompts through compilation, CORF operates across models, exploiting inter-provider diversity. The approaches are complementary: DSPy could optimise the prompts sent to each model within a CORF fan-out.

**Quantitative impact:** In cross-model review tasks (code review, document analysis), CORF parallelism reduced error rates by approximately 20% compared to single-model responses, measured across 30 sampled review sessions where both single-model and multi-model responses were available. The primary benefit was catching errors that a single model's blind spots would miss — for example, Claude consistently overlooked certain import ordering issues that GPT flagged, while GPT missed nuanced personality-drift concerns that Claude caught.

**Why this compounds:** Over time, the agent learns which models are reliable for which tasks. This routing knowledge is stored in knowledge files and used to optimise future queries — sending coding questions preferentially to models that have historically produced correct code, sending creative tasks to models with better stylistic range.

![Multi-Agent Orchestration Paradigms](fig-paradigms.png){ width=85% }

**Figure 6.** Four multi-agent orchestration paradigms that emerged independently in 2026, each optimising for different properties: accuracy through diversity (CORF), task decomposition (Coordinator), cost-effective review (Role-based), and autonomous scale (Organisational).

**Multi-agent orchestration paradigms.** CORF is one of at least four distinct paradigms for multi-agent coordination that have emerged independently in 2026:

1. **CORF parallelism** (this paper): fan-out the same query to multiple models, synthesise responses. Optimises for *accuracy through diversity*.
2. **Coordinator mode** (Claude Code): a single coordinator prompt spawns workers via an AgentTool with restricted tool sets. Workers communicate through tool results and shared filesystem. Optimises for *task decomposition with minimal overhead*.
3. **Role-based specialisation** (GStack, Tan 2026): a single model applies multiple perspective-specific prompts sequentially — CEO review, engineering manager, senior designer, debugger. Not multi-agent in the API sense, but multi-perspective through prompt switching. Optimises for *cost-effective diverse review*.
4. **Organisational hierarchy** (Paperclip, 2026): agents are arranged in a corporate org chart — CEO, CMO, CTO, engineers — with a ticketing system for work distribution, per-agent budget tracking, and goal alignment. Optimises for *autonomous operation at scale*.

Claude Code's source also reveals three sub-agent execution models within paradigm 2: **fork** (inherits parent context, cache-optimised), **teammate** (separate terminal pane, communicates via file-based mailbox — asynchronous and persistent), and **worktree** (isolated git branch per agent — complete code isolation). The teammate model is particularly interesting: agents communicate through the filesystem rather than through shared context or API calls, enabling truly asynchronous multi-agent collaboration.

These paradigms are not mutually exclusive. A production system might use CORF for cross-model validation, coordinator mode for task decomposition, role-based specialisation for design review, and organisational hierarchy for autonomous operation — each at different scales and for different purposes.

**ULTRAPLAN: remote planning as a service.** Claude Code includes an unreleased feature called ULTRAPLAN that offloads complex planning to a *separate remote session* running Opus 4.6 with up to 30 minutes of dedicated think time. The main agent polls the remote session, receives the approved plan, and executes locally. This represents a different architectural choice from our approach: we keep planning prompt-local (within the same session), while ULTRAPLAN externalises it to a dedicated remote session. The tradeoffs are clear: remote planning offers unlimited think time and isolation, but adds latency and session management complexity; local planning offers lower latency and shared context, but is constrained by output token limits.

### 3.4 Adaptive Effort Routing

![Adaptive Effort Routing](fig-routing.png){ width=55% }

**Figure 8.** Adaptive effort routing decision flow. Incoming tasks are routed through explicit rules (cron jobs always flat-rate), budget pressure checks (gateway enforcement at 85% and 95% thresholds), and task-difficulty matching to select the appropriate model tier.

Not every task deserves a frontier model. Formatting a JSON response, generating a commit message, or answering "what time is it?" should not consume the same resources as debugging a distributed systems failure or writing a research paper.

OpenClaw implements **adaptive effort routing** through a model hierarchy:

| Effort Level | Model Tier | Example Tasks |
|-------------|-----------|---------------|
| **Minimal** | Haiku / local | Formatting, simple lookups, acknowledgments |
| **Standard** | Sonnet | Most coding, analysis, conversation |
| **Maximum** | Opus | Research papers, complex debugging, multi-step reasoning |

Routing decisions are informed by both explicit rules (cron jobs always use flat-rate models) and learned patterns (the agent's experience with which tasks actually need frontier reasoning).

**Budget awareness:** A critical component is real-time budget tracking. The agent checks utilisation before spawning expensive operations: >85% weekly budget triggers a downgrade to Sonnet maximum, >95% triggers Haiku/local only. This is not optional — the gateway enforces billing caps, silently rerouting metered model requests that would exceed budget.

**Compounding mechanism:** Each routing decision and its outcome is implicitly available for future routing. When a task that was routed to Opus could have been handled by Sonnet, this is learnable — and the cumulative effect is a steady decrease in cost-per-task without corresponding decrease in quality.

---

## 4. Measuring Compounded Intelligence

Before presenting operational results, we define the metrics used to evaluate them. Compounded intelligence can be measured along the three axes introduced in Section 1.1.

![Metrics Framework](fig-metrics.png){ width=65% }

**Figure 9.** The three measurement axes for compounded intelligence, arranged along a spectrum from direct observation (FAAR) to counterfactual estimation (TC).

### 4.1 First-Attempt Accuracy Rate (FAAR)

FAAR measures the proportion of tasks in a given category *C* that are completed correctly on the first attempt during time window *T*. A compounding agent shows monotonically increasing FAAR over time. The denominator includes only tasks where the agent attempted a solution (excludes clarification-only turns).

### 4.2 Resource Efficiency Ratio (RER)

RER compares the resources consumed by equivalent tasks at two different times: RER = resources(t1) / resources(t2), where resources can be measured in tokens, API calls, wall-clock time, or monetary cost. RER > 1.0 indicates compounding (the agent is becoming more efficient). We report RER using token counts as the primary resource measure, as tokens are the most precisely tracked metric in our system.

### 4.3 Transfer Coefficient (TC)

TC measures the degree to which a lesson learned in domain *A* reduces errors in domain *B*: the error reduction in B attributable to the lesson from A, divided by the baseline error rate in B. Measuring TC requires counterfactual reasoning --- what would the error rate have been without the transferred lesson? --- which makes it the hardest of the three metrics to compute rigorously. In Section 5.3, we approximate TC through case analysis of specific transfer events rather than aggregate statistics.

### 4.4 Composite Intelligence Index (CII)

The three axes combine into a weighted index: CII(T) = alpha * FAAR(T) + beta * log(RER(T)) + gamma * TC(T), where alpha, beta, gamma are deployment-specific weights satisfying alpha + beta + gamma = 1.

**Sensitivity analysis.** Because these weights are not empirically derived, we verify that the compounding trend is robust across a range of reasonable weight distributions. Table 1 reports CII under five weight configurations spanning accuracy-dominant, efficiency-dominant, transfer-dominant, and uniform weightings.

| Config | α | β | γ | CII (M1) | CII (M3) | CII (M6) | Δ M1→M6 |
|--------|-----|------|------|----------|----------|----------|----------|
| A (primary) | 0.40 | 0.35 | 0.25 | 0.3 | 0.5 | 0.6 | +96% |
| B (accuracy-heavy) | 0.60 | 0.25 | 0.15 | 0.4 | 0.6 | 0.6 | +52% |
| C (efficiency-heavy) | 0.25 | 0.50 | 0.25 | 0.2 | 0.4 | 0.5 | +161% |
| D (transfer-heavy) | 0.25 | 0.25 | 0.50 | 0.2 | 0.3 | 0.4 | +111% |
| E (uniform) | 0.33 | 0.33 | 0.33 | 0.2 | 0.4 | 0.5 | +113% |

**Table 1.** CII sensitivity to weight selection. All configurations show substantial improvement (minimum +52%, maximum +161%) from month 1 to month 6, confirming that the compounding trend is not an artifact of weight choice. The absolute CII values vary — accuracy-heavy weighting (Config B) produces higher baselines because FAAR starts at 0.70 — but the *direction and magnitude* of improvement are consistent across all configurations.

The minimum improvement (Config B, +52%) occurs when accuracy dominates because FAAR plateaus earliest. The maximum (Config C, +161%) occurs when efficiency dominates because RER shows the most consistent growth. The key finding is that no reasonable weight distribution produces a flat or declining CII — compounding is a robust property of the system, not a measurement artifact. (We define "reasonable" as any convex combination where each weight ≥ 0.10, ensuring no axis is entirely ignored.)

---

## 5. Experience — What Six Months of Operation Taught Us

This section reports operational data from OpenClaw deployed as a personal assistant from October 2025 through March 2026. The agent handled messaging (WhatsApp, Telegram, Discord), code management (GitHub PRs, CI monitoring), research (web search, paper analysis), and personal tasks (calendar, reminders, file management).

**External validation.** Meta-Harness (Lee et al., 2026) provides independent evidence for compounding at the harness level. On TerminalBench-2, Claude Code scored 58% with its default harness; Meta-Harness improved this to 76.4% through iterative optimisation—compounding in action. Their median score (50) on text classification exceeded the best score of all other methods (45.6), demonstrating systematic rather than lucky improvement.

**Methodology note:** We present a longitudinal case study from a single deployment (N=1) serving one primary user over six months. Metrics were derived from manual review of session logs (approximately 2,400 sessions over six months) with spot-check sampling rather than exhaustive classification. We report these numbers as indicative of trends rather than statistically rigorous measurements. Section 7.4 discusses the automated evaluation framework needed to address this limitation.

**Industrial convergence as validation.** Beyond our operational data, the strongest evidence for the compounding hypothesis comes from convergent design. Three independent teams — building OpenClaw (this paper), Claude Code (Anthropic, 2026), and Meta-Harness (Lee et al., 2026) — arrived at strikingly similar architectures without communication. All three implement tiered file-based memory, periodic self-initiated cognitive cycles, prompt-defined multi-agent orchestration, and background memory consolidation. When independent engineering efforts converge on similar solutions, it suggests — though does not prove — that these patterns are well-suited to the problem. Convergence across different scales and use cases (personal assistant, commercial coding agent, benchmark optimiser) is suggestive of robustness, though we caution against treating it as proof of necessity.

### 5.1 First-Attempt Accuracy (FAAR)

We sampled 50 sessions from each measurement period and classified task outcomes:

| Error Category | FAAR Month 1 | FAAR Month 3 | FAAR Month 6 | ΔFAAR |
|---------------|-------------|-------------|-------------|-------|
| Operational tasks | 0.60 | 0.85 | 0.88 | +0.28 |
| File/path operations | 0.75 | 0.90 | 0.92 | +0.17 |
| Tool selection | 0.80 | 0.88 | 0.90 | +0.10 |
| **Weighted average** | **0.70** | **0.87** | **0.90** | **+0.20** |

The steepest improvements occurred in months 1–3, corresponding to the period when the operational-lessons file accumulated its most impactful entries. By month 6, FAAR had plateaued — not because the agent stopped learning, but because the remaining errors were genuinely novel rather than repeated.

**Ablation note:** We cannot rigorously isolate which mechanism drives FAAR improvement, as all four mechanisms were active throughout. However, we observe that the operational-lessons knowledge file — a direct output of fractal reflection — was the most frequently retrieved file during correct first attempts (appearing in retrieval results for 73% of sampled correct operational tasks in month 6, compared to 12% in month 1). This suggests fractal reflection is the primary driver, though we cannot rule out confounding effects from the other mechanisms.

### 5.2 Resource Efficiency (RER)

Token consumption per equivalent task decreased over time:

| Task Type | Month 1 (avg tokens) | Month 6 (avg tokens) | RER |
|-----------|---------------------|---------------------|-----|
| Morning briefing | ~4,500 | ~2,800 | 1.61 |
| PR review | ~6,200 | ~4,100 | 1.51 |
| Memory retrieval | ~1,800 | ~1,200 | 1.50 |
| **Weighted average** | | | **1.54** |

All three task types show RER > 1.0, confirming that the agent became more efficient over time. **Overhead note:** These token counts *include* the fractal reflection overhead — the reflection step itself consumes approximately 200–500 tokens per turn. The efficiency gains are net of this cost; without reflection, per-turn token counts would be lower but the compounding benefits that drive RER improvement would not materialise. The primary driver was not prompt optimisation but *knowledge accumulation*: the agent needed fewer exploratory tool calls because it already knew where to look, which commands to run, and what patterns to expect.

### 5.3 Retention and Transfer (TC)

The most compelling evidence for compounding came from cross-domain transfer. We define a **transfer event** as an instance where: (a) a lesson was encoded in the knowledge files from domain A, (b) the lesson was retrieved during a task in domain B (confirmed via retrieval logs), and (c) the task outcome in domain B was correct on first attempt where prior attempts without the lesson had failed. We identified three clear transfer events through manual log analysis meeting these criteria:

**Transfer Event 1: Verification discipline (code → calendar)**
An operational lesson learned during a failed git merge — "verify the current state before assuming the expected state" — later prevented an error in calendar management, where the agent would have created a duplicate event without first checking whether the event already existed. The lesson transferred because it was encoded at Level 3 (system level: "confidence without verification is the structural cause") rather than Level 1 (task level: "check git status before merge").

Estimated TC(code→calendar) ≈ 0.15 (the lesson prevented approximately 15% of the baseline calendar error rate).

**Transfer Event 2: Response format patterns (WhatsApp → Discord)**
Conversational patterns learned in WhatsApp group management — when to respond, when to stay silent, how to handle multi-party exchanges — transferred directly to Discord channels with minimal adaptation.

Estimated TC(WhatsApp→Discord) ≈ 0.25.

**Transfer Event 3: Tool fallback strategy (exec → memory)**
The lesson "try `read` before `exec` for file checks" (learned from repeated exec approval blocks) generalised to "try the simpler tool first" across multiple tool-selection decisions.

Estimated TC(exec→general_tools) ≈ 0.10.

These TC estimates are approximate and based on counterfactual reasoning (comparing error rates before and after the transfer event in the target domain). A rigorous TC measurement would require controlled experiments with and without the transferred knowledge — an important direction for future work.

**Cross-model transfer.** Meta-Harness (Lee et al., 2026) provides quantitative evidence for a stronger form of transfer: their math reasoning harness, evolved on one model, improved accuracy across five unseen models (+4.7 points average). Their text classification harness generalised from 3 training datasets to 9 unseen datasets without retraining. This demonstrates that prompt-level improvements transfer across both model and task boundaries—precisely the compounding property our framework predicts.

### 5.4 Composite Intelligence Index

Applying the CII formula with our primary weights (α=0.4, β=0.35, γ=0.25):

| Period | FAAR | RER | TC (avg) | CII |
|--------|------|-----|----------|-----|
| Month 1 | 0.70 | 1.00 | 0.00 | 0.3 |
| Month 3 | 0.87 | 1.30 | 0.10 | 0.5 |
| Month 6 | 0.90 | 1.54 | 0.17 | 0.6 |

![CII Improvement](fig-cii.png){ width=50% }

**Figure 4.** Composite Intelligence Index trajectory over six months, showing consistent improvement across all weight configurations (Table 1). The steepest gains occur in months 1--3 as the highest-value lessons are captured first.

CII increased by 96% from month 1 to month 6 under the primary weighting. As shown in the sensitivity analysis (Table 1, Section 4.4), the *direction* of improvement is consistent across weight configurations (+52% to +161%). However, we emphasise that the absolute CII values carry limited precision: the TC component relies on counterfactual estimates rather than controlled measurements, and the FAAR/RER components derive from spot-check sampling rather than exhaustive classification. We present CII as a directional indicator of compounding — useful for tracking trends within a single deployment — rather than a precise scientific measurement. The consistent upward trend across all weight configurations is the meaningful signal; the specific percentages should be interpreted cautiously. The steepest gains occurred in months 1–3 regardless of weighting, consistent with a learning curve that captures the highest-value lessons early and encounters diminishing returns as the "easy" compounding opportunities are exhausted.

![Prompt vs Model Boundary](fig-boundary.png)

**Figure 5.** The boundary between prompt-level intelligence (architecture, memory, orchestration --- compounds over time) and model-level intelligence (reasoning, coding, knowledge --- improves only through provider updates). Most available gains live at the prompt level.

### 5.5 The Prompt-Level vs Model-Level Boundary

During the six-month observation period, the underlying models were updated multiple times by their providers. These updates improved raw capability — better coding, longer context, improved instruction following. But they did *not* improve the agent's operational knowledge, accumulated lessons, or task-specific patterns.

Conversely, the prompt-level mechanisms described in Section 3 produced steady improvement *independent* of model updates. When a model update coincided with a prompt-level improvement, their effects were additive.

This suggests a practical rule: **invest in prompt-level compounding first, model upgrades second.** The former compounds indefinitely; the latter provides one-time jumps that benefit all users equally.

### 5.6 What Didn't Work

Intellectual honesty requires documenting failures:

1. **Over-writing:** The memory system writes too much. Without utility-based pruning, the knowledge files grew to include entries of marginal value, increasing retrieval noise. By month 6, the knowledge directory contained over 200 files, of which we estimate fewer than half are regularly useful.

2. **Reflection fatigue:** In high-frequency interaction sessions, mandatory reflection on every turn created visible latency and user frustration. The reflection protocol needs a "lightweight mode" for rapid exchanges where a full four-question reflection is disproportionate to the turn's complexity.

3. **Sub-agent fragility:** Spawned sub-agents do not survive process restarts. Long-running delegated tasks (research, document generation) are vulnerable to infrastructure interruptions, requiring manual re-initiation.

4. **Temporal memory gaps:** The file-based memory system has no built-in notion of time beyond filename dates. There is no way to query "what was I doing at this time last week?" without manual search. Temporal and relational memory linking remains an open problem.

5. **Evaluation limitations:** The N=1 deployment and manual log review methodology limit the generalisability of our findings. We cannot claim these results transfer to other users, domains, or agent architectures without broader evaluation.

---

### 5.7 Implementation: The Prefrontal Plugin

During the writing of this paper, we simultaneously implemented its architectural proposals as a production extension for the OpenClaw fork. The **Prefrontal Plugin** comprises approximately 4,500 lines of TypeScript across 15 modules, with 110 passing tests, delivered in 39 commits over a single day.

The implementation is structured in four priority tiers:

**P0 (live, hooked into every turn):**
- **Exploration gate** (`exploration-gate.ts`, 80 lines, 18 tests): blocks mutating tools (Edit, Write, exec) until the agent has performed at least one read-only operation (Read, Grep, Glob). This prevents the "confidence without verification" failure mode identified in Section 3.1 --- the agent must explore before it modifies. In practice, we observed this gate triggering on approximately 15% of turns during the first week of deployment, each representing a prevented blind-edit.
- **Anti-gold-plating rules** (`anti-goldplating.ts`, 50 lines, 11 tests): injects 11 engineering discipline rules into every prompt --- "don't add features beyond what was asked," "three similar lines are better than a premature abstraction," "read the file before modifying it." These rules operationalise the "deliberate simplicity" design principle from Section 3.
- **Forcing questions** (`forcing-questions.ts`, 50 lines, 9 tests): implements pre-action reflection --- five questions injected before complex tasks, closing the cognitive cycle described in Section 3.1.

**P1 (tested, wiring pending):**
- **Tool concurrency partitioner** (`tool-concurrency.ts`, 65 lines, 21 tests): classifies tools as concurrent (read-only, safe to parallelise) or serialised (mutating, one-at-a-time). This implements the safe tool partitioning principle from Section 3.
- **Prompt cache boundary** (`prompt-cache-boundary.ts`, 50 lines, 14 tests): splits the system prompt into static (cacheable across sessions) and dynamic (per-turn) segments, implementing the cache-aware prompt anatomy described in Section 3. Expected token savings: 30--50% on cache misses.

**P2 (tested, wiring pending):**
- **Fork sub-agents** (`fork-subagent.ts`, 45 lines, 13 tests): enables child agents that inherit the parent's rendered prompt, sharing the prompt cache. This mirrors Claude Code's forked agent pattern described in Section 3.3.
- **Deferred tool loading** (`deferred-tools.ts`, 80 lines, 14 tests): loads tool schemas on demand via a ToolSearch pattern rather than injecting all tool definitions into every prompt, reducing base prompt size.

**P3 (live, hooked):**
- **Permission hooks** (`permission-hooks.ts`, 50 lines, 5 tests): user-defined shell scripts gate tool calls, adding a human-in-the-loop safety layer not described in the original architecture but motivated by the transparency principles in Section 6.5.
- **Denial tracking** (`denial-tracking.ts`, 40 lines, 5 tests): prevents infinite tool-denial loops by escalating after three consecutive denials --- a failure mode we observed in production where the agent would retry a denied operation indefinitely.

The implementation also includes a **live observability UI**: a compact call tree panel (`prefrontal-tree.ts`) displaying agent topology with real-time phase indicators (thinking, tool execution, responding, reflecting), provider logos, and session tracking. A **guardian process** (`cron-health-gate.sh`) monitors the Prefrontal extension every three minutes and triggers automatic recovery if it becomes unresponsive.

A follow-up implementation session (same day) closed four of the five architectural gaps identified in the initial deployment:

- **Effort router** (`effort-router.ts`, 11 tests): monitors subagent spawns and logs warnings when expensive models (Opus) are assigned to simple tasks. Wired into the `subagent_spawned` hook. This operationalises the adaptive effort routing described in Section 3.4 --- not yet as an enforcing gate, but as an observability signal that feeds into future routing optimisation.

- **CORF trigger** (`corf-trigger.ts`, 12 tests): detects high-stakes decisions --- those involving irreversible actions, security-sensitive operations, or cross-domain trade-offs --- and flags them for SYNAPSE multi-model deliberation. This bridges Section 3.3's CORF parallelism with the live orchestration layer, routing complex decisions to the Round Table extension.

- **Feature flags** (`feature-flags.ts`, 5 tests): wraps every hook (exploration gate, anti-gold-plating, forcing questions, permission hooks, denial tracking, effort router, CORF trigger, FAAR tracker) in a per-hook enable/disable flag, configurable via gateway RPC. This enables the A/B testing capability described in Section 6.5 and provides continuous ablation data as a byproduct of normal operation.

- **FAAR tracker** (`faar-tracker.ts`, 13 tests): records every task outcome with category, model used, token count, and success/failure classification. Exposes metrics via `prefrontal.metrics` RPC endpoint. This begins to automate the manual log review methodology described in Section 5, moving toward the automated evaluation framework proposed in Section 7.4.

The total implementation now comprises 49 commits, 35 new files, 3,883 lines of code, and 151 passing tests across 12 test files. Six new gateway RPC methods expose real-time orchestration state. All hooks are feature-flagged for ablation studies.

**Remaining gaps.** The P1 modules (tool concurrency and prompt cache boundary) and P2 modules (fork subagents and deferred tool loading) remain tested but unwired, pending integration with the gateway runner. These represent the cache-optimisation layer --- important for cost efficiency but not for functional correctness. Additionally, the AMYGDALA neural action gating extension (Serra, 2026) was enabled during this session at 50% influence (Phase 1, `alphaPrudence=0.50`), marking its first production activation after weeks of nightly training with the models offline.

## 6. Discussion

### 6.1 The Compounding Hypothesis

Our central claim — that agent intelligence compounds through architecture, not model scale — has a strong form and a weak form.

The **strong form** states that prompt-level mechanisms can produce unbounded improvement over time, limited only by the quality of the reflection protocol and the capacity of the memory system. We do not have evidence for this claim. Our data covers six months, and improvement rates were already plateauing by month three.

The **weak form** states that prompt-level mechanisms produce significant, measurable improvement that is additive with model-level improvements and unavailable to agents that lack these mechanisms. We believe our data supports this claim, with CII increasing approximately 96% over six months (robust across weight configurations per Table 1) while the underlying models provided only incremental, non-compounding improvements. The caveats noted in Section 5.6 apply.

### 6.2 Why Files Beat Databases (For Now)

A common reaction to our file-based memory architecture is that it should be replaced with a proper database — vector store, graph database, or relational database with full-text search. We have resisted this for principled reasons:

1. **Human readability:** The operator can open any memory file in a text editor and see exactly what the agent remembers. This transparency is not a convenience — it is a safety mechanism. An agent with opaque memories is an agent that cannot be audited.

2. **Model compatibility:** Every language model can read markdown. Not every model can execute SQL queries or traverse graph structures effectively.

3. **Graceful degradation:** If the retrieval system fails, the agent can still function by reading files directly. A database failure is more catastrophic.

4. **Editability:** Correcting a false memory is a text edit. Correcting a false embedding in a vector store requires re-embedding, re-indexing, and hoping the correction propagates through similarity searches.

These advantages are contingent on scale. At some point — perhaps thousands of knowledge files, perhaps millions of memory entries — the file-based approach will break down. Packer et al. (2023) demonstrate that programmatic memory management becomes necessary as context demands grow. But for a personal assistant with hundreds of files, the simplicity-to-capability ratio favours files.

### 6.3 Comparison with Skill Libraries

Voyager's skill library (Wang et al., 2023) accumulates executable programs; our knowledge files accumulate natural-language lessons. Both are implementations of the same principle — intelligence as accumulated, reusable competence — but they target different abstraction levels. Voyager skills are precise and machine-executable but narrow; our lessons are fuzzy and require model interpretation but transfer more broadly. A hybrid approach — compiling frequently-used natural-language lessons into structured, executable patterns (perhaps via DSPy-style compilation) — is a promising direction.

### 6.4 The Model-Level Horizon

What would change if foundation model providers exposed more of their models' internal reasoning? Two possibilities are particularly relevant:

**Per-turn state coupling:** If models could maintain hidden state between turns — not just the context window, but actual learned adjustments — the amnesia tax would be partially addressed at the model level. This would not eliminate the need for external memory (the state would still be lost across sessions) but would reduce within-session re-learning.

**Reasoning transparency:** If models exposed their chain-of-thought reasoning in a structured, machine-readable format (rather than natural language), the fractal reflection protocol could operate on the model's *actual* reasoning rather than its *reported* reasoning. This would improve reflection quality and reduce the risk of confabulated self-assessments.

Both possibilities are speculative but directionally likely as providers compete on agent-friendliness.

### 6.5 Deployment Patterns: Feature-Flagged Cognitive Architecture

Claude Code's codebase uses 44 feature flags to gate experimental cognitive capabilities, with dead-code elimination stripping disabled features from production builds. This deployment pattern enables A/B testing of individual cognitive mechanisms — effectively providing continuous ablation data as a byproduct of normal operation. Our current architecture deploys all mechanisms simultaneously, making formal ablation studies (Section 7.6) the only path to isolating individual contributions. Feature-flagged cognitive architecture is a practical direction for future work.

A related observation: the Claude Code source also revealed that production agent systems make deliberate architectural choices about agent transparency — some systems require agents to identify themselves, others enable concealment. Our architecture requires transparency by design (identity files are loaded into every prompt), which we consider both an ethical and practical advantage for trust calibration, though a full discussion of agent identity ethics is beyond this paper's scope.

### 6.6 The Bitter Lesson for Orchestration

Meta-Harness (Lee et al., 2026) and our own experience converge on a provocative conclusion: the orchestration layer — system prompts, memory schemas, reflection protocols — is the last handwritten piece of the AI stack. As foundation models improve, self-evolved architectures will increasingly outperform hand-tuned ones. The recursive stacking insight is key: as models improve → harness optimisation improves → effective performance improves → better training signal for the next cycle. This is the logical endpoint of our compounding thesis. The video commentary on the Claude Code leak made this connection explicit: "Now we can plug Claude Code into Meta-Harness and allow it to recursively self-improve" — the three-way convergence is not just theoretical but operationally achievable.

---

## 7. Future Work

### 7.1 Utility-Based Memory Pruning

The most urgent architectural gap is the absence of utility-based pruning. Memories should be evaluated for their expected future usefulness before being written, and periodically re-evaluated for relevance. MemexRL (Chen et al., 2026) provides a theoretical framework; implementation within a file-based system requires translating value estimates into retention decisions.

### 7.2 Learned Forgetting

Complementary to pruning, learned forgetting would actively decay memories that have not been accessed or referenced within a time window. This is analogous to the spaced repetition principle: memories that are never tested are effectively lost.

### 7.3 Temporal and Relational Memory Linking

Current memory files exist in isolation. A knowledge entry about "git merge safety" does not link to the incident that produced it, the daily log entry that recorded it, or the project it was relevant to. Adding temporal (when) and relational (why, what-else) links would enable queries like "show me everything related to the README incident" or "what lessons were learned during the J-011 paper project?"

### 7.4 Automated Evaluation Framework

The metrics defined in Section 4 require automated measurement to move beyond the manual log review methodology used here. Building a pipeline that classifies tasks, measures first-attempt accuracy, tracks resource consumption, and estimates transfer coefficients would transform compounded intelligence from a qualitative observation to a quantitative science. This would also enable evaluation across multiple users and deployments, addressing the N=1 limitation of this study.

### 7.5 Learned Action Gating

A critical gap in our current architecture is **action gating** — the ability to recognise that a proposed action is dangerous before executing it. We have observed failure modes where the agent had all the information needed to avoid a catastrophic action (e.g., overwriting a carefully-maintained file during an automated merge) and proceeded anyway, because safety rules are encoded in prompt text rather than learned intuition.

A promising direction is moving safety rules from prompt-level instructions into small neural networks that learn to gate actions through situation embeddings — converting implicit pattern recognition ("this feels like it could go wrong") into explicit, learned safety rules. We have begun exploring this direction in a companion paper, **AMYGDALA** (Adaptive Modulation of Your General Disposition via Affective Learned Association; Serra, 2026), which proposes learned action gating through an ensemble of lightweight prudence networks trained on operational data. This would also alleviate **context pressure** — the 2,000–3,000 tokens currently consumed by safety instructions in the system prompt could be recovered for task context.

### 7.6 Formal Ablation Studies

Our current results cannot isolate the contribution of individual mechanisms. A rigorous ablation study — systematically disabling fractal reflection, tiered memory, CORF, and adaptive routing — would quantify each mechanism's contribution to the overall CII improvement. This is technically straightforward but operationally expensive, requiring parallel deployments over multiple weeks.

### 7.7 Self-Evolving Agent Architecture

The most provocative direction suggested by the three-way convergence is applying the compounding principle *to the architecture itself*. Currently, our reflection protocol, memory schema, and routing rules are hand-designed. Meta-Harness (Lee et al., 2026) demonstrates that these can be automatically optimised: their system treats the entire harness — prompts, tools, orchestration code — as the optimisation target, using execution traces as the fitness signal.

Applied to PREFRONTAL, this would mean: the fractal reflection prompt evolves based on which reflections actually prevented future errors; the memory tier boundaries shift based on which tiers are most frequently retrieved; the CORF fan-out strategy adapts based on which model combinations produce the best cross-validation results. Each component improves itself through the same compounding mechanism it provides to the agent's task performance.

Claude Code's KAIROS mode includes a feature called autoDream — a background consolidation process where a forked subagent reviews session transcripts, merges observations, removes contradictions, and converts vague insights into absolute facts. This is automated self-improvement applied to memory content. Extending it to memory *structure* — letting the system discover optimal tier boundaries, index formats, and retrieval strategies — is the natural next step.

![Recursive Self-Improvement Flywheel](fig-flywheel.png){ width=60% }

**Figure 7.** The recursive self-improvement flywheel. Each component's improvement accelerates the others: better models enable better harness optimisation, yielding higher agent performance, generating better training signal. Three independent teams (OpenClaw, Claude Code, Meta-Harness) are already on different segments of this cycle.

The recursive stacking insight is key: as foundation models improve, harness optimisation becomes more effective, which improves the agent's performance, which generates better training signal for the next improvement cycle. We are not yet on this curve, but the ingredients exist.

### 7.8 Pre-Action Reflection

Our current architecture reflects only *after* action. GStack's "office hours" pattern (Tan, 2026) demonstrates the value of structured reflection *before* action — six forcing questions that reframe the problem before any code is written. A complete cognitive cycle would include both: pre-action reflection to refine intent and anticipate failure modes, and post-action reflection to extract lessons and update knowledge. Implementing pre-action reflection would require a mechanism to detect task complexity and trigger deliberation only when warranted — trivial tasks should not incur the overhead of six forcing questions.

---

## 8. Conclusion

Intelligence that doesn't compound isn't intelligence — it's capability. A calculator has capability. A human who learns from each calculation has intelligence.

We have argued that persistent AI agents can be made genuinely intelligent — in Chollet's sense of efficient skill acquisition — through four architectural mechanisms that operate entirely at the prompt level. Fractal reflection converts events into reusable rules. Tiered memory gives those rules a place to live across sessions. CORF parallelism exploits provider diversity. Adaptive routing matches effort to difficulty.

The evidence from six months of OpenClaw operation supports the weak form of the compounding hypothesis: these mechanisms produce significant, measurable improvement that is additive with model-level advances. FAAR increased from 0.70 to 0.90, RER reached 1.54, and cross-domain transfer of operational lessons was observed with estimated TC values of 0.10–0.25. The Composite Intelligence Index increased 96% over the observation period under our primary weighting, with sensitivity analysis confirming improvement of +52% to +161% across five weight configurations.

The strongest evidence, however, may be architectural convergence itself. When Anthropic's Claude Code — developed independently by a team with no knowledge of our work — arrives at the same tiered memory, the same periodic cognitive cycles, the same prompt-defined orchestration, and the same background consolidation, the simplest explanation is that these patterns are well-adapted to the problem — convergent solutions that independent teams discover when facing the same constraints. Combined with Meta-Harness's independent validation of harness-level compounding and GStack's convergence on role-based prompt specialisation, the pattern is clear: the architecture described in this paper is not one possible design for persistent agent intelligence — it reflects patterns the problem strongly favours.

The honest assessment is that this is early work with significant limitations. The evaluation is based on a single deployment, the metrics are derived from manual log review, and several proposed extensions (AMYGDALA, learned forgetting, ablation studies) remain future work. But the direction is clear: the next frontier in agent capability is not bigger models but smarter architectures — systems that learn from their own operation and compound that learning over time.

The intern who never makes the same mistake twice is not the one with the biggest brain. It's the one who writes things down.

---

---

## Appendix A: Fractal Reflection Pseudocode

```
ALGORITHM: FractalReflection(turn_context, memory_files)

Input: turn_context (user message, agent response, tool calls, outcomes)
       memory_files (current memory hierarchy)
Output: set of file writes W, set of direct edits E

W <- {}; E <- {}

# Step 1: MEMORY -- persist new knowledge
new_facts <- extract_facts(turn_context)
for each fact f in new_facts:
    target <- classify_tier(f)    // ephemeral | working | knowledge | identity
    W <- W + {(target, f)}

# Step 2: PATTERN -- multi-level abstraction
L1 <- describe_event(turn_context)
L2 <- identify_pattern(L1, memory_files.knowledge)
if L2 reveals structural cause:
    L3 <- identify_system(L2)
    W <- W + {(knowledge, L3)}
if L3 challenges assumption:
    L4 <- question_worldview(L3)
    W <- W + {(knowledge, L4)}

# Step 3: RIPPLE -- scan for staleness
surfaces <- {code, docs, online_presence, memory_files}
for each surface s in surfaces:
    stale_items <- check_staleness(s, turn_context)
    for each item in stale_items:
        if estimated_fix_time(item) < 2 minutes:
            E <- E + {fix(item)}
        else:
            W <- W + {(ripple_tracker, item)}

# Step 4: IMPROVE -- opportunistic fixes
improvements <- scan_for_improvements(memory_files, turn_context)
for each improvement in improvements:
    E <- E + {apply(improvement)}

execute(W, E)
return W, E
```

---

## References

Chollet, F. (2019). On the Measure of Intelligence. *arXiv preprint arXiv:1911.01547*. https://arxiv.org/abs/1911.01547

Chen, W. et al. (2026). MemexRL: Reinforcement Learning for Agent Memory Management. *arXiv preprint arXiv:2603.04257*. https://arxiv.org/abs/2603.04257

Khattab, O. et al. (2023). DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines. *arXiv preprint arXiv:2310.03714*. https://arxiv.org/abs/2310.03714

Li, X. et al. (2026). CraniMem: Neural Memory Compression for Persistent Agents. *arXiv preprint arXiv:2603.15642*. https://arxiv.org/abs/2603.15642

Madaan, A. et al. (2023). Self-Refine: Iterative Refinement with Self-Feedback. *NeurIPS 2023*. https://arxiv.org/abs/2303.17651

Maharana, A. et al. (2024). LoCoMo: Long-Context Memory Benchmark for Conversational Agents. *arXiv preprint arXiv:2402.09714*. https://arxiv.org/abs/2402.09714

Packer, C. et al. (2023). MemGPT: Towards LLMs as Operating Systems. *arXiv preprint arXiv:2310.08560*. https://arxiv.org/abs/2310.08560

Park, J. S. et al. (2023). Generative Agents: Interactive Simulacra of Human Behavior. *UIST 2023*. https://arxiv.org/abs/2304.03442

Park, S. et al. (2026). Governed Memory: Access Control and Governance for Agent Memory Systems. *arXiv preprint arXiv:2603.17787*. https://arxiv.org/abs/2603.17787

Serra, O. (2026). AMYGDALA: Adaptive Modulation of Your General Disposition via Affective Learned Association — Learned Intuition for Persistent AI Agents. *Independent Research*.

Shinn, N. et al. (2023). Reflexion: Language Agents with Verbal Reinforcement Learning. *NeurIPS 2023*. https://arxiv.org/abs/2303.11366

Wang, G. et al. (2023). Voyager: An Open-Ended Embodied Agent with Large Language Models. *NeurIPS 2023*. https://arxiv.org/abs/2305.16291

Wang, Z. et al. (2026). Ares: Autonomous Agent Self-Evaluation and Improvement. *arXiv preprint arXiv:2603.07915*. https://arxiv.org/abs/2603.07915

Lee, Y. et al. (2026). Meta-Harness: End-to-End Optimization of Model Harnesses. *arXiv preprint arXiv:2603.28052*. https://arxiv.org/abs/2603.28052

Zhang, Y. et al. (2026). A Comprehensive Survey of Memory Architectures for LLM-Based Agents. *arXiv preprint arXiv:2603.07670*. https://arxiv.org/abs/2603.07670

Anthropic (2026). Claude Code source code. Accidentally exposed via npm source map in @anthropic-ai/claude-code v2.4.88, March 31, 2026. 512,000 lines of TypeScript across approximately 1,900 files. Analysis repository: https://github.com/chauncygu/collection-claude-code-source-code

Tan, G. (2026). GStack: A development process framework for AI-assisted solo developers. https://github.com/garytan/gstack

Nouse Research (2026). Hermes Agent: Self-improving personal AI agent with closed learning loop. https://github.com/nousresearch/hermes-agent

Paperclip (2026). Open-source orchestration for zero-human companies. https://github.com/paperclip-ai/paperclip
