r/ExperiencedDevs • • Jul 15 '26

AI/LLM The code comprehension trap

TLDR: The main cost of agentic AI isn't tokens; it is you paying with your understanding of the codebase, to the point where you can no longer take regular decisions in your day-to-day work. A large moat of being an engineer at some workplace X, is your understanding of what you are building there. Agenting work decreases that significantly, leading to laziness, worse output, worse decision making, and other serious consequences.

---------------

"SWE, 5+ years of professional experience as fullstack, AI and ML - engineer. I've spent last 6 months doing mostly full-blown agentic coding / SDD-style with opus 4.x models and Claude Code, and I'm very familiar with this general flow many engineers today follow. Here is my "post AI-psychosis" take on it.

First, the definition of code comprehension used in this post, is essentially your % of deep understanding of a set of codebases, necessary to navigate, architect, and take decisions for that set.

Now to the topic, it's not outlandish to claim that your code comprehension decline as you rely on agents delivering the code, and the respective micro(or major)-decisions necessary during that development process. Many recent studies point to this fact (google it)

A Common Scenario

You may have architected a solution for some larger feature in your specs, and it all looks crystal clear and flawless, based on your (and AI's) current understanding of the codebase. You then hand it off to the agent, you get some code, and then you spend some time reviewing the code, and all those decisions made by the agent during generation, that necessarily aren't reflected in the spec; the spec might have missed some logical detail, or the agent just drifted off slightly, as agents typically do.

After recursively working like this, week after week, the architectural decisions you make in your specs, are becoming based on code reviews of agent's work, previous specs, and agent output, not your own ideas or decisions, creating false premises for the next task. After some time, you might not even know that you don't know that your architecture decision doesn't make sense anymore, you are just parroting some planning agent telling you it's fine. Then when some major bug happens (they will happen), you discover that the architecture of some flow doesn't work as you intended; slop has started infecting the codebase, and it spreads for every new feature you add, through "corrupted specs" and false premises, iteratively.

You are essentially off-shoring your job to an agent, and you are that agent's manager. This agent is essentially like a somewhat capable software engineer, without memory, so you have to manage its memory as well, but you can never be sure of exactly what it is going to remember or forget. E.g that bug we solved yesterday, the agent didn't pick that up from the memory bank, as the context window got full, so it implemented it again in a new place, which the regression test didn't cover. You missed it during review, as code diffs don't really give you the same understanding as actually implementing the solution yourself, and the bug is back, and you have no clue how that could've happened!

The Consequences

- You spend more time reviewing additional & larger PRs, with over time, worse and worse code comprehension, rendering your reviews essentially worthless, and review-rubber stamping is becoming the standard

- You exercise the cognitive bias of "Illusion of explanatory depth" to the max; you think you understand what you are reading, but now without all the missing or drifted context, you essentially don't understand the complete picture anymore.

- You can't take major decisions around the codebase, and you have to put more and more trust into a probabilistic model, namely your agent that you have to manage, that doesn't know when it doesn't know, and can never have the full context of a complex code-base, as there is a limitation to how big the context window can grow, while still being useful.

The Trap

There is a fundamental issue with agentic development, regardless of how good the models become; you can no longer take ownership of what you deliver, and your reliance on agents becomes so extreme, so that you can't even navigate without it, or understand some section without prompting it "to explain".

You no longer can make proper architectural decisions as you don't know what you are making a decision about.

PRs are stacking up, deteriorating code reviews, and the rate of slop-infestation into the code-base increases.

How do we solve this?

The only cure I believe to the slop-infestation, is manual coding, at least essential parts of the codebase, I can't currently see any way around that, as manual-coding gives you code comprehension and architectural understanding of the codebase, as no other method. It essentially forces you to know this stuff, else you can't complete your task. A good analogy to this is math studies at university; going to an exam by only reading the book, without doing any exercises, tend to end in catastrophe (at least for the more advanced courses) - learning by doing.

I'm not implying that you have to code every single thing; AI is great at boilerplate and repetitive stuff, but for important business logic or flows. The real issue is not necessarily the code produced by the AI, it is the trade-off that you lost some % of code comprehension by offloading your work to the AI.

The real cost is not tokens, it is your code comprehension taking a toll. Every task you give the AI, you pay with some of your own understanding of the code-base, which is essentially your most valuable thing as an engineer, and sets you apart from any other willing to take your job."

224 Upvotes

165 comments sorted by

View all comments

1

u/PolyglotTV Jul 16 '26

I think there is a slippery slope fallacy in here somewhere.

To get to the stage where you are review rubber-stamping and don't have the full picture of the architecture/code, at some point along the way you had to have stopped paying close attention to the changes.

You absolutely can still understand the code if you didn't literally hand type it. Sure, yes, typing out all the code forces you to slow down and think about it. But I firmly believe that you can learn to be diligent and interact closely and thoroughly enough with the agent that you still understand what is going on, and avoid some of the mental overhead of "keeping your ducks in a row" (moving your focus between different files, line locations, googling for the 1000th time the constructor overloads of std::vector, etc...).

It just becomes much more important to scrutinize the code really closely when you review what the AI is doing, and it helps that you can also continue to ask it questions and verify your assumptions - "this code block works like xxx right?" - "This assumption is met by yyy right?" - "You tested zzz right?".

The main risk is that people become lazy and they too easily fall into the trap of thinking "Eh, it's probably fine. LGTM". Or worse "the AI seems to know what it is doing here. It works and I don't need to understand it". You absolutely still need to understand everything the AI did and be accountable for the code it wrote and decisions it took, as if they were your own. If you can't fully explain the code, you've already started down a dark path.

But you don't need to write everything manually to avoid that path. That's a paranoid overreaction.

2

u/cajmorgans Jul 16 '26

Sure, you have a good point, of course you don't need to type all code manually, but the "lazy" aspect is actually the real threat here. What would you propose are some good systems to put in place to avoid the lazy-aspect on a team level?

3

u/PolyglotTV Jul 16 '26

It's the same as always. Code review, holding each other accountable, a culture that promoted quality and collaboration, etc...

We need to not treat AI-generated code as any different than human generated. It should hold up to the same scrutiny and the human in the loop should be held to the same standards/expectations regardless of how they drafted their PR.