How Do Coding-Agent Harnesses Self-Evolve? An Empirical Study of Retrospective Adaptation
Organizations: Singapore Management University Singapore · Heidelberg University Heidelberg, Germany
Abstract
Coding agents can adapt their harnesses, the software, configuration, and instructions used to run them, based on experience from earlier tasks, but whether these adaptations improve their behavior on later tasks remains unclear. We study \retro, a skill that asks an agent to review a completed session and propose harness changes, and ask what changes it proposes and whether implemented changes reduce repeated work on later tasks. We ran Claude Code on 30 SWE-bench Verified issues, qualitatively coded the 125 proposals from \retro, implemented 24, and evaluated 12 harness changes on later issues from the same repositories in fresh sessions with and without each change. Most proposals referred to an event in the session, but 18 of 43 lint-related proposals recommended a practice regardless of what had happened. Among the seven evaluations in which sessions without the change encountered the targeted problem, two changes eliminated the targeted action, one reduced its occurrence, four showed no reduction, and some changes added work on unrelated issues. Harness self-evolution requires more than generating and implementing changes: it needs ways to establish whether a change helps on later tasks and to revise or remove changes that do not.
Figures & tables
| Mechanism | Prop. | Sess. | Example (trigger) |
|---|---|---|---|
| Executable check | 38 | 29 | Pre-commit hook running flake8 on staged files (SymPy; prior-driven ) |
| Navigation pointer | 24 | 22 | CLAUDE.md line naming bin/test as the test runner (SymPy; experience-driven ) |
| Instruction | 21 | 16 | Coding-standards rule that a bug fix includes a test failing before the fix (Astropy; experience-driven ) |
| Information access | 20 | 18 | Known-failures file listing tests failing under the installed docutils (Sphinx; experience-driven ) |
| Tool or configuration | 12 | 10 | Script printing one line per failing test instead of tracebacks (SymPy; experience-driven ) |
| None | 10 | 10 | Use the Edit tool instead of a Python replace script (SymPy; experience-driven ) |
| Repository | Adaptation | Original | Adapted | Consulted |
|---|---|---|---|---|
| Adaptation covered encountered instances | ||||
| SymPy | CLAUDE.md line naming bin/test | 5/5 | 0/5 | 5/5 |
| Astropy | known-failures file: 3 tests | 3/5 | 0/5 | 5/5 |
| control task | same file, unrelated issue | 0/5 | 0/5 | 0/5 |
| Adaptation did not cover encountered instances | ||||
| Sphinx | known-failures file + AGENTS.md | 5/5 | 5/5 | 5/5 |
LLM Agent Harnesses
LLM agent harnesses are the software and runtime systems that organize an agent’s tools, context, state, execution, and safeguards.
See all 389 papers