Wink Pings

Claude Code works well, and it has little to do with the model

Anthropic engineers broke down why Claude Code can get work done into six layers of harness. On the other side, Hanako added a more critical cut: loops live inside nodes; graphs live between nodes. Put the two materials together, and you can see clearly which layer the real gap in agent products is at.

Claude Code works well, and it has little to do with the model

Anthropic engineers explained how Claude Code works. delost described this material on X as "fucking gold," because it answers a question that has been asked countless times: why Claude Code is smoother to use than comparable tools.

The answer is harness; it has little to do with the model.

Harness literally means horse tack, referring to the whole set of apparatus wrapped around the model that constrains how it works. delost breaks it into six layers:

Layer one, tools. Keep the number small; one tool does only one thing. More importantly, every error message should tell the agent what to try next. A commenter added in the replies: a good error message can save the agent from three rounds of guessing.

Layer two, context. A short CLAUDE.md stays resident; other files are read on demand; once it gets full, compress.

Layer three, permissions. Reading files and running tests are automatically allowed; deployment and deletion require human approval; everything else goes into a sandbox.

Layer four, hooks. Before tool execution, block secrets and protected files; after every edit, run formatting, lint, and type checks, with no exceptions.

Layer five, verification. Spin up a separate clean reviewer that reads the diff rather than the summary, runs tests, fixes failures, and runs them again after fixing.

Layer six, evals. Every change to the harness gets scored by success rate, token consumption, and number of turns; whichever change performs better is kept.

Claude Code harness six-layer structure

delost's summary is: the model is the engine; the harness is the whole car.

That sentence is worth pausing on. When people usually discuss AI coding, the focus is almost entirely on the engine: one model scores 92, another 89. But what determines whether you can leave work on time at night is often the rest of the car.

Going through these six layers, you'll find that the first four solve whether the agent is usable, while the fifth and sixth solve whether it is trustworthy. The latter two are also the most labor-intensive and the least often completed.

Beyond the six layers, there is an even more common pitfall

Within the six layers, layer five is verification, but how much verification is enough is explained more thoroughly in another piece of material. Hanako wrote a long article about agents, and its core is one sentence: loops live inside nodes; graphs live between nodes.

Her division is crisp. A loop has only four parts: produce, check, correct, repeat until green. Checking is the core of the whole thing. If there is nothing that can determine failure while you are out of the room, what you have is a timer, not a loop.

And almost no one writes the check first. People do the work first, tack a review onto the end, and the review is yet another model looking at the output. In her words, this is two optimists nodding at each other.

Checks need to be written in a form a program can determine:

  • Green: the test exit code is 0
  • Green: every assertion carries a source line
  • Green: the diff touches only the files listed in the plan
  • Not a check: the output looks good
  • Not a check: the model says it is confident
  • Not a check: there are no errors

The last one is the most deceptive. The absence of errors does not mean the result is correct. Build a loop on that, and you'll get a system that repeatedly makes the same mistake until the budget burns out, with clean logs the whole time.

Loops also have a ceiling. A loop can only make a single unit of work better; it cannot decide which units exist, in what order, or which two steps actually don't need to wait for each other at all. Thus you get very refined agents running the wrong three steps in the wrong order, one step at a time. Every step is correct, but the result is slow and misshapen. Tuning the loop won't fix it, because the defect is not inside any single unit.

When the defect surfaces, people start blaming the model. And that is exactly when the layer above starts paying off.

A graph is two elements, not a flowchart

A graph describes the shape of the work: what runs, what runs at the same time, what waits, what doesn't run at all, and where results go back to. It has only two elements. A node is a bounded unit of work, one input and one output; an edge is a dependency, where the output of this node feeds the input of that node.

All unnecessary waiting comes from the same mistake: treating "and then" as an edge. First summarize the file, then check the weather; there is no edge between these two steps, because the weather does not consume the summary. The test is one sentence: does the next step actually read the output of the previous step? If you cannot name the variable that crosses this edge, the edge does not exist, and that waiting is pure waste. Most pipelines have two or three such arrows; finding them is usually the biggest speedup.

There are four kinds of nodes. A splitter partitions the work at the very front, and it determines success or failure more than any node. Split a code repository by folder, and four workers will review the same three files; split by blast radius, and each person sees something different.

A worker has one unit, one perspective, and one independent context. The word "independent" is the most frequently skipped. Four auditors share one window; the first writes down a finding, the next three read it, and four reports circle around the same thing. You pay for four, and buy one viewpoint plus three echoes.

The code node is the one most people forget exists. Merge, sort, deduplicate, compare exports before and after. None of these are reasoning; each has a single correct answer, and it's a matter of a few lines of code. Handing them to a model only adds cost, latency, and variance. The test: if you can describe this transformation without using the words judge, decide, evaluate, or summarize, it should be code.

Two back-edges; most people build only one

The correction edge is short. A gate sends a unit back to the step that produced it, fixing this pass.

The learning edge is long. Accepted results go back to the splitter and become a constraint, fixing every subsequent pass.

Almost everyone builds only the first and skips the second. The symptom is easy to recognize: the system is fast but never gets smarter.

The second edge does not carry the output itself; it carries constraints distilled from the output. It lands in the splitter's brief, not in the worker's instructions. A confirmed cause becomes a rule, and the next break starts where this one ended.

There is another expensive mistake on the return path: return the unit, not the batch. Four slice migrations are done, and one test fails. The whole batch is sent back, three correct slices are rewritten, the second version is different but no better, because the original wasn't wrong. Then you re-verify all four, and any one of them may now fail for a different reason. One failure turns into four uncertain results. Run it twice, and it can never converge again. From the outside it looks like the model keeps failing, but in reality the return path is destroying correct work.

Returning a single unit needs to carry several things clearly: which unit, judged red, the reason (test_auth_redirect failed), the evidence (expected 302, got 200, handlers/auth.py:88), and the scope (only change this file, do not touch other slices). The scope line looks unremarkable, but without it, the returned unit grows on its own: the agent opens the file, notices two nearby problems, fixes them too, and your one correction becomes a four-file diff no one reviewed. Another rule: stop after three failed fixes. If a unit fails three times, the problem is in the plan that produced it, and the loop cannot see the plan.

Gates open according to blast radius

This is counterintuitive.

Most approaches compute a confidence score, set a threshold, and let it through if it passes. Confidence is the weakest input in that decision, for a reason so simple it is almost absurd: it is the only input the model can influence. The truly strong variable is what happens if the change is wrong. Rank by cost to undo:

Reversible and limited, such as changing copy, adding tests, or an isolated function with coverage; if wrong, revert once. This lane can open first. Reversible but broad, such as shared utilities, schema additions, or things a dozen callers will touch; the gate looks at deterministic checks plus a clean trajectory. Hard to undo, such as migrations, deletions, writing production data, or moving money; no matter how high the score, this lane does not open.

The third row has no threshold. The difference is that thresholds get lowered; a closed lane does not get opened.

When a lane is open, the gate reads evidence in order: deterministic results, this run's trajectory, how many times this node has been rolled back in the past, and only last the model's own evaluation.

Where is the human? Put them at exactly one point: the step with the highest consequence and the lowest reversibility. Approve the merge; decide which fixes go live. Do not watch intermediate output; do not confirm every step. If a human stands in the middle of the graph, they become the slowest node in the graph, and the whole graph runs only as fast as one person reading.

Closing

Hanako turned the five layers into a course, twenty lessons; the link is agent-layers.vercel.app, the original tweet is here, and delost's is here.

Looking at the two materials together, the thread is very clear. Model capability is public; the six layers outside are your own. With the same model, change the shell and the output differs by a lot. Arguing about whose model scores higher is like arguing about whose engine has more horsepower, and then driving out in a car with no steering wheel.

I have seen many people's daily routine: they manually act as layer five, reading diffs, running tests, clicking merge every day, and then complaining that the agent isn't smart enough. This setup does move that job to the last step. After moving it there, at least you need to know what you are approving.

发布时间: 2026-11-19 22:33