blog
/
Strategy
Strategy
November 5, 2026

Claude Code Harness: What It Is and How to Customize It

Suppose a checkout fix passes the available tests, but the duplicate-submission path still creates two orders. The agent changed the code without checking the behavior that mattered. In a case like this, a better prompt isn't the only fix: you also need to look at the tools, context, and feedback available to Claude Code.

That distinction becomes useful when a coding session keeps going wrong in the same way. Missing a project convention calls for different treatment than forgetting a test or overlooking a service dependency. You don't need to build a new agent platform to address each problem.

We'll explain what the Claude Code harness already provides, which extensions change its behavior, and where architecture context needs to come from outside the repository.

What is the Claude Code harness?

The Claude Code harness is the software surrounding the Claude model: it supplies tools, manages the context the model sees, runs the agentic loop, and controls tool execution through permissions. Claude Code is itself an agent harness. Your project instructions, skills, hooks, and connected services customize that existing system.

The model supplies the reasoning; Claude Code's tools turn its decisions into actions. In the checkout example, the model chooses to inspect a failing test. The harness makes the file-reading tool available, runs the requested operation, and brings the result back into the conversation.

You'll also see “my harness” used for someone's personal collection of prompts, scripts, and extensions. And claude-code-harness is the name of a specific community project. Neither means you must install an extra product before Claude Code can work as an agent.

What's inside the Claude Code harness

The useful question for each component is what it contributes to a real task. Our checkout example needs access to code, enough context to understand it, permission to change it, and evidence that the fix worked.

The agentic loop

Claude Code cycles through gathering context, taking action, and verifying results. These phases overlap: a failed test can trigger another file search, a different edit, and another test run. The sequence adapts to the task rather than following a fixed script.

For the checkout fix, name the behavior you expect after the change. Ask Claude to reproduce the duplicate submission, fix it, and add a regression test showing that the same request creates one order.

Built-in tools

Claude Code provides file operations, code search, shell execution, web search and fetch, plus code-intelligence capabilities that require language plugins. Those tools let the agent move between reading a handler, finding its callers, running a test command, and checking current documentation.

Tool availability matters as much as the prompt. If a task depends on a database or browser that isn't connected, ask the agent to identify that gap before reporting success. For the broader arrangement of reasoning, memory, tools, and operational controls, see our agentic AI reference architecture.

Context management

The context window holds the conversation, loaded file contents and tool results, instructions, and other active context. Claude Code compacts long conversations into a summary, and /context shows what's using space. Compaction can lose earlier detail, so put durable project guidance in a maintained instruction file.

CLAUDE.md and auto memory serve different purposes: you write project instructions; Claude records useful learnings in auto memory. Both inform the model. They don't enforce a rule independently of it.

Keep the enduring fact close at hand, such as the approved command for the checkout tests. Put a lengthy release procedure in a skill that loads when needed. Delegate a noisy investigation to a subagent when you want its findings without keeping all its intermediate output in the main conversation.  

Checkpoints and permissions

Checkpoints help rewind tracked file edits. They do not undo a deployment, reverse a database write, or cover every change made through a shell command. Keep version control and your normal release controls in place.

Permission modes determine when Claude asks before acting. Manual mode asks before most modifying actions; Accept edits permits file edits and common filesystem operations; Plan supports investigation before implementation. Auto mode uses a classifier to review actions in the background.

Don't assume an older default still applies. Anthropic documents auto as the built-in starting mode for interactive terminal and VS Code sessions in Claude Code v2.1.283 or later, subject to availability and configuration. Check the mode in your actual session and review the commands you have pre-approved.

The harness runs the agentic loop, tools, context, permissions and checkpoints around the model. Extensions add instructions, procedures, outside tools, event handlers and separate workers.

The harness runs the agentic loop, tools, context, permissions, and checkpoints around the model. Extensions add instructions, procedures, outside tools, event handlers, and separate workers.

How to customize the Claude Code harness

Start with a repeated failure, then choose the smallest extension that addresses it. A growing instructions file is a poor substitute for deciding whether you need persistent context, a reusable procedure, an external tool, or an automatic check.

Extension

What it changes

When to use it and a short example

CLAUDE.md

Persistent instructions for the project

Record a stable convention: Run npm test before reporting a change complete.

Skills

Reusable instructions loaded for a relevant task

Put a release checklist in .claude/skills/release-check/SKILL.md, invoked as /release-check.

MCP servers

Tools and information outside the local environment

Add Catio's architecture context; setup uses claude mcp add --transport http catio https://mcp.catio.tech/mcp.

Hooks

Automatic handlers at lifecycle events

Run a project's lint command after matching PostToolUse events.

Subagents

A focused worker with its own context and tool configuration

Define .claude/agents/reviewer.md for a review task.

Permission rules

Which tool calls are allowed, denied, or need approval

An allow entry such as Bash(git status) permits that specific command.

Keep project instructions short and actionable

For the checkout project, your CLAUDE.md could include:

## Checkout changes
- Use the existing orders API; don't add direct database access.
- Preserve idempotency for repeated submissions.
- Run npm test and report any checks you couldn't run.
- Explain changes to public request or response fields before implementing them.

Use your repository's actual test command and service boundaries.

If your team already maintains AGENTS.md, check Claude Code's current loading rules. Whether Claude Code loads it natively depends on existing CLAUDE.md files, configuration, and availability. An explicit @AGENTS.md import from CLAUDE.md is also supported. Avoid maintaining conflicting instructions in two places.

Use hooks for a check that should happen at an event

A reminder to lint and a hook that launches lint have different execution paths. Use PostToolUse with an Edit|Write matcher to run a command after matching file tools complete.

If your project has an npm run lint script, add a hook like this to .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "npm run lint"
          }
        ]
      }
    ]
  }
}

Merge the hook into your existing settings, then make a small edit to confirm that the lint command runs from the right directory.

The hook reacts to matching Edit and Write calls. Keep CI for the broader checks that must pass before a merge. If running the full linter after every edit is too expensive, adapt the check to the files and feedback your team needs.

Give each extension a reason to stay

Keep stable project facts in instructions, long procedures in skills, and external information behind the relevant tools. Add a subagent when a separate context or review role helps. A repository-wide search that returns a concise dependency summary is a useful delegation; a second agent that merely repeats the first agent's conclusion adds little.

When a convention still gets missed, inspect whether the right instructions loaded and whether they conflict. When a check doesn't run, inspect the event and matcher. These are different failures, and adding more prose won't diagnose either one.

Harness design patterns for long-running coding work

Long-running work introduces a harder question: how does the agent know that an apparently complete application actually works?

Anthropic's research on long-running application development used separate planner, generator, and evaluator roles. The planner expanded a short request into a product spec. The generator built the application. The evaluator used Playwright MCP to interact with the running application and return concrete feedback.

That division gives each role a different job:

  • Planner: define the intended behavior and scope without prematurely prescribing every implementation detail.
  • Generator: implement the agreed work and run its own checks.
  • Evaluator: test the result against the criteria, including interactions the implementation may have stubbed or missed.

The earlier version of the research harness used a sprint contract: the generator and evaluator agreed on what counted as done before implementation. That is a practical connection to spec-driven development. Acceptance criteria need to survive the handoff from planning to code to review.

For our checkout example, a compact contract could say: repeated submission creates one order, a declined payment leaves the order unpaid, and a successful payment produces a visible confirmation. The evaluator should check those behaviors rather than ask whether the implementation “looks complete.” This contract is illustrative; a real payment system needs its own approved requirements and test environment.

Separate roles carry the same acceptance criteria from planning to review. The checkout criteria are illustrative.

Separate roles carry the same acceptance criteria from planning to review. The checkout criteria are illustrative.

Budget for verification, then test whether it earns its cost

The research also makes the cost visible. For an Opus 4.5 retro game-maker experiment, Anthropic reported a solo run taking 20 minutes and costing $9, versus six hours and $200 for the full harness. The fuller workflow produced a more functional result in that example.  

Start your own evaluation with a task whose failures you can recognize. Record which bugs the evaluator caught, what it missed, how much rework followed, and the total time and cost. If the extra review doesn't change the outcome, simplify it. If it repeatedly catches a missing interaction, keep that criterion explicit.

Revisit context handoffs when the model changes

A context reset starts a fresh agent with a handoff artifact. Compaction summarizes the existing history so work can continue. Anthropic used resets to address problems it observed with Sonnet 4.5, then removed them when Opus 4.5 no longer needed that intervention. Later experiments with Opus 4.6 also removed the sprint structure.

Test scaffolding against the model and task you actually run. Revisit these assumptions as models improve, and keep the smallest structure that produces reliable evidence of completion. Retain a clear handoff whenever you start a new session.

Community harnesses and building your own

If you arrived looking for the claude-code-harness plugin, the Chachamaru127 project is a separate, MIT-licensed workflow layer. It adds planning, work, and review commands, with installation routes for Claude Code, Codex CLI, and Cursor. It does not replace Claude Code's underlying harness.

To add it in Claude Code:

/plugin marketplace add Chachamaru127/claude-code-harness
/plugin install harness@claude-code-harness-marketplace
/harness-setup

For a custom application, the Claude Agent SDK exposes the loop, tools, and context management behind Claude Code programmatically. The AI SDK Claude Code harness adapter connects its HarnessAgent abstraction through that SDK; the harness packages are explicitly experimental. Those are integration choices for building software around an agent, rather than prerequisites for customizing your team's CLI workflow.  

You can also point Claude Code at DeepSeek's Anthropic-compatible API. DeepSeek's setup guide walks through the endpoint and model settings.

What the harness can't see: your system's architecture

Return to the checkout fix. Imagine the repository contains a database client and tests that would permit writing an order directly. Elsewhere, the organization has decided that all order creation must pass through a shared service because that service owns downstream events and auditing.

Claude Code can reason about that decision if it receives it. Reading the local repository alone may not reveal the decision, the current consumers, or the reason the boundary exists. A successful local test doesn't supply the missing evidence. That's the architecture problem we see in coding-agent workflows.

With our Catio MCP tools, the assistant can look up workspace requirements, find component dependencies, and retrieve architecture notes with citations. It can also use Archie to reason through a change and read the Blueprint it should implement.

In our architecture-aware code walkthrough, a Blueprint for extracting Notifications from an Orders monolith used notify:dedup:{order_id}. The repository used notif:sent:{order_id} instead. Reading the implementation caught the mismatch before the assistant generated the change.

For your own change, ask the assistant to identify the relevant dependencies and decisions, then compare them with the repository. A Blueprint gives it a design to work from; the code still needs to establish the existing names, interfaces, and behavior.

Add Catio to Claude Code:

claude mcp add --transport http catio https://mcp.catio.tech/mcp

Then follow the setup guide to sign in, choose your workspace, and check the connection.

Your Catio workspace needs the relevant architecture and context first. The MCP reads inventory populated through integrations and context managed in Catio's Context module. Connecting it won't fill gaps in that information. Use what it returns to improve the plan, then test and review the code as usual.

Conclusion

Build your Claude Code harness around evidence that a change is ready: a reproduced failure, the checks that prove the fix, and the dependencies it must preserve. Add instructions, hooks, or a separate evaluator when they make that evidence easier to produce, and check architecture decisions against the actual code. Aim for a change your team can explain and verify, with unresolved questions visible before implementation.

Connect Catio to Claude Code and use your next cross-service change to check the relevant dependencies and decisions before asking for code. If that context is still scattered across your organization, book a Catio demo to see how we bring it into your coding workflow.

Claude Code harness FAQ

Is Claude Code CLI a harness?

Yes. Claude Code supplies the tools, context management, agentic loop, and execution controls around the model. Instructions and extensions customize that harness; you don't need a community plugin to make it one.

What is the best harness for Claude Code?

Start with its built-in capabilities. Add an extension for a failure you can name and a result you can measure. A small CLAUDE.md and an effective test loop can be a better fit for a focused change than a multi-agent workflow with several handoffs.

Is the Claude Code harness open source?

Anthropic's Claude Code and the community claude-code-harness project have different licences. The official Claude Code repository reserves rights and refers to Anthropic's Commercial Terms in its licence notice. The community project is MIT licensed. A public repository or shared name doesn't make their licensing equivalent.  

What is harness engineering?

It's the work of shaping the tools, instructions, context handling, execution controls, and feedback around a model. In practice, that might mean adding a missing check, improving a handoff, or removing an orchestration step that no longer helps.  

Share this Post

Related posts