LongHorizon-Harness
An open-source execution, state-management, and result-verification harness for running AI agents on long-horizon tasks across desktop apps and the CLI.
At a Glance
Fully free and open-source under the MIT License. Install via pip or uv.
Engagement
Available On
Alternatives
Listed Aug 2026
About LongHorizon-Harness
LongHorizon-Harness is an open-source Python framework published by AMAP-ML that wraps existing AI agent runtimes—Claude Code, Codex CLI, and OpenClaw—in a structured Manage-Execute-Audit (MEA) loop designed to keep complex, multi-step tasks on track without context drift. Released under the MIT License, it reached v0.1.3 in August 2026 and is available on PyPI via a single uv tool install lh-harness command.
What It Is
LongHorizon-Harness is a harness layer, not a new model or agent. It sits on top of existing agent runtimes and coordinates three structurally isolated roles—Manager, Executor, and Auditor—so that task state is maintained outside any single growing context. The core insight is that existing harnesses let execution, task state, and completion assessment share one expanding context, which causes compounding errors, context rot, and task-state loss. LongHorizon-Harness externalizes state and updates it only with facts independently verified from the environment.
The Manage-Execute-Audit Loop
Each round of the MEA loop applies three operators in sequence:
- Manager: Reads the original task, the current verified task state, and all prior audit reports. It emits a single subtask contract with a goal, acceptance criteria, boundary constraints, and relevant prior evidence.
- Executor: Starts from a fresh context containing only what the current round supplies, performs the state-changing action (GUI or CLI), then discards its raw trajectory. It is the only role allowed to modify the environment.
- Auditor: Inspects the real environment through read-only tools against the contract's acceptance criteria, without ever seeing the executor's reasoning or self-assessment. Only results that pass this independent check enter the persistent task state.
The loop runs for up to 30 rounds by default (configurable). Audit reports are the only cross-round memory, keeping dense step-level observations out of long-term coordination.
Benchmark Results
The project reports consistent gains across three long-horizon benchmarks when swapping only the harness while keeping the same backbone (Qwen 3.7-Plus) and execution backend (Claude Code):
- WeaveBench (114 hybrid GUI+CLI tasks): PassRate improved from 51.8% to 80.7% (+28.9 points); the DOC domain reached 100.0%.
- OSWorld 2.0 (108 desktop workflows): Binary completion multiplied by 3.0× (2.8% → 8.3%); partial score rose from 21.5 to 35.2.
- Terminal-Bench 2.1 (hard CLI tasks): Success rate rose from 69.7% to 77.2% while consuming 24% fewer tokens than the baseline.
The project also reports that on the Claude Opus 4.7 subset of OSWorld 2.0 (34 tasks), swapping only the harness lifted binary completion by +14.7 points and partial score by +11.1.
Architecture and Token Efficiency
Coordination overhead is low by design. According to the project's own token attribution analysis, the Manager accounts for only 2.0–8.1% of total tokens across benchmarks. The Auditor is the larger investment at 19.4–38.1%, but the overall token cost tracks the backbone model rather than the harness architecture. On Terminal-Bench 2.1, the harness consumed fewer tokens than the baseline while improving performance.
A lightweight AgentAdapter interface lets Claude Code, Codex CLI, OpenClaw, and Hermes Agent serve as interchangeable backends for any of the three roles. Different models can be assigned to different roles through configuration alone—for example, a capable model for the Manager and Auditor with a cheaper model for the Executor.
Setup Path
Installation requires Python 3.10+ and at least one agent runtime (claude or codex) on PATH. The recommended path uses uv:
uv tool install lh-harnesslh-harness plugin install codex-computer-use(oropen-computer-usefor GUI tasks)lh-harness initin the project directory to generate.lh-harness/config.tomllh-harness run --task "..." --agent codex
A lh-harness doctor command checks all prerequisites and reports broken installs. The Dashboard opens automatically in the browser and shows each round's plan, execution result, audit evidence, and rework reason in real time. Every run is stored under .lh-harness/runs/<run-id>/ with a full audit trail.
Update: v0.1.3
The latest release (v0.1.3, 2026-08-07) adds a plain-language final reply answering the task from verified state alone, defaults task execution to the directory the harness was launched from, and adds per-round console reporting. v0.1.2 (2026-08-06) introduced unified computer-use plugin management, stronger auditor read-only checks and role isolation, reliable process cleanup, and expanded doctor diagnostics. The project reports reaching #1 on the Hugging Face Daily Papers weekly ranking for the week of 2026-W32.
Community Discussions
Be the first to start a conversation about LongHorizon-Harness
Share your experience with LongHorizon-Harness, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under the MIT License. Install via pip or uv.
- Manage-Execute-Audit loop
- Claude Code and Codex CLI backends
- Computer-use plugin management
- Live Dashboard
- Full audit trail per run
Capabilities
Key Features
- Manage-Execute-Audit (MEA) loop for long-horizon task execution
- Externalized task state updated only by independent audit
- Fresh-context executor per round to prevent context rot
- Read-only auditor that never sees executor reasoning
- Backend-agnostic AgentAdapter for Claude Code, Codex CLI, OpenClaw
- Per-role model and backend assignment via configuration
- Computer-use plugin management (codex-computer-use, open-computer-use, clawdcursor)
- Live Dashboard for monitoring and human intervention
- Isolated run directories with full audit trail
- lh-harness doctor for environment verification
- MCP server configuration for both Claude Code and Codex
- Configurable per-role timeouts and round limits
- Plain-language final reply from verified state
- Support for GUI and CLI workflows in one continuous task
- Evaluation reproduction suites for WeaveBench and OSWorld 2.0
