All Articles

Nobody Understands Our AI-Written Code: Where the 'Why' Went

Two Hacker News threads in one week said the same thing: teams can read their AI-written code but cannot say why it is that way. Where the reasoning goes when an agent writes the change, why review becomes the bottleneck, and how to capture and retrieve the why.

Nobody Understands Our AI-Written Code: Where the 'Why' Went

Key Takeaways

• When an agent writes a change, the reasoning lives in a chat session that ends when the pull request opens. The diff survives; the decision does not.

• Review is where this shows up first. By September 2026, more than 40% of GitHub pull requests started with an agent's first draft, and median PR size rose from 44 to 72 lines in a year (GitHub Octoverse, 2026; DX, 2026).

• Reviewers and the next agent both need the same missing piece: what was intended, what was ruled out, and who decided.

• The fix has two halves. Write the why down at merge time (PR description, linked ticket, decision thread, ADR for the big calls), then make it findable at the moment someone asks.

• A context engine handles the second half by pulling those records together, with sources, inside the tools people and agents already use.

A Hacker News commenter described inheriting a project from a colleague who had just left. The colleague admitted he had not written code by hand for months, and his handover advice was to "ask Claude." That scene sums up the complaint about AI-written code. The code is there and anyone can read it line by line, but the reasons behind it were never written down anywhere a person or the next agent can find them. Unblocked is a context engine built for that gap: it reads your pull requests, linked tickets, Slack threads and docs, and when someone asks why a piece of code exists, it answers with links to the discussion that decided it.

The comment sat under a thread titled A year after the 100% AI mandate nobody understands our code (Hacker News), posted November 9. A day later came AI usage generates a fragile codebase. When we checked on November 15, the first had 162 points and 200 comments and the second 645 points and 626 comments. This post covers what the threads got right, where the "why" goes, and what to change starting with your next pull request.

Why are teams saying nobody understands their AI-written code?#

Because the people who used to hold the reasons are no longer in the loop that produces the code. Evan X. Merz's November 7 essay, the one behind the 645-point thread, lists shallow tests, overly complex code, reviews that cannot keep pace, and falling human understanding. His sharpest line: "The longer a company relies on AI agents to generate the code, the fewer developers are going to understand the codebase." He ties that to slower incident recovery.

The 162-point thread linked to a Reddit post on r/ClaudeCode. Several Hacker News commenters said the post itself read as AI-generated, and others disputed the detector they used, so treat the story as a prompt for discussion rather than a verified account. The replies are the useful part. One commenter agreed that many people don't understand most of the code at their company. "At least until last year somebody did," they added. Another, on a team that had barely written code by hand for a year, said "we only know what we have talked about with LLM," and several other replies described something similar.

Where does the "why" go when an agent writes the code?#

It stays in the session. When a person writes a change, the reasoning spreads around as a side effect. There is a question in Slack, a comment on the ticket, a reviewer who asks "why not use the existing client?" When an agent writes the change, most of that reasoning happens in a private conversation. For example, the engineer explains the constraint, the agent proposes two approaches, the engineer rejects one because of last quarter's outage, and the agent writes the other. Then the pull request opens with a diff and a summary of what changed.

Decision context is the record of why a change was made: the problem, the options considered, the ones ruled out and who made the call. Google's public review guide asks authors to describe "decisions you made that aren't reflected in the source code," because "Reading source code may reveal what the software is doing but it may not reveal why it exists" (Google engineering practices). Agent sessions produce plenty of decision context, and almost none of it reaches the places future readers search.

PRs are ridiculous sizes since adopting AI coding tools and people cannot review them. What do teams do?#

They shrink the unit of review, put an automated first pass in front of people, and fix what the reviewer is missing, which is usually intent. The volume is real. DX studied more than 400 companies. Its methodology pairs self-reported AI use with PR telemetry, and it found median PR size "nearly doubled, growing from 44 lines to 72 lines per pull request between July 2025 and June 2026" (DX, June 2026). GitHub reports that by September 2026, "more than 40% of pull requests on GitHub started with an agent's first draft, up from 17% in March" (GitHub Octoverse, October 2026).

Splitting helps. GitHub's stacked pull requests give "a set of smaller pull requests," and "teammates can review and approve each layer independently." Our answer on reviewing oversized AI pull requests covers size limits and risk routing in detail. Smaller diffs still leave the reviewer guessing at intent.

Why can't reviewers just read the diff more carefully?#

A reviewer can check that code does what it says. They cannot check that it does what was intended without knowing the intent. Merz puts the pace problem bluntly: "AI moves too quickly for human developers to maintain a high quality bar." The Stack Overflow 2026 survey shows the other side. It reports that "48% indicate they trust AI when they can easily validate the answers" (Stack Overflow Developer Survey 2026). Validation needs a reference point. For a code change, the reference point is the decision behind it.

Anthropic's January report on agentic coding found developers use AI in roughly 60% of their work but can "fully delegate" only 0 to 20% of tasks. It names "scaling human-agent oversight through AI-automated review" as a priority for 2026 (Claude blog). Oversight at that scale only works when the reviewer, human or automated, can see why the change exists. Without that, review turns into a style check on code nobody can judge.

Coding agents hallucinate about our codebase because they don't know our history, what fixes that?#

Giving them the history at the moment they work. The next agent to touch the code has the same blind spot as the reviewer. It reads the files, sees a strange retry loop or an unused flag, and "cleans it up," undoing a fix someone worked hard to find. A January 2026 study of about 33,000 agent-written pull requests found that unmerged ones tend to be larger and touch more files. Its review of 600 rejected PRs lists causes such as duplicate PRs, unwanted features and agent misalignment (Ehsani et al., arXiv 2601.15195). Each of those is a history problem. The agent did not know the work existed, was rejected, or was meant to be different.

The fix is retrieval. When the agent plans a change, it asks for the PRs, tickets and threads that shaped that code. Our answer on why coding agents hallucinate without codebase history walks through the mechanics, and what your coding agent can't see lists the kinds of knowledge that never make it into the repo.

What should a team write down, and where?#

Write each decision once, in the place people already look for that kind of change, at the moment it is made. The cheapest move is to have the agent draft the PR description from its own session before the session ends, then have the engineer correct it. The examples in the table below are made up, to show what each entry looks like.

DecisionWhere it belongsWho writes itExample
Why this change, and what was ruled outPR descriptionAgent drafts, engineer edits"Kept the old retry client; the new one drops idempotency keys"
What the work is forLinked ticketWhoever files the workTicket links the customer report and the acceptance test
A call made in conversationSlack or Teams thread, linked from the PRWhoever decided"Agreed in #payments: no schema change until the migration lands"
A choice that shapes many future changesADR in the repoOwning team"Use event sourcing for ledger writes"
A surprising line that must not be "cleaned up"Code comment pointing to the PRAuthor"See PR 4812 before removing this sleep"

An architectural decision record (ADR) is a short document that "captures a single AD and its rationale," where an AD is "a justified design choice that addresses a functional or non-functional requirement that is architecturally significant" (adr.github.io). Keep ADRs for the big calls, such as a data model or a service boundary. Google's guide adds a warning that matters here: links in a description "may not be visible to future readers due to access restrictions or retention policies," so put enough of the reasoning in the PR itself.

Engineering knowledge platform that answers "why was this built this way" from code, PRs and Slack#

The other half of the fix is finding the why when someone asks, months later, in the middle of a change. A context engine is a system that gathers an organization's code, pull requests, tickets, docs and chat, works out which pieces answer a question, and returns the answer with its sources. Unblocked is one example. Its context_research tool "runs a multi-source research query across code, pull requests, documentation, issues, and messaging" and returns a synthesized answer plus the records behind it (Unblocked docs).

Agents in Claude Code, Cursor, Codex, Windsurf and GitHub Copilot in VS Code or JetBrains call it over MCP before they change code. Reviewers can mention @unblocked on a pull request to ask about "the intent behind the changes" or have it update the PR description to the repo's template (PR Chat docs). With Data Shield on, answers respect each source's permissions; it is set per source, off by default, and always on for Slack. We went deeper on the "second codebase" of decisions in why was this built this way.

I'm the only architect at Subsplash, supporting dozens of engineers and over a thousand actively maintained repos. When people ask me questions, I don't want to leave them waiting. Unblocked is how our team closes that gap.

Ben Johnson — Software Architect, Subsplash

AI-written code puts most teams in that spot: one or two people who remember why.

Frequently asked questions#

Is AI-written code harder to maintain than code people write?#

Not by nature. The Hacker News threads were full of engineers on both sides, including one who said six months of AI-assisted work had not introduced a single production bug. What changes is the record around the code. When the reasoning stays in an agent session, maintainers inherit the result without the decision, and that is what makes a codebase feel fragile. We looked at the productivity side of this in the AI productivity paradox.

Can the agent write the PR description itself?#

Yes, and it should, because it has the session in front of it. Ask it to state the problem, the options it considered, the one it rejected and why. Then have the engineer fix anything wrong.

How do we decide which AI pull requests still need a human reviewer?#

Route them by risk. Unblocked's risk assessment scores each PR against policies in a repo file and can optionally approve low-risk PRs that pass review. Our answer on risk-assessing pull requests covers how teams set those policies, and cost per merged PR shows what rework on unreviewable changes costs.

What if the why was never written down at all?#

Then the best remaining sources are the review comments, ticket history and chat threads around the change, which is where a context engine searches. For agents that run with nobody watching, see context for background coding agents, and for the category itself, what is a context engine.

Start with the next PR#

On the next pull request an agent writes, ask it to put the why in the description: the problem, what it ruled out, and the ticket or thread where the decision was made. Link that thread. If the change sets a pattern, write a five-line ADR. Then check whether the next person, or the next agent, can find that reasoning without asking you. If they can't, that is the gap to close, and it is the gap Unblocked was built to fill by bringing code, discussions, tickets and docs into one answer.