Anthropic’s New Approach to AI Agents: Bridging the Gap Between AI and Human Coders
Anthropic recently unveiled its research on enhancing AI agents for complex, long-running tasks, moving beyond simple, single-prompt interactions. Alongside the release of Opus 4.5, they published a groundbreaking article detailing how to build more effective “harnesses” for these agents, essentially creating a structured framework that mimics the workflow of human software engineers. This new approach aims to solve the persistent problem of AI agents losing context and making errors during tasks that span hours or even days.
[00:02.822]
When Anthropic released Opus 4.5, they also published an article titled “Effective harnesses for long-running agents.” This piece outlines their research into improving the Claude Agent SDK to better handle extensive, long-duration tasks. The core idea is to shift AI agents away from a “vibe-coding” approach, where they try to accomplish everything in one go, towards a more disciplined, structured process similar to how human developers work.
[00:39.532]
With the launch of Opus 4.5, Anthropic announced several product updates, including two major upgrades for Claude Code. One of the key enhancements was an improved Plan Mode, which now builds more precise plans and executes them more thoroughly. This mode asks clarifying questions upfront and then generates a user-editable plan.md file before execution. However, this updated Plan Mode is distinct from the more advanced agentic framework proposed in their research paper, which hints at the future direction for AI-powered development.
The Core Challenge: The Limits of Context Windows
[01:07.122]
The primary obstacle for long-running agents is the limitation of context windows, which function as the AI’s short-term memory. As tasks become more complex, agents struggle to maintain progress across multiple sessions because each new session begins with no memory of what came before.
“Getting agents to make consistent progress across multiple context windows remains an open problem. The core challenge of long-running agents is that they must work in discrete sessions, and each new session begins with no memory of what came before.”
This is like a software engineer starting their workday with no recollection of what they did the previous day. To bridge this gap between coding sessions, a new system is needed.
A Two-Agent Solution: The Initializer and the Coder
[01:28.402]
Anthropic proposes a two-fold solution to enable the Claude Agent SDK to work effectively across many context windows. This architecture involves two distinct types of agents: an initializer agent and a coding agent. The initializer agent sets up the entire coding environment on the first run, creating a plan and a foundation for the project. Following this, a fresh coding agent is deployed in each subsequent session to make incremental progress on specific tasks, ensuring the project moves forward step-by-step.
Overcoming Common AI Failures
[01:57.172]
While the Claude Agent SDK already has some context management capabilities like compaction (summarizing a conversation to save space), it’s not enough for complex projects. Anthropic identified two common failure patterns:
- One-Shotting the App: The agent tries to build the entire application at once, runs out of context mid-task, and leaves the project in a half-implemented, undocumented state.
- Premature Completion: In a later session, the agent sees the existing code, misunderstands the progress, and incorrectly declares the job finished.
[02:42.142]
To solve these issues, Anthropic’s approach focuses on breaking the problem down. First, the initializer agent sets up an environment that lays the foundation for all required features. Second, each coding agent is prompted to make small, incremental progress towards the goal, leaving the environment in a “clean state” at the end of each session. A “clean state” means the code is well-documented, free of major bugs, and ready to be merged into a main branch—just like in professional software development.
The Agentic Harness in Action
[03:08.312]
The practical implementation of this “agentic harness” involves several key components:
- Initializer Agent: This agent uses a specialized prompt to set up the initial project environment. It creates an
init.shscript to run the development server, aclaude-progress.txtfile to log what agents have done, and makes an initial Git commit to track all added files. - Coding Agent: Every subsequent session uses a coding agent to make incremental progress on one feature at a time, leaving behind structured updates.
The key insight here was finding a way for agents to quickly understand the state of work when starting with a fresh context window, which is accomplished with the claude-progress.txt file alongside the git history.
This process gives the AI a long-term memory, allowing it to understand its progress and history by reviewing the progress file and the Git logs.
From Markdown to JSON: Structuring the Plan
[04:20.982]
A crucial innovation in this framework is the use of a JSON file to manage the feature list instead of a markdown file. The initializer agent creates a comprehensive list of all features required by the project, and each feature is structured as a JSON object. Initially, every feature is marked as failing or "passes": false.
{
"category": "functional",
"description": "New chat button creates a fresh conversation",
"steps": [
"Navigate to main interface",
"Click the 'New Chat' button",
"Verify a new conversation is created",
"Check that chat area shows welcome state",
"Verify conversation appears in sidebar"
],
"passes": false
}
[04:34.022]
The decision to use JSON is deliberate. Anthropic’s experiments showed that AI models are less likely to inappropriately change or completely overwrite a structured JSON file compared to a more free-form Markdown file. This ensures the integrity of the project plan. The coding agent is prompted to edit this file only by changing the status of the passes field to true after it has successfully implemented and tested a feature.
Testing and Incremental Progress
[05:22.062]
This framework enforces a disciplined, incremental workflow. The agent is instructed to work on only one feature at a time. After making a code change, it must leave the environment in a clean state. The best way to enforce this is to have the model commit its progress to Git with descriptive commit messages and write summaries in the progress file. This allows the model (or a human supervisor) to use Git to revert bad code changes and restore a working state.
[05:49.522]
A major failure mode for AI agents is inadequate testing. An agent might run unit tests or curl commands and think a feature is complete, but fail to recognize that it doesn’t work end-to-end. The solution is to explicitly prompt the agent to use browser automation tools (like Playwright or Puppeteer) and perform testing in the same way a human user would, verifying features from start to finish.
Getting Up to Speed: The Agent’s Workflow
[06:32.062]
With this harness in place, every new coding session starts with a clear set of steps for the agent to “get up to speed”:
- Run
pwdto see the current working directory and understand its boundaries. - Read the
git logsandprogress filesto catch up on what was recently worked on. - Read the features list file to identify the highest-priority feature that is not yet complete and begin work.
This structured onboarding saves tokens and prevents the agent from guessing what happened previously, allowing it to get straight to productive work.
[08:07.122]
Anthropic provides a helpful summary table that breaks down each common problem and how the new two-agent architecture addresses it. For instance, to prevent premature victory declarations, the initializer sets up a detailed feature list, and the coding agent reads that list to select a single, specific feature to work on. This systematic approach ensures that AI agents can tackle large-scale software projects with the same discipline and reliability as human engineering teams, paving the way for more powerful and autonomous AI collaborators.