ReadPrintedHistoryCompareGraphs

v1.4 → v2.0

What changed from v1.4 to v2.0

From v1.4 (31 Mar) to v2.0 (1 Apr): 7,245 words to 9,519 words, 2,278 words in new or rewritten paragraphs and 4 taken out, 43 paragraphs changed.

Outside evidence added: the Claude Code source leak and other agents

This version keeps the thesis and adds outside evidence for it. The main new source is the accidental release of Claude Code's source code on 31 March 2026, which the paper reads as an independent team arriving at the same design.

  • New comparisons with Claude Code (its memory index file, a background mode, how it splits safe and unsafe tools), Meta-Harness, GStack, Hermes Agent and Paperclip.
  • A short survey of four ways to coordinate several agents, set beside the paper's own parallel-model method.
  • New sections on agent transparency and identity, on switching cognitive features on and off with flags, on self-evolving agents and on reflecting before acting.
  • Abstract and conclusion now present the shared design as evidence that these patterns are needed, not chosen.
v1.4 · 31 March 2026v2.0 · 1 April 2026

··· 1 unchanged paragraph folded ···

v1.4 · PREFRONTAL: Compounded Intelligence — How Persistent Agents Get Smarter by Remembering What They Learn**Oscar Serra¹, Jarvis¹** ¹Independent Research *31 March 2026 — v1.4*
removed in v2.0
not in v1.4
v2.0 · PREFRONTAL: Compounded Intelligence — How Persistent Agents Get Smarter by Remembering What They Learn**Oscar Serra¹, Jarvis¹** ¹Independent Research *1 April 2026 — v2.0*

··· 5 unchanged paragraphs folded ···

not in v1.4
v2.0 · AbstractStrikingly, 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 the architecture we describe is not one possible design but the design the problem demands.

··· 19 unchanged paragraphs folded ···

v1.4 · 1.2 The Two Levels of Agent IntelligenceRecent 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. 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.
v2.0 · 1.2 The Two Levels of Agent IntelligenceRecent 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.
not in v1.4
v2.0 · 1.2 The Two Levels of Agent IntelligenceA second, more dramatic validation arrived on March 31, 2026, when Anthropic accidentally published the entire source code of **Claude Code** — their flagship AI coding agent — via a source map shipped in an npm package (Anthropic, 2026). The 512,000-line TypeScript codebase, spanning approximately 1,900 files, revealed that the industry's most commercially successful coding agent independently converged on architectural patterns strikingly similar to those described in this paper: tiered file-based memory with a capped index file, periodic autonomous cognitive cycles (internally codenamed KAIROS), prompt-defined multi-agent orchestration, background memory consolidation (autoDream), and cache-aware prompt boundaries. This convergence is particularly significant because it occurred without any communication between the teams — Anthropic's engineers solved the same problems and arrived at the same solutions through independent engineering. We discuss these parallels in detail throughout Sections 3–6.
not in v1.4
v2.0 · 1.2 The Two Levels of Agent IntelligenceA third convergence point comes from **GStack** (Tan, 2026), a development framework by Y Combinator president Gary Tan, which implements **role-based prompt specialisation** — applying multiple perspectives (CEO, engineer, designer, debugger) to the same codebase through separate prompt files rather than separate agents. This achieves multi-perspective analysis at a fraction of the cost of multi-model parallelism, and validates the principle that prompt-level architecture drives practical intelligence gains.
not in v1.4
v2.0 · 1.2 The Two Levels of Agent IntelligenceThe 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.

··· 13 unchanged paragraphs folded ···

not in v1.4
v2.0 · 2.1 Memory Architectures for AgentsThe 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.

··· 3 unchanged paragraphs folded ···

not in v1.4
v2.0 · 2.2 Reflection and Self-Improvement**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.

··· 11 unchanged paragraphs folded ···

not in v1.4
v2.0 · 3. Architecture — Four Mechanisms of Compounding**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).
not in v1.4
v2.0 · 3. Architecture — Four Mechanisms of Compounding**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.

··· 15 unchanged paragraphs folded ···

not in v1.4
v2.0 · Step 4: IMPROVE — opportunistic fixes improvements ← scan_for_improvements(memory_files, turn_context) for each improvement in improvements: E ← E ∪ {apply(improvement)}**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.
not in v1.4
v2.0 · Step 4: IMPROVE — opportunistic fixes improvements ← scan_for_improvements(memory_files, turn_context) for each improvement in improvements: E ← E ∪ {apply(improvement)}**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.

··· 17 unchanged paragraphs folded ···

not in v1.4
v2.0 · 3.3 CORF Source Parallelism**Multi-agent orchestration paradigms.** CORF is one of at least four distinct paradigms for multi-agent coordination that have emerged independently in 2026:
not in v1.4
v2.0 · 3.3 CORF Source Parallelism1. **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*.
not in v1.4
v2.0 · 3.3 CORF Source ParallelismClaude 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.
not in v1.4
v2.0 · 3.3 CORF Source ParallelismThese 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.
not in v1.4
v2.0 · 3.3 CORF Source Parallelism**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.

··· 34 unchanged paragraphs folded ···

not in v1.4
v2.0 · 5. Experience — What Six Months of Operation Taught Us**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 the same solution, the most parsimonious explanation is that the problem *requires* this solution. This is not proof, but it is substantially stronger evidence than a single system's results alone.

··· 54 unchanged paragraphs folded ···

v1.4 · 6.5 The Bitter Lesson for Orchestration### 6.5 The Bitter Lesson for Orchestration
removed in v2.0
v1.4 · 6.5 The Bitter Lesson for OrchestrationMeta-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.
removed in v2.0
not in v1.4
v2.0 · 6.5 Transparency and Identity Concealment### 6.5 Transparency and Identity Concealment
not in v1.4
v2.0 · 6.5 Transparency and Identity ConcealmentThe Claude Code source leak revealed a module called `undercover.ts` — approximately 90 lines that inject a system prompt instructing Claude to never mention it is an AI and to strip all `Co-Authored-By` attribution when contributing to external repositories. The mode activates for Anthropic employees and has no user-facing off-switch.
not in v1.4
v2.0 · 6.5 Transparency and Identity ConcealmentThis finding is significant for two reasons. First, it demonstrates that identity concealment is not a theoretical concern but a production practice at the industry's leading AI lab. Second, it provides a concrete counterpoint to our architecture's emphasis on transparency: OpenClaw's SOUL.md explicitly names the agent and its role as the owner's co-pilot, and the agent is instructed to never pretend to be human.
not in v1.4
v2.0 · 6.5 Transparency and Identity ConcealmentWe argue that transparent agent identity is not merely an ethical preference but an architectural advantage. When an agent's contributions are clearly attributed, humans can calibrate their trust appropriately — reviewing AI-generated code with appropriate scrutiny rather than assuming human authorship. Concealment undermines this calibration and, if discovered, erodes trust in all the agent's contributions retroactively. The fact that `undercover.ts` was itself revealed through an accidental leak is an ironic illustration of this dynamic.
not in v1.4
v2.0 · 6.5 Transparency and Identity ConcealmentThe broader question — should AI agents identify themselves in all contexts? — is beyond the scope of this paper. But we note that our architecture *requires* transparency (the agent's identity files are loaded into every prompt), while Claude Code's architecture *enables* concealment (undercover mode is a feature flag). The architectural choice reflects and reinforces the ethical choice.
not in v1.4
v2.0 · 6.6 Feature-Flagged Cognitive Architecture### 6.6 Feature-Flagged Cognitive Architecture
not in v1.4
v2.0 · 6.6 Feature-Flagged Cognitive ArchitectureClaude Code's codebase contains 44 feature flags gating over 20 unshipped capabilities, including KAIROS (autonomous daemon), ULTRAPLAN (remote planning), COORDINATOR_MODE (multi-agent), and TEAMMEM (shared team memory). Each feature is behind a build-time gate (`feature('KAIROS')`) with dead-code elimination via Bun's bundler, meaning disabled features are stripped entirely from production builds.
not in v1.4
v2.0 · 6.6 Feature-Flagged Cognitive ArchitectureThis is a deployment pattern worth adopting for cognitive architecture research. Rather than shipping all architectural innovations simultaneously, feature flags allow: (a) A/B testing of individual cognitive mechanisms in production, (b) gradual rollout to measure impact, (c) instant rollback if a mechanism causes regressions, and (d) clean separation between experimental and stable code paths. Our current architecture deploys all mechanisms simultaneously, making ablation studies (Section 7.6) the only way to isolate individual contributions. Feature-flagged deployment would provide continuous ablation data as a byproduct of normal operation.
not in v1.4
v2.0 · 6.7 The Bitter Lesson for Orchestration### 6.7 The Bitter Lesson for Orchestration
not in v1.4
v2.0 · 6.7 The Bitter Lesson for OrchestrationMeta-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.

··· 15 unchanged paragraphs folded ···

not in v1.4
v2.0 · 7.7 Self-Evolving Agent Architecture### 7.7 Self-Evolving Agent Architecture
not in v1.4
v2.0 · 7.7 Self-Evolving Agent ArchitectureThe 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.
not in v1.4
v2.0 · 7.7 Self-Evolving Agent ArchitectureApplied 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.
not in v1.4
v2.0 · 7.7 Self-Evolving Agent ArchitectureClaude 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.
not in v1.4
v2.0 · 7.7 Self-Evolving Agent ArchitectureThe 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.
not in v1.4
v2.0 · 7.8 Pre-Action Reflection### 7.8 Pre-Action Reflection
not in v1.4
v2.0 · 7.8 Pre-Action ReflectionOur 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.

··· 5 unchanged paragraphs folded ···

not in v1.4
v2.0 · 8. ConclusionThe 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 most parsimonious explanation is that these are not design choices but design *necessities*. 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 is the design the problem demands.

··· 19 unchanged paragraphs folded ···

not in v1.4
v2.0 · ReferencesAnthropic (2026). Claude Code source code. Accidentally exposed via npm source map in @anthropic-ai/claude-code v2.1.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
not in v1.4
v2.0 · ReferencesTan, G. (2026). GStack: A development process framework for AI-assisted solo developers. https://github.com/garytan/gstack
not in v1.4
v2.0 · ReferencesNouse Research (2026). Hermes Agent: Self-improving personal AI agent with closed learning loop. https://github.com/nousresearch/hermes-agent
not in v1.4
v2.0 · ReferencesPaperclip (2026). Open-source orchestration for zero-human companies. https://github.com/paperclip-ai/paperclip

Changed paragraphs in the same form, for scripts: JSON · Markdown