Anthropic publishes an article on the engineering blog on how to design more effective harness structures for long-running, multi-turn AI agents across multiple rounds. The team pointed out that when existing agents build complex projects, they often have phenomena such as "half disconnected and restarted" due to limited context windows, and misjudged that the task has been completed, making it difficult to continue and steadily advance in multiple sessions.
To this end, this paper proposes a two-stage solution of "Initializer agent + coding agent" in the Claude Agent SDK: run the environment built by Initializer for the first time, generate a detailed feature list, initialize the git repository, create a progress log and init.sh script; After reading these artifacts, the coding agent selects only one open feature, completes the implementation and self-test, submits the code, and updates the progress record to keep the environment in a "clean state" that can continue development at any time.
The authors argue that this engineering constraint significantly mitigates the forgetfulness and drift of long-term agents, making them behave closer to process-adhering human engineers rather than one-time completion tools. The current experiment is mainly for full-stack web application development, and the future direction includes the introduction of specialized agents such as testing, quality assurance, and refactoring, and the extension of similar methods to other long-term tasks such as scientific research and financial modeling.
FAQ
Q: What does this "Long-term Agent Harness" article address?
A: The article focuses on issues such as AI agents easily forgetting context during multiple rounds of long tasks, breaking gears in the middle of tasks, or declaring completion prematurely, and explores how to keep agents moving steadily across multiple sessions.
Q: What does the Initializer agent do in the scenario?
A: It builds a basic environment during the first run, including generating feature requirements lists, creating git repositories and progress logs, writing init.sh, etc., providing a clear starting point for subsequent coding agents.
Q: How does a coding agent differ from the traditional "auto-write the entire project" approach?
A: The coding agent only selects one feature to implement each time, submits the code and updates the log after completing the self-test, emphasizing small steps and environment cleanup to avoid chaos caused by excessive changes at one time.
Q: Are these practices only applicable to web application development?
A: The current example is for a full-stack web project, but the author believes that ideas such as feature lists, progress files, and incremental submissions are expected to be extended to other long-term agency tasks such as scientific research and financial modeling.