You shipped it. It works. Someone asks you why the API accepts that parameter, or why you chose that data structure, or what happens when the input is negative β€” and you realize you can't answer. Not because you're new. Not because you don't care. Because you didn't make that decision. AI did. And now the code you've 'written' has become opaque to its own author.

The explanation gap is not about being bad at your job. It's about a structural feature of AI-assisted development: when the cognitive work of constructing a solution is removed from the author, the resulting code becomes unexplainable. Not to the team. To yourself.

This is different from the consultation trap β€” where you can't stop asking AI. This is its quieter cousin: after the code exists, you can't reconstruct why it does what it does. You can read it. You can maintain it. But you can't tell its story.

What the explanation gap actually is

When a developer writes a function from scratch β€” even a simple one β€” they go through a process: they think about what the input should look like, what output is needed, what edge cases exist, what the trade-offs of different approaches are. They make dozens of micro-decisions, each one a small cognitive investment. Those investments collectively build a mental model of the code.

That mental model is what lets an engineer explain their own work. Not the code β€” the reasoning. The 'why' behind the 'what.'

When AI writes the function, it does this process for you. The result is syntactically correct, often elegant, and entirely disconnected from your mental model. You have the code but not the reasoning. You can read what it does but you can't explain why it's designed that way.

πŸ” The five signals of the explanation gap

The handoff freeze: You finish an AI-assisted feature and can't describe it to a teammate without reading the code first. Not in overview β€” in reasoning.

The review paralysis: When asked to explain your own PR, you open the diff and start reading your own code as if it were someone else's. Because it is.

The architecture amnesia: You can't recall choosing the architecture of something you 'built' three months ago. It wasn't a decision β€” it was an AI output.

The alternative blindness: When someone asks "why didn't you use X instead?", you genuinely don't know. The question has no answer because no one considered alternatives.

The junior problem: A junior asks you why the system works this way and you realize you can only tell them what it does, not why it was designed that way.

Why it matters β€” beyond the awkward feeling

The explanation gap isn't just a personal confusion problem. It has cascading professional consequences.

Code quality degrades silently. The architecture review is where bugs are caught, where bad assumptions are challenged, where the team catches the edge case no one considered. If the author can't explain the reasoning, they can't defend it β€” and the review becomes a surface-level check instead of a substantive conversation. Bugs that would have been caught in a real review slip through.

Knowledge becomes a single point of failure. When code is unexplainable by its author, knowledge is effectively trapped in the repository. Oncall becomes guessing. Handoffs become painful. Bus factor goes from a team risk to an organizational crisis.

Junior engineers lose the mentorship loop. Code review is how junior engineers learn to think like senior engineers β€” by watching someone articulate and defend choices. When the author can't explain their choices, that learning pathway closes. Juniors review opaque code and learn to produce more opaque code.

Your career identity erodes from the inside. Engineers derive professional satisfaction from expertise β€” from being the person who understands the system deeply. The explanation gap slowly corrodes that identity. You become a coordinator between AI outputs and team questions, not an engineer with genuine understanding. The feeling of being a real engineer β€” the thing that makes this work satisfying β€” diminishes quietly.

Why explaining code to AI is not the same as explaining it to humans

Here's a subtle trap: when AI generates code, you often iterate on it with AI. You ask AI why something doesn't work. You ask AI to explain an error. You ask AI for alternatives. This interaction feels like understanding β€” but it's an illusion.

The explanation you build with AI is procedural: it answers "what's wrong with this code" in the moment of debugging. It doesn't build a mental model of the system's overall design. It doesn't connect to the business requirements, the historical decisions, the trade-offs that shaped the architecture.

When you explain something to a colleague β€” in a design review, in a pairing session, in a corridor conversation β€” you're forced to synthesize. You have to take the full picture and produce a coherent narrative that someone else can follow. That process builds understanding. The AI conversation never requires synthesis because AI doesn't need coherence from you β€” it just needs the next prompt.

Explaining code to AI Explaining code to humans
Focuses on the immediate problem Requires the full system context
No synthesis required β€” just next step Must produce a coherent narrative
AI adapts to your framing You must adapt to the listener's context
Creates procedural memory (how to fix) Creates structural understanding (why)
Can use vague terms β€” AI infers Must be precise β€” ambiguity exposed
No accountability for accuracy Your credibility is on the line

The seniority asymmetry

Senior engineers are not immune to the explanation gap β€” they're uniquely vulnerable to a specific variant of it.

Senior engineers have a deeper existing mental model β€” built over years of non-AI-assisted work. This model acts as scaffolding: when AI generates something, they can fit it into their existing understanding more easily than a junior can. They ask better questions, catch more obvious errors, and can explain more of what AI produces because they have a reference frame.

But this also creates a more insidious problem: senior engineers often can't tell when their explanation is post-hoc rationalization versus genuine understanding. They produce smooth, confident explanations of decisions they didn't actually make β€” because they have enough experience to make it sound plausible. The gap is invisible because the performance of understanding is good.

Junior engineers face the opposite problem: they know they don't understand, but they don't have the experience to know what questions to ask. The explanation gap manifests as confusion rather than false confidence β€” which is actually easier to address, even if it feels more dire in the moment.

The review bottleneck

The explanation gap has a specific and underappreciated consequence for code review: when the author can't explain their own code, review becomes a cargo inspection rather than a conversation.

Here's what happens in a healthy code review: the author explains the approach, the trade-offs considered, the edge cases handled. Reviewers probe the reasoning. Weaknesses are identified through dialogue. The quality of the review depends on the quality of the explanation.

When the author has the explanation gap: the PR description says "updated auth flow" with no reasoning. Reviewers can't probe what they don't understand. They check syntax, style, and obvious correctness β€” but architecture decisions, trade-off choices, and design reasoning go unexamined. The review passes with a βœ… and the gap remains invisible.

The problem is that architecture decisions made without review are where systems rot. Not because the decisions are necessarily bad β€” but because no one discussed them, no one challenged them, no one learned from them. The knowledge that would have been transferred in a real review doesn't get transferred.

What doesn't fix it

πŸ“š

Reading more about architecture

Learning about system design in the abstract is not the same as understanding your specific system. You can read every blog post on microservices and still not be able to explain why your service is structured the way it is.

πŸ€–

Asking AI to explain your code

AI explaining your code back to you does not create understanding in you. It creates a transcript of the code's behavior, not your reasoning. You learn what the code does β€” not why you chose to build it that way.

⏱️

"I'll understand it when I need it"

Oncall is not the time to discover you don't understand your system. The explanation gap is most dangerous precisely when you can't afford it β€” during incidents, outages, and critical decisions.

πŸŽ“

Pair programming more with AI

More AI interaction increases the volume of code you produce without increasing your understanding of it. The gap widens. You become faster and shallower.

The Explanation Protocol: how to close the gap

The explanation gap is not permanent. It's reversible β€” but only through deliberate practice, not passive consumption. The mechanism is simple: articulating reasoning forces the reconstruction of the mental model.

The Explanation Protocol: before you commit

  1. Open the diff. Close it again.
  2. Before looking at the code, write one paragraph: what does this feature do, why was it needed, and what approach did you take? Don't look at the diff β€” write from memory. If you can't: that's your gap. Now you know.
  3. Open the diff. Compare what you wrote to what actually exists. The discrepancies are where the gap lives.
  4. For each discrepancy, ask: did AI make this decision? If yes β€” this is the explanation gap, not a code quality issue. The code is fine. Your understanding is incomplete.
  5. Fix the gap by writing the missing reasoning. Not in comments β€” in a design doc, a PR description, or a Slack message to a teammate. The act of producing language forces the model reconstruction.
  6. If you can't produce the reasoning after 10 minutes of trying β€” that's a signal. Either dig into the AI's decision and reconstruct it, or flag to your team that the PR needs extra scrutiny because the author can't currently explain the approach.

This protocol won't work every time. Some AI-generated code genuinely has no reasoning behind it β€” because AI doesn't reason, it produces. When you hit that wall, you have a choice: invest the time to understand what was produced well enough to explain it, or go back and build it yourself.

That second option β€” building it yourself β€” feels slow. In the context of a deadline, it is slow. But it produces something the explanation protocol cannot: genuine understanding that compounds over time. The 30 minutes you spend building it manually instead of prompting AI are not lost time β€” they are the difference between being an engineer who can explain their system and a coordinator who can only read it.

The team-level fix

Individual practice is necessary but not sufficient. The explanation gap has a team dimension: when code review stops being a knowledge transfer mechanism, the team's collective understanding stops growing.

The 'explain this to a junior' rule: Before any PR is merged, the author must be able to explain the key decisions to a hypothetical junior engineer. Not just what the code does β€” why that approach was chosen. If the author can't do this, the PR doesn't merge until they can β€” or until they've flagged it as a known gap and documented it.

Architecture decision records: For any non-trivial decision, write a short ADR before the code exists. Not after. The ADR is a commitment: this is why we're doing it this way. It forces the decision to be made before the code is written β€” which means the author actually has to make it. AI can't write an ADR because AI doesn't have business context, team constraints, or historical reasons.

The weekly explanation exercise: Once a week, pick something you built with AI in the last week. Write a one-page explanation of why it works the way it does, including alternatives considered and rejected. Share it with one teammate. Their questions will expose the gaps β€” and the process of answering will close them.

The question worth asking

Here's the uncomfortable question: if you can't explain the code you wrote β€” can you claim you wrote it?

The answer isn't simple. AI-assisted development is a legitimate practice. Using AI to generate boilerplate, to handle routine implementation, to explore alternatives β€” all of this is part of modern engineering. There's no clean line between "I used AI" and "I still wrote it."

But the explanation gap is real regardless of the philosophical question. Code you can't explain is code you can't maintain, teach, defend, or trust. It's code that works but doesn't belong to you β€” in any meaningful sense of the word.

The engineers who will thrive in an AI-assisted world are not the ones who use AI the most. They're the ones who can maintain the feedback loop between decision and understanding β€” who ensure that the code they ship is code they can explain, code they can teach, code they can own.

The explanation gap isn't a reason to use less AI. It's a reason to be more deliberate about which cognitive work you hand off β€” and which work you keep for yourself.

Frequently asked questions

Why can't I explain code I wrote with AI?

The explanation gap forms because AI removed the cognitive work that would have created the mental model. You didn't decompose the problem, choose the approach, or work through the trade-offs β€” AI did. The resulting code exists in your repository but not in your head. Without the process, there's no story to tell.

Is this the same as imposter syndrome?

No. Imposter syndrome is feeling like a fraud despite competence. The explanation gap is something different: you genuinely cannot reconstruct the reasoning behind your own code because you didn't do the reasoning. The code is foreign to you even though you're the one who 'wrote' it. It's not a confidence problem β€” it's a knowledge gap.

Does the explanation gap affect code review quality?

Yes, profoundly. Code review depends on the author being able to explain trade-offs, justify choices, and respond to questions. When an author can't explain their own code, review becomes superficial β€” reviewers can't probe effectively, architecture decisions go unexamined, and bugs that would have been caught in conversation slip through. The explanation gap is a code quality risk.

How do I know if I have the explanation gap?

A simple test: take any feature you shipped in the last 30 days. Can you explain why it was designed that way? Can you name the alternatives you considered and why you rejected them? Can you describe the edge cases your implementation handles and why you chose that approach? If you can't do this without looking at the code, you have the explanation gap.

Can the explanation gap be reversed?

Yes β€” but it requires deliberate practice. The reversal protocol: after every AI-assisted session, before committing, write a one-paragraph explanation of what you built and why. Not the code β€” the reasoning. The act of articulating it rebuilds the mental model. Over time, this bridges the gap between code and comprehension. It's slower than just committing, but it restores something AI assistance is quietly removing.

Continue exploring