arXiv:2610.17616cs.SEOct 2026

Manuscript Offprint

arXiv:2610.17616

StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agents

Chuan Zou, Yujun Zhou, Xiaonan Luo, Xiangliang Zhang

ABSTRACT

Long-horizon coding requires agents to maintain an evolving view of the project they are changing: what problem is currently being solved, what has already been learned or modified, which other artifacts may be affected, and what work remains unresolved. When this information is scattered across a growing interaction history, local edits can become disconnected from their later consequences and progress can be difficult to carry forward. We introduce StateHarness, a runtime framework that maintains evolving project state without updating model parameters. The working agent records its current problem and hypothesis, important findings and decisions, discovered repository relationships, and unfinished work. Runtime support prompts record updates, searches for callers, tests, and documentation that may be affected by a change, and maintains a compact working brief for subsequent decisions. When behavioral signals accumulate, a separate diagnostic session revisits the recorded history and surfaces overlooked evidence. Across three repository-level evaluations, StateHarness improves task completion and several measures of change consistency. On RefactorBench, full-chain completion increases from 29.4% to 35.3% and cleanup-check accuracy from 87.0% to 95.4%. On five LHTB software-engineering tasks, mean reward improves from 0.427 to 0.576, exceeding LongHorizon-Harness at substantially lower recorded execution cost. On ChainSWE, bug-fix rate increases from 35.1% to 39.5% and residual debt decreases from 60 to 43 items, although pass-to-pass regressions increase. These results show that maintaining project state can improve long-horizon coding while introducing measurable execution and regression trade-offs. Code is available at https://anonymous.4open.science/r/StateHarness.

1 INTRODUCTION

Recent advances in large language models have moved automated programming from isolated code generation toward coding agents that interact with development environments, invoke tools, and carry out multi-step software engineering tasks (Yao et al., 2023; Yang et al., 2024; Wang et al., 2024). These agents now operate directly in real repositories, while the tasks themselves are expanding from issue resolution to complex multi-file changes, feature development, and sustained software evolution (Jimenez et al., 2024; Deng et al., 2025; Zhou et al., 2026a; Le et al., 2025; Lam et al., 2026).

This shift exposes a mismatch between how agents work and how software projects are organized. An agent experiences a task as a trajectory of file reads, edits, tests, and observations. A software project, however, is a structured and evolving system: modules serve different roles, implementations interact across files and layers, and a local change can affect callers, tests, documentation, or other dependent artifacts many steps later. Without a persistent project-level view, the agent may repeatedly reconstruct the same understanding from raw code, lose track of the wider consequences of a local edit, and scatter progress, decisions, and unfinished work across a growing trajectory. Recent evaluations expose related failures, including forgotten requirements in multi-turn coding (Raghavendra et al., 2026), reduced implementation faithfulness when specifications emerge gradually (Yan et al., 2026), and structural degradation under repeated code extension (Or

References (66)