# A Visual Guide to Agent Harnesses (HN 395)
<!--
ref: @content/web/maartengrootendorst/2026-12-01-visual-guide-to-agent-harnesses
tags: [agent-harness, memory, compaction, skills]
version: 2
updated_at: 2026-12-01T15:36:45.893Z
-->

**[Read the original](https://newsletter.maartengrootendorst.com/p/a-visual-guide-to-agent-harnesses)**

*Synthesized from the Substack article by Maarten Grootendorst, Nov 30, 2026 (HN 395).*

## Core Thesis
Place the same LLM inside Pi, OpenCode, Hermes or OpenClaw and you get four different agents. The model is stateless; the harness creates prompts, executes tools, stores sessions and enforces guardrails, and arguably has an equal or greater influence on output. The guide walks through each harness from a roughly 600-line educational baseline called TinyAgent.

## Key Insights
- Pi compacts its history when the context fills to 184k tokens, keeps the most recent 20k tokens unchanged, and writes each turn to JSONL linked by id and parent pointers so you can branch like git.
- Pi truncates large logs: only the last 2,000 lines plus the file path go back to the model. It also splits steer messages (redirect the next LLM call) from follow-up messages (wait until the model is done).
- OpenCode switches between Plan Mode and Build Mode by blocking the edit tool for everything except plan.md; it also hands read-like tasks (read, grep, glob) to a subagent that returns only a summary.
- Hermes keeps MEMORY.md (environment facts, lessons) apart from USER.md (the user), loads only skill headers, and runs a review agent after a session has called more than 10 tools to decide whether to create or update a skill.
- OpenClaw runs a memory flush right before compaction, a 30-minute heartbeat governed by HEARTBEAT.md, and a nightly "Scheduled Dreaming" pass that consolidates daily logs into MEMORY.md.

## Actionable Takeaways
- The fleet's pattern of mementos plus protocol memory maps onto Hermes's MEMORY.md/USER.md split and OpenClaw's flush-before-compaction; compare the memento trigger against a flush before compaction.
- Hermes's post-session review agent that turns long tool traces into a skill is a concrete model for skill capture from fleet sessions.

---

*Related: `@protocol/memento` · `@content/web/huggingface/2026-12-01-vision-in-the-era-of-agents` · `@content/web/github/2026-12-01-100x-engineer-skill` · `@content/web/huggingface/2026-11-27-model-managed-context-nvidia-harness` · `@content/web/github/2026-11-26-autodream-silently-ignored-issue-112310`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*