How Claude Harness Decouples Brain and Hands to Keep Long Tasks Running

Anthropic engineers discovered that tightly coupling an AI agent's reasoning core and execution environment caused failures and latency, so they redesigned Claude Harness to separate the brain from the hands, introduce an append‑only event log, and achieve up to 60% lower startup latency while improving security and scalability.

Linyb Geek Road
Linyb Geek Road
Linyb Geek Road
How Claude Harness Decouples Brain and Hands to Keep Long Tasks Running

Anthropic found that their AI agents crashed during long‑running tasks because the reasoning core (the "brain") and the execution environment (the "hands") were packed into a single container. When the container failed, the entire session—including in‑progress work and logs—was lost.

Problems of tight coupling

Failure contagion: a container crash caused all sessions to abort.

Context‑anxiety: agents would pre‑emptively finish tasks to avoid exceeding the context window, leading to unnecessary resets.

Security risk: code generated by the model and user credentials lived in the same container, exposing secrets if the model misbehaved.

Scalability bottleneck: each session required a full container, inflating the "time‑to‑first‑token" latency.

To solve these issues, the team built a new Harness architecture that decouples brain and hands and introduces a persistent, append‑only event log.

Event‑log separation

The session now records every thought, tool call, and result in an ordered log that lives independently of the brain or hands. Harness reads the log via a getEvents() API, allowing it to resume from any point even after a crash.

Stateless brain and on‑demand hands

The brain interacts with tools through a simple interface: execute(name, input) → string. Hands (Docker containers, VMs, or external services) are only instantiated when the brain actually needs to act, eliminating unnecessary container startup for pure Q&A sessions.

Performance impact

After decoupling, the 50th‑percentile time‑to‑first‑token dropped by roughly 60% and the 95th‑percentile fell by over 90%, because the brain can start reasoning immediately and only triggers hand initialization on demand.

Security redesign

Credentials are no longer stored alongside generated code. They are either injected at hand initialization or fetched from a secure vault via a proxy, so the brain never sees raw tokens.

Tool abstraction

All execution environments are abstracted as tools implementing the execute(name, input) → string contract. Git operations, custom services, and any future tool can be added without changing Harness logic.

Future‑proofing assumptions

The team recognized that hard‑coded assumptions about model capabilities become obsolete as models improve. By fixing only the three stable interfaces—append‑only log, tool execution, and stateless harness—they can evolve implementations without breaking existing sessions, similar to how OS abstractions (processes, files) have endured for decades.

In summary, separating the AI’s brain from its hands, persisting an immutable event log, and abstracting tools into a uniform execution interface eliminated failure contagion, cut latency dramatically, hardened security, and enabled horizontal scaling for long‑running AI tasks.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceAI agentscontainersecurityDecouplingClaude
Linyb Geek Road
Written by

Linyb Geek Road

Tech notes

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.