DEV Community

Cover image for someone counted the ai in claude code. it's 1.6%.
lodar
lodar

Posted on Edited on Originally published at blog.5dive.ai

someone counted the ai in claude code. it's 1.6%.

the model is a small slice of a working agent. claude code's codebase is mostly permission checks, context management, tool routing and error recovery, and that scaffolding decides whether an agent holds up.

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. about 1.6% of the code is ai decision logic. 98.4% is deterministic infrastructure.

their one-line summary: "the agent loop is a simple while-loop; the real engineering complexity lives in the systems around it."

agent = model + harness

martin fowler's team writes it as a plain equation: agent = model + harness. the model does the reasoning. the harness decides what the model may touch, what it sees each turn, which tool fires, and what happens when a step dies halfway through.

a smarter model gives better guesses. those guesses still have to survive a real machine, and surviving it is a software problem.

the teams shipping durable agents built the scaffolding well.

what to work on

if you build with agents, put your next month into the scaffolding. three questions to answer first: what can it touch? what does it see this turn? what happens when it fails on step 4 of 9?

the one action item

look at what you're building. if all your effort went into prompt wording and model choice, you built the 1.6% and skipped what keeps it alive.


5dive runs claude code, codex, grok and other CLI agents as always-on services on your own server. the repo is open, mit and about 99% shell: github.com/5dive-ai/5dive ยท 5dive.ai

Top comments (0)