What is comprehension debt?

How to measure it, and how to pay it down · K. L. Aadithya · November 2026
In short: comprehension debt is the gap between how much code exists in your system and how much of it any person on your team actually understands. AI coding agents make it grow faster than ever, because code now arrives faster than people can build a mental model of it. You can measure it from git history, and you pay it down by having people genuinely engage with the code, not by writing more documentation.

A definition

Every codebase has two sizes: the amount of code in it, and the amount of it that someone on the team could explain, change safely or debug without help. Comprehension debt is the difference between the two.

It is different from technical debt. Technical debt is about the code itself: shortcuts, missing tests, tangled dependencies. It slows you down every day, so you notice it. Comprehension debt is about people. The code can be clean, well tested and well named and still be debt, because nobody has a model of how it works. It stays invisible until something breaks and the person on call opens a file nobody has ever really read.

The term was popularized in 2026 by Addy Osmani, who argued that code review used to force understanding: reading a colleague's change was a bottleneck, but a productive one. When an agent writes the code and the review is a quick skim of a clean-looking diff, that feedback loop disappears.

Why AI coding agents make it grow

Agents don't create comprehension debt on purpose. It comes from how they change the economics of writing code:

None of this means agents are bad. It means understanding no longer happens as a side effect of writing code, so it has to happen on purpose.

What it costs

How to measure comprehension debt

You can't measure what's in people's heads directly, but you can measure two things that together get you most of the way:

1. Which code was written by AI

Most coding agents leave evidence in git: Claude Code adds a Co-Authored-By: Claude trailer, GitHub's Copilot coding agent commits as its own account or adds a co-author line, Cursor's agent uses cursoragent@cursor.com, Aider prefixes messages with aider:. Combine that with git blame and you know, line by line, which current code came from an agent-assisted commit.

2. Which of it someone has shown they understand

This is the part teams skip. Approving a pull request is weak evidence; answering questions about the code is strong evidence. A short quiz, "what happens if this list is empty?", "why is this check before that one?", "a user reports X, where do you look?", separates understanding from skimming in two minutes.

Then you can define a number:

comprehension debt = (AI-written lines nobody has shown they understand
                      + ½ × lines only skimmed or understood long ago)
                     ÷ all meaningful lines

This is exactly what grokmap computes. It runs locally on any git repository:

pipx install grokmap
grokmap status      # the number, the riskiest files, who understands what
grokmap report      # an interactive heatmap
grokmap trend       # how the AI-written share changed month by month

Understanding is tracked per line: if a line someone was quizzed on is later changed, it counts as new code again. Understanding older than six months is marked as fading.

How to pay it down

  1. Quiz right after the change. The best moment to understand code is right after an agent writes it, while the context is fresh. grokmap's agent skill offers a two-minute quiz before you commit, on exactly the lines you haven't seen.
  2. Start with the riskiest files. Debt in payment, authentication or data-migration code matters more than debt in a test fixture. Mark critical paths and look at those first.
  3. Make it visible in pull requests. A PR comment saying "this change adds 340 AI-written lines, 0 understood" changes behavior more than any policy document.
  4. Ask, don't just delegate. Using the agent to explain code, rather than only to produce it, builds understanding instead of eroding it.
  5. Don't turn it into a leaderboard. The goal is an honest map of what the team understands, not a ranking of people. A measure people game is worse than none.

What comprehension debt is not

Try it on your repository

See a live example report, read how much of popular open-source projects is AI-written, or install grokmap from GitHub. It's free, MIT-licensed, and makes no network calls.