Effective harnesses for long-running agents
01:00 · November 26, 2025 · Antropic Engineering Blog

Agents still face challenges working across many context windows. We looked to human engineers for inspiration in creating a more effective harness for long-running agents.
Summary
As AI agents take on complex tasks that span hours or days, the fundamental constraint is that each new session starts with no memory of prior work. Context windows force agents to operate in discrete shifts, much like engineers arriving on a project with no handover notes. The Claude Agent SDK provides compaction to manage token usage within a single window, yet this mechanism alone proves insufficient for sustained progress on production-grade applications.
The practical response is a two-part harness. An initializer agent runs first and creates the necessary scaffolding: a comprehensive JSON file listing every required feature, each initially marked as failing, plus supporting scripts such as an init.sh that starts the development server and performs a basic end-to-end check. Subsequent coding agents are then instructed to advance exactly one feature at a time, updating only the status field in the JSON file while leaving the codebase in a merge-ready state.
To prevent agents from guessing at prior changes or declaring work complete prematurely, each coding session must produce both a git commit with a descriptive message and an entry in a claude-progress.txt file. These artifacts allow the next agent to reconstruct the current state quickly. Explicit instructions also require the agent to verify functionality through browser automation rather than relying solely on unit tests or server responses, addressing the common failure of marking incomplete features as done.
Even with these measures, certain limitations persist. Vision constraints in tools such as the Puppeteer MCP prevent reliable detection of browser-native elements like alert modals, and the approach remains specialized for full-stack web development. Broader questions also remain open, particularly whether a single general-purpose agent or a collection of specialized agents yields better results across extended workflows.
Why it matters
Highly actionable for Product Teams and Builders with concrete implementation guidance, exact model references (Opus 4.5), and workflow strategies directly applicable to agent development and observability.




