Agent Harnesses Under the Hood
A source-level tour of seven agent harnesses and a final comparison: execution loops, durable sessions, context management, tools, and security boundaries.
8 articles · Read in order

Claude Code Under the Hood: A Recovery-Oriented Agent Harness
An unverified source snapshot shows a harness designed around recovery: explicit loop transitions, streaming tool execution, layered context defenses, and replayable session history.
Codex Under the Hood: Making the Sandbox a First-Class Agent Concern
A source-level tour of Codex's Rust harness: multi-signal turn completion, PTY-backed execution, layered sandbox policy, replayable JSONL history, and an app-server interface.
opencode Under the Hood: Durable State, Live Streams, and Reversible Sessions
A source-level look at opencode's TypeScript harness: database-backed session projections, streamed tool events, layered compaction, reversible workspace snapshots, and blocking approvals.
Pi's Small Agent Harness: Queues, Session Trees, and an Honest Security Boundary
Pi keeps its agent runtime deliberately small: a two-queue loop, append-only session trees, and extensions in place of built-in product features. Its most important decision is equally explicit: it provides no sandbox.
OpenClaw's Agent Gateway: Sessions, Persistent Work, and Optional Isolation
OpenClaw turns an agent loop into a persistent gateway for chat channels. Session keys, serialized lanes, heartbeats, cron jobs, and optional sandbox backends address the risks of an assistant that keeps running when you leave the terminal.
Hermes Agent's Durability Rule: Persist Before a Tool Can Act
Hermes Agent centers its safety model on a simple ordering rule: write an assistant tool call to SQLite before executing it. Combined with iteration budgets, protocol repair, non-destructive compaction, and layered terminal controls, that rule supports long-running autonomous work.
DeepSeek Harness: An Auditable, Composable Agent Runtime
How DeepSeek Harness turns a small agent loop into a configurable product: turn and step scheduling, waterfall tools, event-sourced sessions, and a carefully bounded fail-closed subprocess sandbox.
Can DeepSeek Harness Reproduce Six Other Agent Harnesses?
A final comparison of seven agent harnesses, with a strict distinction between DSH capabilities that are shipped, supported by partial plugin evidence, and suggested only by an architectural seam.