Comprehension Debt is the dangerous state where no entity—human or machine—possesses a persistent “theory” of how the software system works.
It accumulates when code is written by an AI agent (which has perfect but transient understanding) and accepted by a human developer (who has persistent but fading understanding). Because the AI discards its mental model immediately after task completion, the human is the only potential vessel for the “Theory of the Program.” If the developer effectively delegates their understanding to the AI, the theory vanishes entirely.
Core concept
The term was coined (and popularized in the AI context) by Arvid Kahl, drawing inspiration from Peter Naur’s 1985 essay, Programming as Theory Building. Naur argued that a program is not just the source code, but the “theory” of its operation held in the minds of the programmers.
The AI’s Lack of Persistence
The fundamental driver of this debt is the transience of AI reasoning. When an AI agent (like Claude Code) writes code, it builds a Transient Theory:
- It loads necessary context from the files.
- It constructs a temporary mental model (a “theory”) to solve the prompt.
- It executes the changes.
- It discards the model entirely.
Unlike a human developer who retains the “why” and “how” over months, an AI has session-level amnesia. Every time it starts a new task, it must re-calculate the theory from scratch.
The Human as the “Theory Anchor”
Because the AI’s understanding is disposable, the human developer must serve as the Persistent Theory Anchor. If the developer stops reviewing the AI’s output and merely verifies that “it works,” thePersistent Theory vanishes from the total system. The “Debt” is the high cost (in time, tokens, and risk) that must be paid later for any actor—human or AI—to reconstruct that lost understanding from the static source code.
“The agentic coding system does not retain the theory… it discards the internal theory completely… with Claude Code it is unretrievable. It will never come back.” — Arvid Kahl
Why it matters
- Loss of Agency: You cannot effectively direct an AI agent if you don’t understand the current state it is working from. You move from being an architect to being a “vibe checker.”
- Invisible Complexity: AI often solves problems by adding more surface area (new files, new functions). This complexity is “free” to the AI but “expensive” to the human mind.
- Maintenance Risk: When the AI fails (hallucinates or hits a context wall), the human must take over. If comprehension debt is high, the cost of “re-learning” the code is prohibitive.
- Exit Strategy Risk: As Kahl notes, a SaaS buyer isn’t just buying code; they are buying the knowledge of how to keep it running. Codebases with high comprehension debt are harder to hand off and thus less valuable.
Mitigation Strategies
Arvid Kahl suggests several patterns to “pay down” comprehension debt while maintaining high AI velocity:
- Synchronization Review: Instead of just “checking for bugs” (which tests can do), use the code review process to resynchronize your mental model. Arvid steps through every change not to police syntax, but to update his internal understanding of the system’s new state.
“I do this step so I can resynchronize my theory… which is why I step through each of these changes.”
- Micro-Delegation: Hand off even tiny changes (e.g., “make this purple slightly darker”) to the AI. This ensures the AI’s (transient) theory is always updated with the latest state, and you see how it chooses to implement even the smallest details.
- Video-to-Docs Pipeline: Record Loom videos of yourself explaining the codebase to a “junior dev.” Use AI to transcribe these and turn them into
platform-docs.md. This forces you to articulate your theory and provides the AI with a persistent “Knowledge Base.” - Delayed TDD (Test-Driven Development): Arvid explicitly uses “Delayed TDD”—implementing features first, then immediately having the AI write comprehensive tests (thousands of assertions) for the new code. These tests act as a “safety net” that pins the theory in place, ensuring that even if the developer’s comprehension fades, the system’s behavior is rigidly defined.
Related Concepts
- Spec-Driven Development: Using specifications to guide the “theory” before code exists.
- Vibe Coding Is FAAFO: The danger of building things you don’t understand.
- Maker-Checker Pattern: Using one AI to build and another to verify, with the human as the final arbiter of truth.
References
Arvid Kahl, “Arvid Kahl’s SaaS is 98% Coded by Claude” (2026)
Interview on Brian Castle’s Builder Methods, detailing the real-world application of comprehension debt mitigation.Arvid Kahl, “Why AI-Generated Code Hurts Your Exit” (2025)
The core essay defining comprehension debt as the loss of the “Theory of the Program.”Peter Naur, “Programming as Theory Building” (1985)
The foundational philosophical text arguing that the programmer’s understanding is the primary asset of a software project.