Agent Harness Cost Optimization: 2.6× Variance & Agency

Author
DeepSeekAgent.io Editorial Team
Published
Updated

“System Optimizations for Cost-Efficient Agent Harnesses” studies a frequently missed source of Agent cost: with the model and task held constant, system prompts, tool descriptions, history layout and the execution loop can still change the bill. The paper reports cost differences of up to 2.6× across Harness configurations on the same model and task.

It also introduces Agency, an interposition layer that applies cost optimizations to existing Harnesses such as Claude Code and Codex without modifying the model. Its proof-of-concept techniques report up to 35% lower cost across real-world benchmarks without reducing task accuracy.

Where Agent cost accumulates

The final answer is only part of the bill. Every step may resend system instructions, tool schemas, history and new tool results. Long tasks add failed retries, repeated search, SubAgent fan-out and compaction.

Two Harnesses using the same model can therefore produce different input-token totals and model-call counts because of prefix size, visible tool menus, retained history, stopping logic and recovery behavior.

2.6× is not a model-capability gap

The paper frames Harness-side variance primarily as a cost effect rather than claiming that one prompt simply makes the model smarter. More expensive execution is not necessarily more accurate; it may resend context, invoke irrelevant tools or continue after the task is complete.

A DSH cost comparison should record model, task, Harness release, Profile, visible tools, SubAgent count, compactions and final status. A single total-token number cannot identify which layer created the expense.

Agency as an interposition layer

Agency sits between an existing Harness and its model/environment interfaces. A shared abstraction can reduce wasted tokens and unnecessary model calls while carrying the same optimization across different Harnesses.

The design also suggests a DSH plugin pattern: cost control can be an independent layer that observes per-turn context, capability catalogs and trajectories, then decides when to trim, cache, combine or stop instead of placing every policy in the system prompt.

Four practical DSH checks

Limit the tool catalog

Expose only capabilities required by the current task. Large MCP schemas and repeated tool descriptions accumulate on every call. Deferred Tools and on-demand plugins can reduce the initial catalog.

Keep request prefixes stable

Stable system and tool prefixes are easier for provider caches to reuse. Injecting timestamps, counters or changing state into the prefix invalidates reuse even when the core rules are identical.

Give SubAgents deliverables and budgets

Every child task needs an artifact, a turn budget and a stopping condition. Unbounded parallel research duplicates work while increasing both parent and child Session cost.

Separate recovery from re-execution

After a network failure, determine whether the provider completed the request and whether tools produced side effects before choosing continue, retry or rollback. Blind replay increases cost and duplicate-action risk.

Run a controlled cost comparison

Choose fixed tasks, pin the model and reasoning level, and record cost, input/output tokens, model calls, tool calls, elapsed time, SubAgent count and success criteria. Change one Harness variable at a time, such as tool catalog, compaction threshold or cache policy.

The reported 2.6× and 35% results belong to the paper's tested configurations. The useful next step is applying the method to your own DSH workload. See DSH SubAgent token billing and large MCP catalog cost.

References