It's 5 p.m. and a pull request lands in your queue with a cheerful note: AI did most of this, tests are green. The diff is big but tidy. It compiles, the unit tests pass and staging is happy. You start reading anyway.
Twenty minutes in, you still can't say why the permission cache lives for five minutes. The fallback path looks sensible, but nobody on the team remembers whether a user whose access was just revoked should keep it during that window. The code might be completely correct. You just can't explain it well enough to put your name under it.
That feeling has a name: cognitive debt. It's the gap between the system you have and how well your team understands it, well enough to change it, debug it and keep it running at 2 a.m. Below: where the idea comes from, why AI coding tools make it pile up faster, what the recent data says and the team habits that pay it back.
Three kinds of debt
Technical debt is the one everybody knows. You copy a function instead of extracting it, skip a test, couple two modules you meant to keep apart and promise to clean up later. The debt sits in the code, and you can point at it.
Cognitive debt sits in people's heads, or more exactly in what's missing from them. The code is typed, formatted and merged, but nobody can say why a flow exists, which invariant keeps it safe or what breaks if you touch the module next door.
The idea is older than AI. In 1985 Peter Naur argued that a program is really a theory held by the people who built it, and that code and documentation can't fully carry that theory. When the team holding it breaks up, the program is dead in his sense, even if it keeps running and producing results (Programming as Theory Building). In March 2026 Margaret-Anne Storey gave the AI-era version a name with her Triple Debt Model: technical debt in the code, cognitive debt as "the erosion of shared understanding across a team", and intent debt as "a lack of externalized goals, constraints, and rationale that both humans and AI systems need to work safely and efficiently with the codebase".
| Debt | Where it lives | The question you can't answer |
|---|---|---|
| Technical debt | Code, design, architecture | Is this easy to change? |
| Cognitive debt | The team's shared mental model | Do we understand this well enough to change it safely? |
| Intent debt | ADRs, specs, PR descriptions, prompts | Why was it built this way? |
The annoying part: cognitive debt never fails a build. There's no type error and no lint warning. It shows up months later as one sentence in standup: "Don't touch that part, nobody really knows how it works."
Why AI speeds up the borrowing
Writing code by hand used to double as studying it. You found the constraints while typing, ran into the edge cases while testing and got a feel for the system by changing it yourself. The understanding came bundled with the work.
With an assistant or an agent, you can accept a 600-line refactor, a migration or a whole integration layer before you've built that understanding. The code grows faster than anyone's picture of it.
A small example. You ask an agent to "make payment retries more resilient." It adds exponential backoff, pulls out a shared retry helper, catches a few more provider errors and updates the tests. Looks like a reliability win. Now ask three things. Which provider errors are actually safe to retry? Does every charge carry an idempotency key? What does the partner's rate limit do when a thousand retries arrive at once? If nobody checked, the team changed more than code. It changed an operational contract it doesn't understand yet.
The delivery data points the same way. DORA's 2024 research found that every 25% increase in AI adoption went with a 1.5% drop in delivery throughput and a 7.2% drop in delivery stability, and named bigger batch sizes as a likely reason (DORA, Impact of Generative AI in Software Development). The 2025 report, still the latest DORA edition as of November 2026, saw throughput recover: AI adoption now goes with higher throughput. Instability still rises, and the authors' hypothesis is that "it is harder to review larger batches of code". The same report found that working in small batches amplifies AI's positive effect: teams that work this way see a bigger lift in product performance and less friction (State of AI-assisted Software Development 2025).
Developers feel it too. In Sonar's survey of more than 1,100 developers, published January 2026, 96% said they don't fully trust that AI-generated code is functionally correct, yet only 48% said they always check it before committing (Sonar, State of Code survey).
None of this says AI is bad for software. It says writing stopped being the slow step. Checking and understanding took its place, and a review process designed for hand-written PRs needs an update.
What happens to the person holding the tool
In January 2026 Anthropic published a randomized trial with 52 mostly junior engineers learning Trio, a Python async library none of them had used before. One group could use an AI assistant, the other coded by hand. Afterwards everyone took a quiz on the library. The AI group averaged 50%, the hand-coding group 67%. The AI group finished about two minutes faster, a gap too small to be statistically significant. The widest difference was on debugging questions (How AI assistance impacts the formation of coding skills).
The useful detail is how people used the tool. Participants who handed the whole task to the AI, or leaned on it more as they went, scored lowest. Those who generated code and then asked follow-up questions, or used the AI for conceptual questions, scored close to the hand-coders. It's one study about learning a new library, so it doesn't prove "AI makes you worse at programming". It does suggest that how you ask decides whether you're building understanding or skipping it.
AI can also pay cognitive debt down. Ask it to map dependencies, draft a test matrix, list edge cases or sketch a sequence diagram, then check the result against the code. The trouble starts when a team only uses it to produce more while its understanding stays where it was.
An example: the auth layer nobody can explain
Say your team asks an agent to build an authorization layer:
User -> Role -> Policy -> Resource -> Action
The demo works. The middleware is neat, there's a cache and a handful of tests. What nobody writes down are the actual rules:
- Which policies can admins skip, and why?
- Where did the five-minute cache TTL come from?
- After you revoke someone's access, how long is it acceptable for the old permission to keep working?
- Which policies guard money or personal data and must fail closed?
- What does the audit log need to prove when something goes wrong?
Six months later, a user whose access was revoked can still open a finance report for a few minutes. The code isn't ugly. What's missing is the understanding around it: the team accepted a working artifact without the intent and invariants that make it safe to run.
Signs your team is carrying it
The early signs look ordinary.
- The code works, but nobody volunteers to change it. Every small change needs three people, ten files and a long manual regression pass.
- Review turns into a ritual. Comments stick to naming and formatting because the diff is too big or too unfamiliar to judge what it's for.
- Onboarding drags. A new teammate reads the docs, then the code, then hears three different explanations from three people.
- Debugging waits for one person. A couple of people act as human routers, and when they're on leave, the work stalls.
- You ask AI to explain code nobody can check. That's a fine start, and a risky finish when there are no tests, logs or design notes to check the explanation against.
Every useful system gets complex, so complexity on its own is fine. The warning sign is that the theory of the system, in Naur's sense, no longer lives with the people who are on call for it.
Slow down at the right moments
"Slow down" is an easy slogan and a poor plan. Nobody is asking you to go back to typing everything yourself. The useful version is narrower: slow down at the points where understanding gets built or lost.
A short design note. A PR description that lists its assumptions. Splitting an agent's patch into three PRs. Asking the reviewer to restate the invariant in their own words. Each one adds friction, and each one is also where the team rebuilds the mental model that keeps next month's work fast.
One rule covers most of it: don't merge code that nobody understands well enough to operate. At least one person should be able to say what changed, why, how it can fail, how you'd notice and how to roll it back. They don't need to have typed every line. They do need to own making the change understandable before it ships.
A PR template for AI-assisted changes
The pull request is the easiest place to start. Besides "what changed", ask for the thinking the next person needs to inherit the change safely.
For any meaningful AI-assisted change, add these to the PR: why this change, key assumptions, invariants it adds or protects, how it can fail, how to roll back, what AI generated, and what you checked by hand.
For the auth example. Why: revoked permissions must stop working within 60 seconds. Assumptions: the policy cache is at most one minute stale, and finance resources fail closed. Invariant: every access decision writes an audit event. Rollback: switch the cache off with its feature flag. Checked by hand: revoked a user on staging, retried the resource and confirmed the audit trail.
It's five minutes of writing. In return, the next person (or the next agent) gets a map instead of a dig site. If you want more on keeping that map in human hands while AI drafts, read Letting AI Draft While Humans Keep the Map.
Six habits that pay the debt back
- Keep AI batches small. If a reviewer can't reason about the patch in one sitting, ask the agent for smaller steps. DORA's 2025 small-batch finding backs this up.
- Treat AI prototypes as throwaway. Use them to explore, then rebuild the version you keep through your own architecture, naming and test strategy.
- Review for understanding. The review is done when the reviewer can explain the change back in their own words.
- Write the intent down. ADRs, decision logs, a domain glossary, sequence diagrams, runbooks and migration notes, sized to how much the change matters.
- Point AI at the debt. Have it draft a test matrix, list edge cases, summarize dependencies or compare the code with the spec, then have a person check what it produced.
- Keep people on the hard calls. Architecture, public APIs, security boundaries, data migrations and anything you can't undo stay human decisions, even when AI writes the first draft.
In practice: don't ask an agent to "modernize the auth module" and merge one heroic diff. First ask for characterization tests around today's behavior. Then extract the policy lookup. Then add the cache behind a flag. Then document how revocation works. Each PR asks the reviewer to understand one idea instead of five tangled ones.
What leads can do
The teams most at risk aren't always the ones using AI badly. Sometimes they're the ones using it with real enthusiasm while the only number anybody celebrates is output. If "we merged three times more PRs" is the headline, people will chase volume and hide what understanding costs.
Leads can say the other part out loud: the goal is to own what we ship, and AI is welcome as long as that stays true. That means protecting time for design review and focused work, praising a clear PR description as much as a fast fix, and asking in retros where AI helped and where it added pressure.
Try this week
- Add the seven fields to the next AI-assisted PR your team opens. If nobody can fill in "how to roll back", you've found your first piece of cognitive debt.
- Ask one reviewer to explain a merged AI-assisted change back to its author in two minutes. Note where they get stuck.
- Next time you prompt an agent for a big change, ask it to split the work into steps a reviewer can check one at a time.
- Pick one "nobody touches this" area and have AI draft a dependency map for it. Then spend an hour checking the map with the person who knows the code best.
AI is great at drafting, searching and comparing. The codebase, though, will be maintained by people, and they'll need to know what was built and why. Keep their understanding close to the code, one small PR at a time.