← AUTOMATER NEWSROOM

Claude Code adds a harness audit for teams switching models

Claude Code 2.1.335 can flag agent code written around older models and propose a diff. Here’s how to test those changes without losing track of what the harness protects.

The same new model and task feed two runs. The baseline includes required compatibility changes, and the edited run adds one proposed audit change. The traces are compared for task completion, stop reason, and tool calls.The same new model and task feed two runs. The baseline includes required compatibility changes, and the edited run adds one proposed audit change. The traces are compared for task completion, stop reason, and tool calls.
Run the same task on the new model with and without one proposed harness edit, then compare task completion, stop reasons, and tool calls.

Anthropic released Claude Code 2.1.335 on December 3 with a new command for developers who maintain their own agents. /claude-api harness-audit looks for orchestration code written around older models and proposes fixes as a diff. The release notes name five areas it checks, including loop limits, subagents, context management, injected reminders, and session startup. That gives teams moving to a newer model a concrete set of code changes to review alongside the model upgrade. Anthropic’s Claude Code 2.1.335 release notes

Anthropic’s Claude Code v2.1.335 release page on GitHub.
Anthropic’s release notes for Claude Code v2.1.335, hosted on GitHub. · Original source

A model upgrade can leave old assumptions in the code

The harness is the code around the model that decides what context it receives, when it calls tools or delegates, and when a run ends. Anthropic’s Claude Code overview points developers building custom agents to the Agent SDK for control over orchestration, tool access, and permissions. If your team owns that orchestration, it also owns the decisions that accumulated around the previous model. A hard loop cap might have contained repeated attempts, for example, or a session reset might have helped an agent finish a long job by giving it a fresh context window. Claude Code documentation overview

Anthropic’s own experiments show how specific those decisions can be. In its research on long-running coding agents, the team reported that in-place context compaction alone had been insufficient in earlier testing with Sonnet 4.5. The harness started fresh sessions and passed state through structured handoffs. With Opus 4.5 in a later harness, the researcher dropped those resets and used the Agent SDK’s automatic compaction for a continuous session. That experience gives maintainers a reason to retest their own reset logic when they change models. The result came from Anthropic’s particular setup and workload. Anthropic’s research on harness design for long-running apps

Test the model change and the proposed edit separately

Start by checking whether the target model can run with the existing harness behavior. For a Messages API migration to Sonnet 5.5, Anthropic’s guide says forced tool choice returns a 400 error. It also says adaptive thinking runs by default when the request omits the thinking field. The same request ran without thinking on Sonnet 4.6 and earlier models covered by the guide. A request that fails at the API boundary gives you no evidence about a loop limit or a session handoff. Make the required compatibility changes first and record them with your results. Claude Sonnet 5.5 migration guide

Pick a repeatable task that exercises the exact behavior an audit hunk would change. You could use a repository fixture that requires several distinct edits and a final test run, or a documentation task that must recover a filename from before a context reset. Define success in terms you can check, such as all expected files changing, tests passing, or the resumed session correctly identifying which work is already complete. Automater’s guide to writing a finish line the transcript can prove

Run the task with the old model and harness, then with the new model and any required compatibility changes. Apply one optional audit hunk on a branch and repeat the new-model run with the same inputs, tools, and acceptance checks. Keep the stop reason, tool-call count, elapsed time, and final result for each run. If the outcome varies across attempts, repeat the comparison before attributing the change to the hunk.

If the proposed diff changes… Compare this on the new model before and after the edit
A loop limit Whether a long task finishes and whether a repeatedly failing tool still triggers a bounded stop
Subagent delegation Whether the final result still covers each delegated task and whether delegation adds calls or time
Context or session startup Whether a resumed run recovers pending work and avoids repeating completed steps
An injected reminder Whether the behavior the reminder was written to elicit still appears in the trace

For example, if a diff raises a loop cap and the long fixture now passes, also run a fixture where a tool keeps returning the same failure. Check that the harness still exits within the intended retry budget. The passing run shows what the agent completed with the higher cap. The failure trace tells you whether the new cap still bounds a stalled run. Record both outcomes next to the proposed edit so the next model migration starts with evidence about why the limit exists.

Sources

  1. Release v2.1.335 · anthropics/claude-code · GitHub
  2. Overview - Claude Code Docs
  3. Claude Sonnet 5.5 migration guide - Claude Platform Docs
  4. Harness design for long-running apps \ Anthropic