Claude Code 2.1.335: audit the machinery around your agent
The interesting addition in Claude Code’s December 3, 2026 release is not another way to generate a function. It is /claude-api harness-audit: a workflow that looks for agent orchestration code written around older models and proposes changes as a diff. The official notes explicitly name loop limits, subagents, context management, injected reminders, and session-start code. For teams maintaining their own AI-assisted engineering tools, that is a useful maintenance surface to inspect.
An agent harness is the software surrounding the model: it assembles messages, exposes tools, schedules work, handles failures, and decides when a task ends. As models change, yesterday’s workaround can become today’s latency or reliability tax. The productive response is not to delete the harness. It is to distinguish obsolete scaffolding from the controls that express your organization’s security and release policy.
What is shipping, and what is not promised
Anthropic’s skills documentation lists harness-audit as a bundled /claude-api subcommand requiring Claude Code v2.1.335 or later. It describes flagging older-model harness patterns and proposing fixes as a diff. That is the verified feature boundary. The release does not establish a universal speedup, certify your architecture, or authorize changing production behavior. Treat the output as a review candidate, not an accepted migration.
The practical examples below are recommended engineering workflows, not results from a benchmark or a hands-on execution of this new subcommand. We verified the official release notes and documentation, not the command’s runtime behavior in a customer repository. That distinction matters: an audit can plausibly find useful simplifications, but your tests and operational evidence determine whether each simplification is actually better for your system.
Install, authenticate, and verify the version
Start with the official setup page linked in the sources. On macOS, Linux, and WSL, the documented native installer is curl -fsSL https://claude.ai/install.sh | bash. Review downloaded installers under your organization’s software policy before running them. Windows users can use the documented PowerShell installer or winget install Anthropic.ClaudeCode. Do not copy a package name from an old tutorial without checking the current instructions.
After installation, run claude --version and claude doctor. For this workflow, verify that the installed version is at least 2.1.335. Native installations support claude update; package-manager installations follow their own update path. The stable channel may lag the newest release, so a successful update does not by itself prove the feature is present. Use an approved account or provider configuration and respect your organization’s repository and data-sharing rules.
Invoke the audit in a disposable working context
Open a clean branch or a separate Git worktree containing the harness you actually maintain, then start claude. At the interactive prompt, type /claude-api harness-audit. This is a Claude Code skill invocation, not a standalone shell executable. The official skills page is the reference for availability and syntax. If it is unavailable, check the installed version and your deployment’s restrictions before assuming a repository problem.
Give the session a precise scope: inspect the orchestration package, identify assumptions tied to older models, explain each finding, and propose reviewable changes. Explicitly prohibit deployments, credential changes, and writes to external services. Separate scope instructions from enforcement: use real permissions and isolation as well. Preserve a baseline commit and keep the original implementation available so you can compare behavior rather than rely on the persuasiveness of a rewritten design.
Draw a map before accepting a patch
Ask for an inventory of the execution path: request assembly, model call, tool dispatch, retries, termination, context reduction, and persistence. Require file references and the reason each component exists. A surprising amount of harness complexity comes from mixing several concerns into one function. A loop limit might be partly a cost cap, partly an infinite-loop guard, and partly a workaround for a model that previously struggled to stop.
Classify findings into three buckets: likely obsolete model accommodation, active reliability requirement, and explicit business or security policy. A component can belong to more than one bucket. When intent is unclear, record the uncertainty and consult its owner. This mapping makes review faster because it changes the question from “does this code look excessive?” to “which invariant would disappear if we removed it?”
Use case one: inspect loop limits without losing budgets
Consider a repository assistant that stops after a fixed number of tool calls. The cap may interrupt legitimate investigations, yet removing it can create runaway work. Ask the audit to explain how the limit interacts with tool failures, repeated identical actions, cancellation, and successful completion. Request a narrow patch that separates completion detection from hard resource bounds rather than simply increasing a magic number.
Build test cases for a short task, a long but valid task, a permanently failing tool, and an agent repeating the same call. Keep server-side cost and wall-clock controls even when the conversational loop changes. An improvement is a higher rate of correctly completed tasks within the approved budget, not a larger number of uninterrupted turns. If the proposed simplification makes cancellation unreliable, reject it even if the successful demonstration appears faster.
Use case two: challenge mandatory subagent fan-out
Some harnesses automatically delegate every request to multiple specialists. That pattern can help with independent tasks, but it can also duplicate repository reads, serialize handoffs, and spread inconsistent assumptions. Ask which delegations produce independent evidence and which merely restate the main agent’s work. A simple change request may not need the same orchestration as a cross-service migration.
Evaluate an alternative routing policy on representative tasks: direct execution for bounded work, delegation when tasks are separable, and explicit human escalation for unresolved trade-offs. Keep independent review where it is a genuine control; do not confuse removing redundant planning with removing validation. Compare total tokens, elapsed time, missed requirements, and reviewer effort. These are evaluation dimensions to collect, not promised benefits of the command. The best topology depends on your workload and the consequences of a mistake.
Use case three: reduce reminders without deleting requirements
Long-running agent systems often append the same reminders at every step: read the instructions, write tests, do not stop early, and summarize progress. Repetition can consume context and conceal the few instructions that actually matter. The release also updates /claude-api prompt-audit, which inspects prompts and tool descriptions; use that complementary workflow when the problem is instruction text rather than orchestration code.
Audit the mechanism that injects reminders separately from their substance. A good proposal can consolidate duplicate guidance while preserving explicit acceptance criteria, escalation triggers, and stop conditions. Never remove an authorization requirement merely because the model appears to follow it without prompting. Test ambiguous requests and adversarial repository content as well as happy paths. The aim is a smaller, clearer contract, not an agent that is free to reinterpret inconvenient constraints.
Use case four: examine context compression as a state migration
A custom summarizer can quietly lose failed hypotheses, user decisions, or a test that still needs to run. Ask the audit to identify when context is compacted, what state is retained, and which component owns the source of truth. If a patch removes a home-grown context layer, demand an explanation of how unresolved work and provenance survive afterward.
Use a long debugging scenario with deliberate checkpoints: a rejected approach, a pending validation, a modified file, and a decision reserved for a person. After context reduction, verify that the agent still distinguishes observation from assumption and unfinished work from completion. Keep authoritative task state outside a lossy prose summary when correctness depends on it. A more concise transcript is valuable only if it preserves the information needed to finish the engineering task safely.
Use case five: shorten session startup carefully
Startup hooks and bootstrap messages accumulate over time. One reads the whole repository, another refreshes documentation, and another loads policies already supplied elsewhere. Ask for a dependency map showing which startup actions are necessary for the current task and which can be deferred. Repository navigation usually benefits more from targeted discovery than from front-loading every document into context.
Inspect external calls particularly carefully. Moving a credential check or policy lookup later in the session can change when access is validated, not just how quickly the first response appears. Preserve mandatory initialization and fail-closed behavior. Evaluate time to the first useful action alongside correctness and data exposure. A faster greeting is not a productivity improvement if the agent later acts under stale permissions or repeatedly reloads information it should have retained.
Build an evaluation pack before changing the harness
Select a small but representative set of engineering tasks: locate a regression, add a tested behavior, update an API integration, explain a dependency, and handle an intentionally impossible request. Include tasks where the correct answer is to stop and ask for approval. Keep fixtures and expected outcomes versioned so comparisons survive changes to prompts, models, and the harness itself.
Run the baseline and each candidate under comparable conditions, recording the model, tool versions, repository revision, and resource limits. Repeat cases when model variability could affect the conclusion. Inspect failures manually rather than hiding them in an average score. The audit suggests what to try; the evaluation pack tells you whether a change improved your actual workflow. Use non-production credentials and controlled services so the evaluation cannot accidentally become a deployment exercise.
Measure useful completion, not just token reduction
Track accepted task completion, regression rate, tool errors, elapsed time, token consumption, and the time a developer spends correcting or reviewing the result. Distinguish machine waiting time from human attention. A patch that lowers model spend but produces a sprawling, hard-to-review diff may cost the team more overall. Likewise, fewer subagent calls can be a regression when they remove genuinely independent checking.
Do not publish a productivity percentage from one successful example. Report the task sample, observed failures, and the conditions under which the comparison was made. Potential gains include less duplicated context, fewer unnecessary handoffs, shorter startup, and easier maintenance. They remain hypotheses until measured. Keep quality and security thresholds as acceptance gates, not weighted variables that a small speed gain can offset.
Maintain a boundary between optimization and authorization
The model may correctly identify an old workaround and still propose an unsafe replacement. Retry logic, tool allowlists, and approval gates are especially sensitive because they influence what an agent can do, not merely how it reasons. Require a separate security review for changes that widen tool access, alter secret handling, or modify network destinations. Default to keeping the existing restriction until an accountable person approves otherwise.
The built-in Bash sandbox is useful defense in depth, but the official documentation says it covers shell commands, not every file tool, hook, or MCP server. Do not describe it as whole-agent containment. For stronger boundaries, evaluate isolating the Claude Code process itself in a controlled environment. Minimize credentials, restrict external services, and keep production write authority outside the audit session. A prompt saying “read only” is not a permission system.
Checkpoints help experimentation; Git owns durable recovery
Claude Code’s /rewind can restore tracked edits and conversation state, which makes local experiments less stressful. The current documentation also lists important gaps: shell-only file changes are not generally tracked, many subagent edits are not fully captured, and external changes can be lost when restoring a tracked file. Checkpoint retention and linked-file behavior create additional limits.
Keep a clean baseline commit, inspect git diff, and preserve concurrent work before any restore. A checkpoint does not roll back a database migration, a pushed branch, or a message sent through an external service. Design the audit so those side effects are unavailable in the first place. Use local recovery for quick iteration and version control for durable history, peer review, and reproducible comparisons. Never promise that a conversational undo is a transactional rollback of the whole engineering environment.
Turn recommendations into small, attributable pull requests
Ask for a finding record containing the location, current behavior, suspected historical assumption, proposed change, retained invariants, and verification plan. Separate cosmetic cleanup from behavioral changes. Reviewers should be able to accept a reminder simplification without also accepting a new retry policy or a different delegation strategy. Smaller changes make both regression analysis and rollback easier.
For each accepted patch, record who approved it and which evaluation cases passed. Include a short explanation of intentionally retained controls so the next audit does not rediscover them as unexplained complexity. When evidence is incomplete, merge nothing: a well-supported finding is already useful maintenance output. This workflow makes the tool an assistant to senior engineering judgment rather than an automatic architecture committee whose proposals acquire authority simply because they arrive as code.
Roll out as a controlled engineering change
Start with a low-risk internal workflow and a reversible harness change. Use a staged rollout appropriate to the system: a developer-only branch, a limited pilot, or a controlled service release. Monitor unexpected tool calls, task abandonment, resource use, and support burden. Keep the prior configuration and an explicit owner for rollback. Do not couple the rollout to an unrelated model upgrade if you need to attribute the result.
After the pilot, retain only the changes supported by evidence and update the operational runbook. Schedule future audits around meaningful model or workflow changes rather than running them as a ritual that always needs to produce a patch. Sometimes the right result is confirmation that a seemingly old constraint still serves a live requirement. That is an engineering decision worth preserving, not a failure to automate.
A practical adoption checklist
For the first session, define one harness package, one owner, one baseline revision, and a concrete task sample. Verify Claude Code v2.1.335 or later, confirm account and repository access, and invoke /claude-api harness-audit from an isolated working copy. Ask for findings and a reviewable diff; do not authorize deployment. Compare candidates against the baseline and reject any proposal that weakens required controls.
The opportunity is straightforward: let an AI assistant help remove the unnecessary machinery accumulated around AI assistants. The discipline is equally important: a model upgrade does not invalidate your security policy, and a persuasive diff does not establish a productivity gain. Keep humans in charge of the acceptance criteria, the experiment, and the release. That is how harness maintenance can become a practical productivity workflow instead of another layer of automation to supervise.