Slopfluencer

Notes › Software development

Understanding unfamiliar code

Code comprehension is the work of building a mental model of a codebase, covering what its major parts are, how data moves between them and where a given behavior lives. Developers have always spent much of their time on it, especially when joining a project or debugging code someone else wrote. Tools for it range from documentation and search to "go to definition" in an editor and asking a colleague.

When a coding agent writes most of the code, the person responsible for it may never have read it, and the bottleneck in software work moves from writing code to understanding and checking it.[1] Several tools try to give a reader a lasting map of a codebase. I built three prototypes of my own (Zooming into a codebase you've never seen) and use none of them.

Background

Classic code-reading tools, such as search and call graphs, work at the level of text and symbols. They answer precise questions ("who calls this function?") well and broad ones ("how does billing work here?") poorly. Broad questions have usually been answered by people, through a senior engineer's whiteboard sketch or a design document that may be out of date.

Language models can answer broad questions directly, by reading files and summarizing them. That makes a chat with an agent the default comprehension tool in 2026, but a chat answer is linear and disappears into a transcript. It does not give the reader a map they can return to and explore.

Approaches

Several approaches try to provide such a map.

Semantic zooming presents code at several levels of abstraction, from a high-level summary to pseudocode to source, and lets the reader move between them. In a 26-person study, a pseudocode-based tool matched a leading coding agent on usability while giving participants much more sense of control over design decisions.[3]

Browsing by meaning groups a repository's files by topic, using statistical clustering of the words in each file and labels written by a model, so a reader can navigate by concept rather than by folder. Its author, the programmer Gabriella Gonzalez, built it as an argument against chat as the interface for this work. A chat answer buries the reader in prose at every step, makes them type out each question and wait, and leaves no easy way to judge whether the answer is accurate or complete.[4]

Generated explainers turn an agent's understanding into a document. One such skill has the agent write rich HTML pages or slide decks, built from reference templates and a shared library of styles, to explain a complex system. Its author described the aim as reducing his own "cognitive debt".[12]

Agent-led walkthroughs let the agent drive the person's own code editor (VS Code, for example), opening files and highlighting the lines it is explaining while it talks.[7] A related idea is a side panel that collects things the agent notices while it works, which I find very useful.[8]

Constraint-based generation attacks the problem from the other side. If generated code is guaranteed to type-check, there is less to verify. In type-constrained decoding, the program that runs the model blocks any next token that would make the code fail to type-check, so the model can only produce well-typed code. It more than halved compile errors in one study.[5]

My experiments

I want to explore an unfamiliar codebase like a zoomable map: major systems first, then their parts, then the source. I built three prototypes. The first drew a text outline of each function's control flow, tied to source lines; running a model over a whole repository was too slow and costly, and limiting it to single files lost the overview I wanted. The second turned an agent's work into written, audio or slide explainers; the formats changed, but none produced real understanding. The third was a small language for describing a codebase as clickable concepts; I stopped before finding out whether a model could generate it for a whole repository. I use none of them. The writeup in Zooming into a codebase you've never seen concludes that the problem is still open but better understood.[2]

I am also skeptical of comprehension features that have not been measured. Several harnesses advertise support for language servers, but I have seen no eval showing it helps agents.[6] The few evals I found gave mixed results, and none compared the same agent with and without a language server.[10]

My position

Understanding code is now the slow part of software work, and a chat transcript is the wrong form for it. I want a map I can return to, generated and kept current by an agent, with every claim tied to source lines. Until that exists, agent walkthroughs in an editor are the best tool I have.

The fear of not reading agent code is overstated. Outside engineering, most of a business has always judged software by its behavior rather than its source.[9] What matters is keeping control of the design ideas rather than every line, a point the Redis creator Salvatore Sanfilippo (antirez) has also made.[13] That puts the weight on tests and evals, and on code kept small and local (Complexity is the enemy).

History and timeline

  • Apr 2025: Mündler et al. show that type-constrained decoding more than halves compile errors.[5]
  • Oct 2025: Ba et al. publish their semantic zooming study.[3]
  • Feb 2026: I write that the bottleneck has moved from writing code to understanding it.[1] Gonzalez publishes a tool for browsing code by meaning.[4]
  • Jun 2026: I ask for evidence that language servers help coding agents and find none that isolates the effect.[6][10]
  • Jul 2026: I ask whether reading agent code builds trust or mainly teaches people to steer the agent.[11]
  • Aug 2026: I argue that most of a business never read the code anyway.[9]
  • Sep 2026: My three map prototypes are written up; I use none of them.[2]
  • Oct 2026: I start using agent-led walkthroughs in a shared editor.[7]

Criticism and counterpoints

Reading code may matter for reasons other than understanding it. Engineers who insist on reading every line may be building trust in the agent, or learning how to steer it toward the output they expect, and I am not sure which.[11] If it is the second, a better map of the code would not replace the habit.

Design documents and diagrams have always drifted out of date as the code changed, and an agent-generated map could drift just as fast unless it is regenerated on every change. Comprehension tools may also be a temporary need. If agents get reliable enough at answering questions on demand, a persistent map may matter less than a good question-answering loop.

Open questions

  • Should a code map be generated once, or kept current by an agent as the code changes?
  • Does code written for agents to maintain need to be readable by people at all?
  • Which comprehension aids measurably improve an agent's own work, as opposed to a person's?

See also

Change log

  • 2026-12-03: Enriched with a dated timeline, generated explainers, the case against chat for comprehension, and a counterpoint on why people read agent code.

Reading

References

  1. ^ FOBO, grief and bottlenecks (post, Feb 2026)
  2. ^ Zooming into a codebase you've never seen (experiment, Sep 2026)
  3. ^ Ba et al., Code Semantic Zooming
  4. ^ Gabriella Gonzalez, Browse code by meaning
  5. ^ Mündler et al., Type-Constrained Code Generation with Language Models
  6. ^ Is there evidence that language-server tools help coding agents? (@trashpandaemoji, Jun 2026), since deleted
    Is there any evidence that LSP tools enhance coding agents performance? A few harnesses hang their hat on this functionality but I haven't see an evals that show it improves the agent's ability to write code?
  7. ^ Agent-led code walkthroughs in a shared editor (@trashpandaemoji, Oct 2026)
  8. ^ A side panel for what the agent notices while reading code (@trashpandaemoji, Oct 2026)
  9. ^ The rest of the business never read the code anyway (@trashpandaemoji, Aug 2026), since deleted
    The way I see it, all non-engineering functions in a business didn't read the code. They inspected the output. Engineering has always been a black box to them. And just because you have human engineers working on the thing, doesn't mean its good or built the best way. Having high quality engineering in your product is more of an outlier than norm. Consider an enterprise with several levels of engineering capability pre-AI: - An enterprise with a high-paid in-house excellent engineering team - probably produces high quality code but expensive - An enterprise with a low-paid, okay but not great engineering team -- probably produces working but shit code, more affordable - An enterprise that contracts with a high quality external firm -- probably produces okay quality code, very expensive - An enterprise that contracts with a cheap and low quality external firm -- probably produces shit code, prices vary but probably expensive for what you get My point is that we've (as an industry) has been producing shit code that businesses don't read for ages.
  10. ^ LSP evals look mixed, and none isolate LSP versus no LSP (@trashpandaemoji, Jun 2026), since deleted
    @TheAI_Frontier I found a few evals out there but it seems like the utility is mixed? Or nobody has fully isolated LSP vs no LSP.
  11. ^ Does reading agent code build trust, or teach you to steer the agent? (@trashpandaemoji, Jul 2026), since deleted
    @jamonholmgren Yeah, I think you’re right. Do you think reading the code helps people gain more trust in the agent output or is it more them learning how to better manipulate the agent to produce outputs they expect? I get the sense that a lot of ICs, especially experts with lots of opinions…
  12. ^ Visual Explainer, a skill that explains complex things as rich HTML pages (@nicopreme, Jun 2026)
  13. ^ Control the ideas, not every line of code (@antirez, Jul 2026)