AIToday

Claude Code's Real Edge: The Harness, Not the Model

Daily Dose of Data Science18h ago
Claude Code's Real Edge: The Harness, Not the Model

Key takeaway

Claude Code's superiority over a basic agent comes not from its model but from the engineering harness around it—layers handling planning, memory, sandboxing, subagent delegation, and human approval. A developer who rebuilt this architecture in CrewAI confirmed that most of the machinery maps onto framework features, but the parts that don't reveal where real engineering effort is required. The harness transforms a bare agent loop that quickly loses track of goals and context into a system reliable enough for production coding tasks.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    A developer rebuilt Claude Code's agent architecture in CrewAI, an open-source framework, and found that the gap between a basic agent loop and Claude Code's capability comes from the surrounding machinery—planning, memory, sandboxing, subagent delegation, and approval systems—not the underlying language model itself.

  • Why it matters

    Most teams underestimate how much engineering sits outside the model. A bare agent loop fails on real codebases (reads wrong files, loses context, fills memory with stale output), while Claude Code stays on track. Understanding this split—model as "brain" deciding actions, harness as "hands" executing them—shows what you actually need to build reliable coding agents in production.

  • What to watch

    The rebuild tested against a small BankAccount class with two real bugs and five tests. The harness took the project from 3 failing and 2 passing to all 5 passing, demonstrating that planning, subagents, and sandboxing together enable the agent to fix code correctly without shortcuts like editing tests.

In Depth

The article opens with the core misconception: the easy conclusion is that Anthropic simply has a better model. But the actual difference is the harness—ordinary code wrapped around the model that handles planning, tool execution, memory, and safety, while the model only decides the next step. A fully harnessed agent consists of memory (feeding the model its working context plus learned facts), skills (procedures, constraints, and heuristics), protocols (connections to users, tools, and other agents), and a harness core (sub-agent orchestration, sandbox, evaluator, approval loop, observability, and context compression). Anthropic frames this as brain and hands: the model picks actions; the harness carries them out and keeps the run on track.

The author rebuilt this in CrewAI, discovering that more maps onto built-in features than expected. The core loop is automatic: define an agent with a role, goal, LLM, and tools; define a task; create a Crew; call kickoff(). The loop repeats until the model returns a final answer without tool calls. Tools (FileReadTool, DirectoryReadTool, FileWriterTool, plus custom tools via @tool decorator) read and write files, run shell commands, and call APIs. These double as external memory, keeping the context window smaller by writing large search results to files instead of holding them in context.

Planning addresses context rot directly. On long-running tasks, the context fills up and the objective gets crowded out. CrewAI adds planning=True at the crew level, generating a step-by-step plan before execution and keeping it available throughout. Individual agents can also enable reasoning=True to reflect, draft, evaluate, and refine their own approach. Subagents solve the problem of a large codebase exceeding a single context window through delegation: the main agent hands specific tasks to specialist agents working in their own contexts and returns short summaries. The author split work across a manager (Engineering Lead) and three specialists (Codebase Explorer, Software Engineer, Test Runner).

Safety comes from a sandbox and approvals, not prompts. An agent with shell access can run destructive commands, and no prompt substitutes for real protection. Anthropic uses two layers: a permission system requiring approval for sensitive actions, and a sandbox isolating execution. Setting human_input=True on a Task pauses the crew after generating an answer for review. Code execution can run inside E2B, which spins up a fresh VM per session and destroys it afterward, isolating shell commands and Python entirely.

Memory persistence carries information across runs. By default, agents forget everything after a run ends. Checkpointing saves the agent's state during a run for resumption after interruption. Persistent memory stores facts across separate conversations (like project preferences). CrewAI provides a unified Memory interface: setting memory=True extracts useful facts after each task and stores them, retrieving relevant memories for future runs. Checkpoints can live in JsonProvider (separate JSON files, easy to inspect) or SqliteProvider (single SQLite database, better for frequent checkpointing).

The full harness was tested against a small BankAccount class with two real bugs and five tests, three of which failed. The rule was to fix only the implementation, not the tests. The harness took the project from 3 failing and 2 passing to all 5 passing. Some parts of the system aren't built by the framework: the prompts (role, goal, backstory require testing and iteration), the execution environment (sandbox setup), and tool selection (which tools each agent gets). There is also a cost: planning, subagents, and looping add API calls, so complex agent setups can become expensive.

Context & Analysis

The article traces a common misconception: that Claude Code's power lies in Anthropic's language model. The actual insight is architectural. A basic agent loop—send task, run tools, repeat—can be written in thirty lines, yet it crumbles on real codebases because it lacks the surrounding machinery. Context rot, the slow degradation where the original goal gets crowded out by intermediate results, is a structural problem that no amount of model capability alone solves. This is where the harness layers in: planning builds a high-level roadmap; subagents delegate work to specialist contexts so the main agent doesn't hold gigabytes of file reads in memory; memory persists facts across sessions so the agent doesn't start from zero each time; and sandboxing plus approval loops provide safety without relying on prompts. The article demonstrates this by rebuilding Claude Code's architecture in CrewAI, an open-source framework. Most layers map onto built-in features—the loop, tools, planning, delegation, and memory are framework responsibilities—but three critical pieces remain the engineer's job: prompt design (role, goal, backstory of each agent), sandbox setup, and tool assignment. The test case (fixing a BankAccount class with two real bugs) confirms the hypothesis: the complete harness outperforms a bare loop not because the model is smarter, but because the harness keeps it focused, manages its memory, distributes work, and enforces safety. Cost is a trade-off: planning, subagents, and looping add API calls, so complex agent setups can become expensive.

FAQ

What makes Claude Code stay on track when a simple agent loop fails?
A bare loop loses the original goal after enough tool calls and file reads fill the context window—a problem called context rot. Claude Code adds planning (a step-by-step roadmap kept in context), subagents (delegating specific tasks to specialist agents with separate contexts), and memory (facts carried across sessions) to keep the agent anchored on long-running tasks.
How does Claude Code handle safety with shell access?
Two layers: a permission system requiring approval for sensitive actions, and a sandbox isolating execution so even approved commands cannot touch the host machine. Anthropic uses the same approach, moving code execution into a sandbox (like E2B, which spins up a fresh VM per session) rather than relying on prompts to prevent destructive commands.
What did the test rebuild prove?
The harness took a BankAccount class project from 3 failing and 2 passing tests to all 5 passing, fixing only the implementation and not editing or removing the failing tests—mirroring how Anthropic evaluates coding agents internally.

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Discussion

No comments yet. Be the first to share your thoughts!

Log in to join the discussion

Related Articles

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime

1 minute a day. The AI essentials.

200+ sources · Email / LINE / Slack

Get it free →