cd /news/ai-agents/what-an-agent-harness-actually-owns-… · home › topics › ai-agents › article
[ARTICLE · art-173603] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

What an agent harness actually owns: 8 reads on loops, cost routing, exactly-once, durability and spec authority

A developer's reading roundup examines what an agent harness actually owns across eight write-ups, covering Claude Code's roughly 1,700-line query loop, cache-safe model routing that recovers about 14–21% of model spend in an emulated 10,000-seat company, and the Limbo sandbox paper's 25,930 graded episodes testing where exactly-once semantics should live. The roundup argues that when a read-back can't confirm what happened, the fix belongs in the tool's API via idempotency keys and status queries, and highlights SpecHarness, which compiles specs into source-linked obligations and a versioned ledger so the agent proposes while the runtime commits.

recommendation

Put exactly-once semantics in the tool contract with idempotency keys and status queries whenever a read-back can't confirm a timed-out write, and keep routing cache-safe to avoid re-sending context.

more in playbook: Designing agent systems
by read4 min views1 publishedNov 21, 2026

Ask five engineers what an "agent harness" is and you'll get five answers. For some it's the while-loop around the model call. For others it's the retry wrapper, the spec checker, the durable store, or the whole repository the agent works in. I spent the last few weeks reading longer write-ups on each of those layers, and the eight below are the ones I keep coming back to. Each gets a short summary in my own words and a link to the full piece.

A textbook ReAct loop fits in five lines of pseudocode. Claude Code's query.ts is roughly 1,700. This walkthrough reads that file and pulls out a five-layer pattern: a compaction pipeline that runs before every API call, tools that start executing while the model is still streaming, recovery paths for overflow and rate limits, and so on. It's a good map if you're writing your own loop and wondering what you'll end up adding anyway.

Read: the agent harness pattern behind Claude Code's core loop A preprint from Accenture's Responsible AI group argues that enterprise coding-agent spend is decided less by per-token rates than by the harness: which model answers, what it reads, and whether switching models throws away the prompt cache. In their emulated 10,000-seat company, cache-safe routing recovers about 14–21% of model spend. The post explains why a single turn with 18 tool steps re-sends the same context 19 times, and what procurement should be asking vendors.

Read: routing and cost governance when you control the harness A write times out. Did it go through? Retrying blindly means a second charge or a second deploy; giving up skips work. The Limbo sandbox paper ran 25,930 graded episodes across nine models, three production harnesses and two contract variants to ask where exactly-once should live. The short answer: it depends on whether an immediate read-back can show what happened. When it can't, no model or wrapper saves you, and the fix belongs in the tool's API (idempotency keys, status queries).

Read: exactly-once between model, harness and tool contract This one connects three very different stories: Anthropic replacing git with an in-house system after daily merges jumped from about 2,500 to over 30,000, a game developer turning his game into something an agent can drive, and OpenAI's Codex-only repository. The common thread is that once code is cheap, the bottleneck is whether the environment is queryable, reproducible, measurable and enforceable. My favorite line of advice in it: almost nobody needs custom version control, but almost everybody benefits from headless tests that print text and numbers.

Read: why environment legibility is the new harness work Most coding agents assume a human will notice a crash and hit "continue". Pi Durable, shipped with Pi 1.0, targets Slack on-call bots and shared incident workspaces where sessions must survive deploys and dropped clients. The article lines it up against Temporal, Durable Objects and LangGraph checkpointers and asks a sharp question of each: when the process dies, do you lose progress, or can a write fire twice?

Read: what durable agent harnesses actually guarantee In most setups the SKILL.md, the schema and the task instructions just become more context for the same model that later declares "done". SpecHarness compiles those specs into source-linked obligations and a versioned ledger, so the agent proposes and the runtime commits. The write-up separates two gaps worth naming in your own reviews: understanding a requirement is not executing it, and claiming completion is not proving the required state exists.

Read: SpecHarness and who holds the pen Mobile planning agents are expensive to develop because real-device runs are slow and hard to parallelize. Alibaba's Qwen-Planner-Agent paper describes a closed loop: a human-gated data flywheel, online RL with a competence-aware reward scheme, and runtime memory, skills and tools that get revised from failure traces. The 27B model tops MobilePA-Bench at 77.05 overall. The post is careful to note that the authors frame co-evolution as a pathway, not something already automatic.

Read: [planner–harness co-evolution in Qwen-Planner-Agent](https://redreamality.com/blog/qwen-planner-agent-model-harness-coevolution/)

If you let an optimizer keep rewriting prompts, memory and control code until the score rises, it may learn the benchmark's habits rather than the task: filename patterns, the order of retrieval channels, where unit notes usually sit. The CHASE paper adds a Challenger that searches for meaning-preserving protocol changes that wipe out the gain. Task holdout stops item memorization; it doesn't stop a harness from eating the protocol.

Read: [Bad Genius and counterfactual checks on harness evolution](https://redreamality.com/blog/bad-genius-counterfactual-harness-evolution/)

If you only have time for two, I'd start with #3 and #8. They're the ones most likely to change what you test before shipping an agent. Earlier lists in this series covered [agent memory and context](https://dev.to/redreamality_dev/where-agent-memory-actually-breaks-6-reads-on-read-time-curation-stale-updates-heavy-tails-and-4693) and [agent skills](https://dev.to/redreamality_dev/agent-skills-after-the-install-button-6-reads-on--gain-checks-conflicts-state-machines-2ffn).
── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/what-an-agent-harnes…] indexed:0 read:4min 2026-11-21 · —