SearchBook a call

RESEARCH / PAPERS

published

Comparative harness teardown: DeepSeek Harness, Hermes, OpenClaw, rea, and Claude Code

Architectural teardown of DeepSeek Harness, Hermes, OpenClaw, rea, and Claude Code 2.1.305: plugin seams, memory, evidence, and binary analysis.

Agent harnesses solve a recurring set of systems problems—extensibility, memory and prompt-cache economics, provenance, browser and artifact inspection, sandboxing, and perceived latency—in sharply different ways. This teardown synthesizes three primary architecture and reverse-engineering studies conducted for Dexter across five production systems: DeepSeek Harness (dsh), Hermes Agent, OpenClaw, rea, and the local Claude Code 2.1.305 binary. Every finding below traces directly to the source repositories, documentation, and binary strings inspected during those studies, and ends with an explicit architectural verdict on what Dexter adopts, extends, rejects, or defers.

Scope and sources

Five systems were studied across three areas—plugin composition, self-learning and operational hygiene, and tool/runtime surface:

System Source & version studied Primary architectural contribution
DeepSeek Harness (dsh) deepseek-ai/deepseek-harness, MIT, developer preview, commit dd6322d604 (docs/architecture.md, docs/capability-seams.md, apps/cli/src/plugin.ts) Cordis-based everything-is-a-plugin composition, fine-grained capability seams, two-layer event spine, context and tool-result pruning
Hermes Agent NousResearch/hermes-agent and hermes-agent-self-evolution Closed-loop procedural skill memory, frozen session-start prefix-cache memory, /journey knowledge graph, /learn and GEPA trajectory optimization, hermes doctor --fix
OpenClaw openclaw/openclaw (memory-artifact-provenance.ts) SHA-256 memory artifact provenance, agent vs untrusted origin classification, symlink rejection, custodian workflows and daemon hygiene
rea github.com/morluto/rea, v6.8.0, MIT, TypeScript/turborepo (server id io.github.morluto/rea) Clean-architecture layering across CLI and MCP, explicit evidence records with coverage and limitations, split passive/declarative browser tooling
Claude Code Local Claude Code 2.1.305 binary (Mach-O arm64, ~260 MB, Bun-compiled), alongside local Chrome and pi documentation Single-binary versioned packaging, hookable tool and permission events, first-class plan and permission modes, OS-level sandboxing, pull-based background shell polling

No dsh code is vendored into Dexter; the studies extract architectural patterns and record explicit adoption boundaries.

DeepSeek Harness and plugin architecture

DeepSeek Harness (dsh) is built on Cordis (@cordisjs/core) and takes an everything-is-a-plugin position in which there is no privileged core. Even subsystems that other harnesses treat as built-in runtime internals are plugins stacked onto the same shared context.

Five ideas behind dsh

  1. One context, everything a plugin. Every package contributes to a shared context (ctx): services, typed events, and reversible effects. Registrations are scoped—an agent’s registrations unwind when it goes away—and effects such as timers, listeners, and watchers dispose themselves on unload.
  2. Capability seams. Services are divided into a small core spine and swappable seams with multiple interchangeable implementations. For example, ctx.llm backs llm-deepseek, llm-pi-ai, and llm-replay; separate seams cover tokenMeter, toolResultPruner, sessions, attachments, filesystem access, and shell access. Consumers depend on the seam interface rather than any concrete implementation, so swapping a provider or pruner is a configuration change.
  3. Profiles and bundles. A profile (web, headless, sdk, acp) is a named stack of layers. A bundle is a distribution unit that self-declares in its package.json (dsh.bundle, dsh.profile). Users reshape a profile through a patch file (cordis.patch.yml) instead of editing the base composition.
  4. Two-layer event spine and waterfall interceptors. dsh strictly separates durable session events (session/event, replayed from JSONL on resume so the log remains the source of truth for everything the model saw) from ephemeral live control and status events (agent/*). Intercepting hooks (agent/pre-step, system-prompt/assemble, agent/request) run as a waterfall in which each handler can stop the chain or delegate with next(). Alongside this spine, dsh treats context compaction and tool-result pruning as first-class harness operations so multi-hour coding sessions do not degrade model attention.
  5. Distribution. dsh plugin --profile <name> <args...> acts as a thin pnpm forwarder that reconciles a profile’s layer list against installed dependencies whenever a package declares dsh.bundle. Discovery relies on the dsh-plugin GitHub topic.

Mapping dsh concepts to Dexter

Mapping dsh point by point against Dexter’s existing extension runtime shows that Dexter already covers most of the underlying pattern through a coarser surface inherited from pi:

dsh concept Dexter equivalent Verdict
Cordis context (ctx) ExtensionAPI passed to each extension: registration methods plus a typed event bus Have, different shape
Typed events, waterfall interceptors on(event, handler); interceptors (tool_call, turn_end, before_provider_request, input, plus session_start, before_agent_start, tool_result, context) return results that alter the flow Have
Reversible effects, scoped registration on() returns an unsubscribe function; TUI components receive dispose(); /reload re-runs loaders Have
Capability seams replaceable built-ins: an extension registering the same tool, command, or flag takes over from subagents, plan-mode, codemode, tool-search, mcp, model-routing (with kit, cron, and learning also registered as built-in extensions) Have, narrower
Bundles self-declaring in package.json The pi manifest key (extensions, skills, prompts, themes) read from npm, git, and local-path installs Have, pi’s namespace
Profile patch files (cordis.patch.yml) Settings overrides (+path/-path enable/disable across user and project scopes) and -e on the CLI Have, different mechanism
Named profiles (web, headless, sdk, acp) Fixed run modes (tui, rpc, json, print) plus resource enablement Partial—modes are fixed, not user-named sets
Session log as source of truth Session entries: everything model-visible is persisted as an entry in the session file Have (inherited from pi)
Plugin distribution dexter install/remove/update/list over npm:, git:, and local-path sources Have, no discovery

Where Dexter extends this seam architecture directly is dual-lane model routing (dexter/auto), which pairs a frontier reasoning model (supervisor lane) for planning and read-only analysis with a fast coding model (executer lane) once file mutations begin.

Plugin verdicts: adopted, rejected, and deferred

What dsh genuinely has that Dexter lacks is fine-grained seams everywhere and user-named compositions. The F4 plugin architecture study splits the response into three buckets:

  • Adopted now:
    1. Self-declaration under Dexter’s own namespace. Packages may declare their resources under a dexter key in package.json as an alias for the pi key with the same fields. Dexter-first packages no longer have to wear pi’s namespace, while existing pi packages keep loading unchanged under the compatibility policy.
    2. An explicit seam vocabulary. Naming Dexter’s existing seams—tools, commands, keyboard shortcuts, CLI flags, message and tool renderers, markdown transformers, providers and virtual models, system-prompt context, and event hooks—makes roadmap work concrete. Built-in replaceable extensions act as pre-declared implementations over those seams, and replacement works by name collision so conflicts stay local and visible in dexter list and the config TUI.
  • Rejected:
    1. A Cordis-style service-injection container (ctx). Dexter’s compatibility surface with pi extensions is the registration API. Introducing a DI container would fork that contract to buy composability at a granularity Dexter does not need; dsh requires fine-grained seams because every subsystem is swappable, whereas Dexter’s seams are intentionally few and coarse.
    2. An everything-is-a-plugin core. Dexter ships built-ins as direct code and marks the replaceable ones; plugin-izing the rest adds indirection without a consumer.
  • Deferred (with explicit revisit triggers):
    1. User-named profiles (dexter --profile review): defer until users actually juggle multiple extension sets, at which point a profiles map in settings can expand to existing +/- overrides.
    2. Topic-based plugin discovery (dsh-plugin-style GitHub topic): defer until there is an external plugin ecosystem to discover; dexter install npm: and git: suffice today.
    3. A usage/cost seam (comparable to ctx.tokenMeter): the existing cost table handles routing decisions; expose usage to extensions as an event once an extension wants to build on it.

Hermes Agent and closed-loop self-learning

Hermes Agent (NousResearch/hermes-agent) and its companion repository hermes-agent-self-evolution focus on turning completed sessions into durable capability without breaking LLM prompt caching.

Core mechanisms in Hermes

  • Procedural skill memory (skill_manage). The agent creates, refines, and archives its own SKILL.md files from lived experience, guarded by a static security scanner (skills_guard).
  • Frozen prefix-cache memory (MEMORY.md and USER.md). Persistent notes are injected into the system prompt as a frozen snapshot at session start. Mid-session writes persist to disk immediately for future sessions without mutating the active session’s system prompt prefix, preserving 100% LLM KV-cache hit rates across turns.
  • Visible learning graph (/journey). learning_graph.py renders a knowledge graph linking procedural skills through related_skills frontmatter edges and linking memory entries through lexical affinity edges.
  • Trajectory crystallization (/learn and GEPA). /learn synthesizes session trajectories into reusable skills, while hermes-agent-self-evolution applies evolutionary trace optimization (GEPA) to test candidate skill and prompt mutations against verification gates.
  • Harness diagnostics (hermes doctor --fix). Multi-category health checks inspect configuration, credentials, tools, and persistent state, with automatic --fix remediation.

How Dexter adopts and extends Hermes

Dexter implements these primitives inside the built-in learning extension (packages/coding-agent/src/extensions/learning/):

  • memory manages MEMORY.md and USER.md with frozen session-start prompt snapshots.
  • skill_manage provides SKILL.md create, edit, delete, and list operations behind static security scanning.
  • learning_graph powers /journey and /learn.
  • Automatic self-healing telemetry (extension beyond Hermes). Dexter augments Hermes’s static skill-and-memory graph with live failure-to-fix tracking: when a tool returns isError: true, the agent modifies code via edit or write, and a subsequent invocation of that tool succeeds, Dexter records a verified heal node and injects top verified fixes into <self_healing_playbook>.
  • dexter doctor [--fix] [--json]. Adapts the multi-category diagnostic pattern to inspect config JSONs, credential vault permissions, inbuilt kit engines (trove, terbium, curl_reap), keepalive locks, and user skills, automatically repairing state issues when --fix is passed.

OpenClaw, provenance, and daemon hygiene

OpenClaw (openclaw/openclaw) addresses what happens once an agent harness keeps persistent memory and runs background jobs: untrusted workspace content can try to poison long-lived agent state, and unattended loops need explicit operational guardrails.

Core mechanisms in OpenClaw

  • Memory artifact provenance (memory-artifact-provenance.ts). Tracks SHA-256 content digests and origin classifications (agent vs untrusted) for MEMORY.md and USER.md. Symlinked memory files are explicitly rejected so a repository or untrusted workspace cannot redirect writes or reads into persistent agent memory.
  • Custodian skills and autonomous daemon hygiene. Ships dedicated custodian workflows covering provider onboarding, gateway diagnostics, and scheduled background jobs.

How Dexter adopts and extends OpenClaw

  • SHA-256 memory provenance and symlink guards. LearningGraphStore records SHA-256 digests on every agent write to MEMORY.md and USER.md. On load, files modified outside the tool are tagged trust="untrusted" in the system prompt, and symlinked memory or skill files are refused on read and write.
  • OS keychain credential vault (dexter credential / dexter login). Stores API keys in macOS Keychain or Linux libsecret (secret-tool), with 0600 file-permission fallback verified by dexter doctor.
  • Self-healing autonomous keepalive (dexter keepalive --heal-retries <n>). Applies daemon hygiene to supervised ROADMAP.md execution using rolling spend caps, a PAUSE kill-switch file, and bounded self-healing recovery retries.

rea: evidence discipline and browser architecture

rea (“Reverse engineer anything”, github.com/morluto/rea, v6.8.0, MIT, TypeScript/turborepo, server id io.github.morluto/rea) is both a CLI and an MCP server exposing reverse-engineering workflows to agents across native binaries (Ghidra, IDA, and Hopper bridges), Electron and JavaScript apps, .NET assemblies, Android (adb, apktool), Frida instrumentation, WebAssembly, EVM, packet captures (pcap), and the web platform.

Clean layering and engine abstraction

rea enforces strict clean-architecture layering mirrored by its test tree:

  • src/domain: pure value schemas and view schemas with no I/O.
  • src/application: per-domain services that compose I/O.
  • src/composition: engines wiring domain types to application services.
  • src/contracts: thin adapter layers for MCP tool definitions and CLI commands.

Because nothing complex lives in the MCP layer and the same application services back both interfaces, the CLI and MCP server stay in lockstep. External toolchains (bun, python, csharp, dotnet, node) sit behind an engine abstraction that manages per-engine environments and versions. Every tool returns deterministic structured values plus normalized results rather than raw logs.

Evidence discipline

The single mechanism most worth adopting from rea is its structured evidence record. Every rea tool result carries:

  • evidence_id
  • raw_result and normalized_result
  • coverage: either complete or unknown, never silently overstated
  • limitations: an explicit array stating what the result does not prove

Evidence is stored in a retained session bundle so downstream tools (such as compare_web_captures) can reference earlier records by evidence_id, keeping multi-step reverse engineering auditable. Dexter adopts this output convention as the target shape for kit tools: normalized payload first, explicit coverage and limitations, and raw output retained only when cheap.

Split browser model and locator discipline

rea deliberately separates browser work into two distinct halves rather than presenting a single general automation surface:

  1. Passive observation. list_browser_targets and inspect_web_page attach to a user-owned Chrome instance over CDP and read documents, storage, network state, workers, and source bundles without injecting synthetic input. Because the human drives the session, behavioral evidence remains trustworthy.
  2. Declarative scenario capture. capture_browser_scenario executes a fixed linear action list (goto, click, fill, press, select_option, wait_for, request, wait_for_timeout) against a fresh browser. Locators form a discriminated union (test_id, role, css), service workers are blocked by default, request steps are restricted to the start URL origin, and there is no arbitrary script injection in the default path. Captured artifacts (screenshots and traces) carry digests so runs can be compared deterministically.

A live coding agent needs an interactive superset—persistent CDP control with snapshot, click, fill, press, screenshot, and eval—which Dexter ships in its kit browser tools. From rea, Dexter retains the locator hierarchy (test_id, then role, then css, with text last; always snapshot before acting) and the evidence-record shape, while pointing users who need deterministic scenario capture or full RE bridges to npx rea or dexter mcp add with the published rea-agents MCP server.

Claude Code 2.1.305: binary inspection and harness surface

Unlike the four open-source projects above, Claude Code 2.1.305 was examined directly as a local binary alongside local Chrome and pi documentation.

Binary packaging and deployment

Inspection of the local executable shows:

  • A single-file Mach-O arm64 binary of roughly 260 MB.
  • Bun-compiled packaging (bun-darwin-aarch64 strings present), with the JavaScript application embedded alongside the runtime and no external node_modules directory.
  • A versioned installation layout under ~/.local/share/claude/versions/<version> pointed to by a stable symlink at ~/.local/bin/claude, allowing auto-update to swap versions atomically.

Harness surface from strings analysis

Strings analysis surfaces five architectural layers inside the binary:

  • Tool surface: Bash, BashOutput, KillShell, Read, Write, Edit, MultiEdit, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, NotebookEdit, and SlashCommands. Separating BashOutput and KillShell from Bash gives streaming pull-based control over long-running commands.
  • Hook events: PreToolUse, PostToolUse, SessionStart, SessionEnd, UserPromptSubmit, Notification, Stop, SubagentStop, PreCompact, and PermissionRequest. PreToolUse can block or rewrite tool calls; exposing PermissionRequest as an event makes permissioning itself hookable.
  • Permission modes: default, acceptEdits, plan, and bypassPermissions. Plan mode is implemented as a first-class state rather than a prompt convention.
  • OS-level sandboxing: macOS seatbelt (sandbox-exec) profiles and Linux bubblewrap, paired with a sandbox-runtime concept that confines shell commands without requiring container images.
  • Session management and daemon: auto-compaction near context limits, SubagentStop as a distinct lifecycle event, output styles, a general-purpose subagent archetype, and a local daemon (daemon.lock, daemon.status.json) holding authentication and background state across sessions.

Why it feels fast

Four design choices explain the binary’s perceived responsiveness:

  1. The model never waits on UI: tool results stream back as content blocks, including screenshots returned inline as images.
  2. Pull-based background shell polling: BashOutput and KillShell move long-running tasks off the critical path.
  3. First-class plan and permission modes: reduce interactive interruptions without removing safety gates.
  4. Automatic context maintenance: auto-compact plus aggressive context pruning preserve an effective context window without manual user intervention.

Synthesis: Dexter’s architectural decisions

Putting the five teardowns together clarifies both what Dexter built immediately and where it intentionally diverged.

Source system Adopted or extended in Dexter Refused or deferred
DeepSeek Harness (dsh) Replaceable built-in extensions with explicit seam vocabulary; dexter alias for pi in package.json; dual-lane routing (dexter/auto); lifecycle hooks Rejected Cordis-style DI container (ctx) and everything-is-a-plugin core; deferred user-named profiles, GitHub-topic discovery, and extension usage/cost seam
Hermes Agent learning extension (memory, skill_manage with static security scan, learning_graph for /journey and /learn); frozen session-start prefix-cache memory; automatic heal nodes and <self_healing_playbook>; dexter doctor --fix GEPA evolutionary trace optimization not implemented in core
OpenClaw SHA-256 digests on MEMORY.md and USER.md, trust="untrusted" tagging on external edits, symlink refusal; OS keychain credential vault (0600 fallback); supervised dexter keepalive --heal-retries with PAUSE switch and rolling spend cap —
rea Locator discipline (test_id, role, css, text last; snapshot before acting); evidence-record shape (normalized result, explicit coverage and limitations); kit inspect_artifact for Mach-O/ELF/PE, architecture, entropy sections, printable strings, and Electron embedded-JS extraction Interactive CDP superset built in kit rather than rea’s non-interactive capture-only surface; full RE bridges left to external rea-agents MCP server
Claude Code 2.1.305 Interactive raw-CDP kit browser tools with inline screenshot image blocks and optional attach to user-owned Chrome; artifact introspection; roadmap parity items Command sandboxing (sandbox-exec / bubblewrap confinement for bash) and BashOutput/KillShell-style polling logged as priority roadmap parity items after browser tools

Two engineering lessons cut across all five systems. First, runtime ergonomics and cache economics dominate model choice: frozen prefix-cache memory (Hermes), context/tool-result pruning (dsh and Claude Code), and non-blocking tool execution with inline image blocks (Claude Code) directly determine whether multi-hour agent runs remain affordable and responsive. Second, trust boundaries must be structural, not aspirational: SHA-256 provenance and symlink guards (OpenClaw), explicit coverage and limitations on evidence records (rea), hookable permission checks and OS-level command confinement (Claude Code), and explicit replacement seams visible to inspection (dsh and Dexter) turn harness safety from prompt advice into auditable system properties.

← All papers