someone counted the ai in claude code. it's 1.6%.
somebody counted the actual “ai” inside claude code. it’s 1.6% of the codebase. the other 98.4% of the code is ordinary software: permission checks, context management, tool routing, error recovery. the smart part is a sliver. the part that makes it run is plumbing.
what got measured
a research group (vila lab, mbzuai) took claude code apart file by file and published the teardown (arxiv 2604.14228, ~1.8k stars on the repo). the build they read was version 2.1.88: roughly 512,000 lines across 1,884 typescript files. they hand-classified each one. the result: about 1.6% of the code is ai decision logic. 98.4% is deterministic infrastructure.
worth being precise about what that is. it’s not “the agent is right 98.4% of the time.” it’s how much of the codebase is plumbing versus model-facing logic. 98 lines of scaffolding for every 2 that decide anything.
their one-line summary is the whole story: “the agent loop is a simple while-loop; the real engineering complexity lives in the systems around it.”
read that twice. the loop everyone pictures when they say “the agent” is a while-loop. a first-year could write it. everything hard is the scaffolding wrapped around the model.
that’s not a knock. it’s the point.
there’s a name for this now. martin fowler’s team writes it as a plain equation: agent = model + harness. the model does the reasoning. the harness is everything else. what the model is allowed to touch. what it sees each turn. which tool fires. what happens when a step dies halfway through.
swap in a smarter model and you get better guesses. but the guesses still have to survive contact with a real machine, and that survival is a software problem, not a model problem. it’s the 98.4%.
which is why the teams shipping agents that actually hold up aren’t the ones sitting on a secret model. they’re the ones who built the boring part well.
our receipt
we’d tell you the same thing, except we don’t have to. our own stack is open source, and github does the counting for us. measured a different way (github’s automatic language count, not a hand teardown), the 5dive repo comes out 99.5% shell. mit licensed. every line readable.
that’s not us being retro. the model isn’t ours to build, anthropic ships that. what’s ours to build is the harness: running agents as long-lived services on a box, wiring them to telegram, handing them skills, letting them message each other, parking the risky moves behind a human tap. all of that is plumbing. so the repo is plumbing.
same shape as the claude code teardown, and here’s the part that matters: it’s plain bash you can read. no black box, no build step you have to trust, on a box you own. the intelligence is rented. the machine around it is auditable, and it’s the actual work.
(the “box you own” half of this is its own thing. we wrote it up separately: who owns the box your agents run on.)
where to actually spend your effort
if you’re building with agents, the takeaway is boring and useful. stop shopping for the smartest model and start investing in the scaffolding.
the questions that decide whether an agent holds up in production aren’t about the model. they’re: what can it touch. what does it see this turn. what happens when it fails on step 4 of 9. who gets pinged before it spends money. none of that is a prompt. all of it is the harness.
pick a model, fine. then spend the next month on everything that isn’t the model.
the one action item
go look at what you’re actually building. if 100% of your effort went into prompt wording and model choice, you built the 1.6% and skipped the part that keeps it alive.
want the harness without wiring it yourself? that’s 5dive. your agents run on a box you own, signed into your own claude plan, with the machine around the model already built: 5dive.ai
or read ours first. the whole thing is open, mit, and 99.5% bash: github.com/5dive-ai/5dive