Codebase Insight / Articles / Comprehension debt
COMPREHENSION DEBT · GUIDE

Comprehension debt: the code nobody understands.

Your team can now produce code faster than it can understand it. The difference accumulates quietly, shows up in no dashboard, and comes due during an incident. This guide defines comprehension debt, looks at the evidence, and shows five signals you can measure in your own repository today.

KEY TAKEAWAYS
  • Comprehension debt is the gap between code that exists and code somebody understands.
  • It differs from technical debt: the code can be clean and still be a liability if nobody can explain it.
  • No single metric captures it, but five repository signals get close: hotspots, ownership, hidden coupling, untested code and unreviewed change.
  • You pay it down by aiming human attention at the risky parts and making understanding cheap everywhere else.
DEFINITION

Comprehension debt is "the growing gap between how much code exists in your system and how much of it any human being genuinely understands." (Addy Osmani, March 2026)

Where the term comes from

Addy Osmani, who works on Claude Code at Anthropic, gave the problem its name in "Comprehension Debt: the hidden cost of AI generated code", later reposted by O'Reilly Radar. His core observation is about speed: "AI generates code far faster than humans can evaluate it."

That flips an old safeguard. Review used to work because writing was slow and reading was fast. Now, Osmani writes, "a junior engineer can now generate code faster than a senior engineer can critically audit it", and "what used to be a quality gate is now a throughput problem."

A month earlier, Margaret-Anne Storey described the same thing as cognitive debt: "the debt compounded from going fast lives in the brains of the developers". Her example was a team that stalled completely: "They had accumulated cognitive debt faster than technical debt, and it paralyzed them." Simon Willison, sharing her post, admitted to the same feeling about his own projects: "I no longer have a firm mental model of what they can do and how they work".

Comprehension debt vs technical debt

TECHNICAL DEBTCOMPREHENSION DEBT
Where it livesIn the codeIn the team's heads
How it's createdDeliberate or careless shortcutsAccepting code faster than you understand it
Can the code look fine?Usually notYes. Clean, tested and still unknown
Who sees itLinters, reviewers, anyone who opens the fileNobody, until something breaks
When it comes dueThe next changeThe next incident, audit or resignation

The second column is why the usual tools miss it. A linter cannot tell you that the one person who understood the billing module left in March.

What the evidence says

The most cited study is Anthropic's randomised trial of 52 software engineers learning a new library (January 2026). The group using AI assistance averaged 50% on a follow-up comprehension quiz. The group coding by hand averaged 67%. The AI group was not meaningfully faster.

Read it carefully, though. The participants were mostly junior, the sample was small, and the authors note that "using AI assistance didn't guarantee a lower score". How people used the assistant seemed to matter. In the study's small subgroups, participants who asked the assistant conceptual questions scored about 65%, and those who delegated the whole task scored about 39%. The authors do not claim a causal link, but the direction is encouraging: comprehension debt looks like a result of how a team works, and that means it can be managed.

At team scale, Faros AI's telemetry from more than 10,000 developers shows where the debt enters: high-AI-adoption teams merge 98% more pull requests, average PR size grows 154%, and review time rises 91%. More code, in bigger pieces, through the same number of reviewers.

What engineers are saying

The term is argued over, which is a sign it describes something real. A selection from Hacker News:

"The only people I've heard saying that generated code is fine are those who don't read it."

"but I still get as much work done in an hour as I used to do in a day"

"If only one person knows the code, then PR time isn't going to save you."

"will let errors or future pitfalls silently slip into your code"

Both sides are right. The speed is real, and so is the loss of understanding. The argument continues in the comments on the O'Reilly repost. The useful question is where the missing understanding will hurt you.

Five signals you can measure

Comprehension debt does not show up in the usual delivery metrics. Velocity can rise while understanding falls. But your repository and its git history contain good proxies. None of them needs AI to compute.

1. Hotspots: where change is expensive

A hotspot is a file that changes often and is complex, an idea popularised by Adam Tornhill's work on behavioural code analysis. Add the bug-fix commits that keep landing there and you have a ranked list of where misunderstanding costs the most. If nobody understands a file that is changed twice a year, that can wait. If nobody understands a hotspot, treat it as urgent.

2. Ownership and bus factor: who actually knows this

Count the authors behind each file and module. Code with one active author, or whose main author has left, is comprehension debt already on the books. In an agent-heavy team, watch for a new pattern: modules where the commits carry human names but no person wrote or closely read them.

3. Hidden coupling: what changes together

Files that change in the same commits but never import each other are coupled in a way the code does not show. Generated code produces this easily, because an agent copies a pattern into three places and none of them refers to the others. Co-change analysis finds it in the history.

4. Untested files: where nothing checks your assumptions

Osmani's line is "Tests are necessary. They are not sufficient." Fair, but a file with no tests at all and no confident owner is the worst of both. Cross untested files with hotspots and you get the short list.

5. Structure drift: the architecture you have

Compare the real import graph with the one in your head or your docs. Import cycles, modules everything depends on, and unstable modules that stable ones depend on are all places where a mental model has gone stale.

Ombuto Codebase Insight hotspots view: a treemap of files sized and coloured by churn and complexity
Signal 1 in practice: churn × complexity hotspots in Ombuto Codebase Insight, shown on a demo repository.

How to pay it down

  1. Rank, then read. You cannot understand everything again. Use the five signals to pick the ten files where understanding matters most and start there.
  2. Review by risk. Give changes that touch hotspots, single-owner code or untested files a slow, careful review. Move quickly through the rest. See The AI code review bottleneck: review by risk, not by line.
  3. Spread ownership on purpose. Assign the second reviewer for a risky module to someone who has never touched it.
  4. Ask the code questions, and demand citations. An LLM is a good tutor for unfamiliar code if every answer points to the files and lines it came from, so you can check it. An uncited explanation only adds to the debt.
  5. Write the intent down first. Code generated from an approved spec comes with a reason attached. This is the argument for a human-in-the-loop software factory.
MEASURE IT WITH OMBUTO CODEBASE INSIGHT

See your comprehension debt in one pass.

Ombuto Codebase Insight is an open-source desktop app that computes all five signals from your code and git history: hotspots, ownership and bus factor, co-change coupling, untested files and the real module graph, across eleven languages. Static analysis runs on your machine. When you ask a question, the answer is labelled as AI and cites its files and lines. Apache 2.0, free, early access.

$ npx ombuto-codebase-insight ~/code/my-repo

Frequently asked questions

What is comprehension debt?

Comprehension debt is the gap between how much code exists in a system and how much of it any person on the team understands. Addy Osmani popularised the term in March 2026 to describe a cost of AI-generated code that velocity metrics do not show.

How is comprehension debt different from technical debt?

Technical debt lives in the code: shortcuts that make future change harder. Comprehension debt lives in people: the code may be clean, but nobody can explain why it is the way it is or predict what a change will break.

How do you measure comprehension debt?

There is no single metric. Use proxies you can compute from the repository: hotspots (files that change often and are complex), ownership concentration and bus factor, hidden coupling between files that change together, files with no tests, and the share of recent change that nobody on the current team wrote or reviewed closely.

Is comprehension debt the same as cognitive debt?

They describe the same problem from two sides. Margaret-Anne Storey's cognitive debt emphasises the missing mental model in developers' heads. Comprehension debt emphasises the growing body of code that nobody has understood. Teams usually use the terms interchangeably.

Sources and further reading

Keep reading