Visualizing Call Graphs to Understand Agent-Generated Code
Call graphs show how an agent's forty-file changes connect.
Sponsored by Graphide

An interactive codebase graph for AI agent steering makes call relationships navigable, so developers can direct changes against the system’s structure. Visualizing call graphs reveals what an agent built across a forty-file session, including new dependencies, changed execution paths, and crossed boundaries. The effective workflow connects that map to architectural specifications and CI constraints, rather than treating visualization as a substitute for code review.
Why a forty-file agent session breaks line-by-line review
A forty-file agent session asks the reviewer to reconstruct a system from fragments. Each diff hunk shows an edit in one place, but its effect on the architecture may depend on changes in other files. A function can look reasonable in isolation yet introduce a dependency that crosses an intended boundary. The review burden is therefore not just reading volume. It is the work of remembering relationships while moving through a linear presentation that does not show them.
Konrad et al. (2026) document how agents such as Claude Code, Devin, and Codex select frameworks, choose databases, and wire integrations in seconds. These are architectural decisions, yet almost no one reviews them as such. The agent’s decision surface spans software architecture, while the reviewer’s view remains a sequence of additions and deletions. Even a careful reading of those additions may leave it unclear how they fit together.
Park et al. (2026) describe agent supervision as a connected process of tracking file changes, inspecting code, and evaluating output across stages. Supervision extends beyond the final review moment. A diff remains useful for examining an implementation, but it does not directly show which functions now depend on which, which paths are new, or which boundaries a change crosses. When those questions require a reviewer to mentally assemble forty files, the diff is no longer a sufficient unit of understanding.
What a call graph actually shows that a diff cannot
A call graph represents functions as nodes and calls between them as directed edges. It shows who calls what, how deep a call chain runs, and where that chain crosses module boundaries. Its basic unit is a relationship. Where a diff identifies textual changes, a graph exposes the system’s current call structure, and comparison with an earlier graph reveals how that structure changed.
That distinction makes coupling visible at the level where developers need to evaluate it. A call between previously unconnected modules appears as a new edge, rather than an added line whose significance depends on remembering both modules’ roles. Traversal then lets a developer follow a chain from an entry point through service boundaries to data access. The reviewer can follow the path of a call instead of switching between files to reconstruct it.
This is particularly useful when generated code has changed several parts of the same path. A graph brings those relationships into one navigable record, making the structure easier to inspect without implying that every edge is acceptable. Whether a dependency belongs still depends on how the system was meant to be built.
Static call graphs also have limits. They can miss dynamic dispatch, reflection, and cross-service calls, so an absent edge is not proof that a relationship does not exist. Nevertheless, an incomplete map of relationships can be more navigable than a complete list of changed lines. The purpose is structural legibility.
How agents make implicit architectural decisions that only the call graph surfaces
Konrad and colleagues anchor this problem in a case study where the same task, described with different prompt wording, produces structurally different systems. They call the relationship “prompt-architecture coupling” and describe architecture shaped this way as “vibe architecting”. Wording can influence decisions a team would ordinarily treat as deliberate design choices.
A description may explain what functionality was added without making a new external-tool dependency, sub-agent orchestration path, or retrieval hop explicit. Where those relationships are captured, the graph exposes them as call edges. The design choice becomes inspectable as a dependency. That gives the reviewer something concrete to compare with the intended structure rather than accepting the agent’s account of its work.
The same study identifies MCP and AGENTS.md conventions as a de facto integration architecture. These conventions are not merely ways to communicate instructions. They can embed structural commitments at the prompt level that a team may not recognize as architectural decisions. Reviewing the resulting call relationships makes those commitments easier to identify, subject to the graph’s coverage of external and dynamic interactions.
Without that map, recovering the decision means reading across changed files and reconstructing their relationships mentally. That is possible for a small change. At agent speed, however, the reconstruction competes with all the other implementation checks a reviewer must perform. The call graph externalizes that work so architectural judgment can begin with the relationships already in view.
Why agent-generated code accumulates structural debt that isn't visible until it compounds
The risk extends beyond the session that introduced a dependency. Konrad and colleagues cite work showing that LLM-generated code can appear modular while violating deeper modularity principles. A codebase can look neatly divided even though its call relationships tie those parts together, so later work depends on assumptions that no one has reviewed explicitly.
Sawada et al. (2026) examine more than a thousand files and thousands of commits from a hundred popular repositories. They find that AI-generated files receive significantly less maintenance than human-authored code, and that human developers perform the large majority of the maintenance that does occur. Feature extension is the most frequent modification.
Those findings do not establish whether individual repositories reviewed call graphs. When new features are added without checking the dependencies beneath them, each one can inherit the assumptions that shaped the original structure. A call that was handy in one place can then become a relationship that later work relies on, making it harder to change without disrupting that work.
Prior work cited in the maintenance study reports a measurable long-term rise in static analysis warnings and code complexity from agentic coding, including a 30% rise in warnings in one study. These effects of agentic coding occur later in the codebase and may have no obvious signs in the original diff. There is a chance to act early, before later work is built on those assumptions. Call graph review at merge time targets that point, when a new dependency can still be evaluated as part of the change that introduced it.
How do developers visually navigate codebases while directing AI agents through the structure?
Effective graph review starts from the system’s new shape. The reviewer examines which call edges are new and which functions now depend on modules they did not use before. Attention then turns to whether those edges cross prohibited module or layer boundaries. Call depth provides another line of inquiry. A deeper path into a component needs a closer look when it increases coupling, even if each added call looks ordinary on its own.
Cycles and orphaned paths require a different kind of inspection. The reviewer looks for new mutual dependencies and for generated functions that nothing calls, while remembering the limits of static analysis. The graph identifies where closer reading is needed, and the diff supplies the implementation detail needed to assess the code at those points.
Park and colleagues describe the “Monitor” stage as watching commands and file changes and checking intermediate outputs as they appear. A graph gives that monitoring stage a structural artifact. Their study also finds that experienced developers concentrate effort in planning and turn recurring guidance into reusable assets. A graph of the intended architecture, kept in the repository, makes that approach concrete by supplying a model against which generated changes can be inspected.
Vaelor and codegraph illustrate the emerging tooling direction without establishing a vendor ranking. Vaelor is a self-hosted MCP server with a persistent call graph over any repo. codegraph is local-first and backed by an embedded relational database, with incremental indexing, call graph traversal, and impact analysis. The distinction is operational as well as visual. For a map that stays useful as an agent writes, persistence and incremental updates support continuity, while traversal and impact analysis support inspection beyond the changed file list.
How architecture specification format shapes what the call graph will look like before the agent writes a line
Graph review is more focused when the intended boundaries are clear before the agent writes code. Canedo (2026) tests five specification formats with six models in ninety multi-turn agent trials. The formats are informal prose, Mermaid diagrams with constraints and ADRs, OpenAPI, C4/Structurizr DSL, and TypeScript interface contracts with architecture-testing rules. The experiment finds a strong format-by-model interaction. Specification format does not have a uniform effect across models, so its value cannot be reduced to a universal preference for diagrams or prose.
Code-proximate formats, including OpenAPI and TypeScript contracts, recover most of the capability gap on weaker models in the experiment. TypeScript contracts tripled API route coverage for the weakest model tested. That result establishes gains in coverage alone. It nevertheless shows that the representation of intent can substantially affect what an agent produces, even when the specification formats communicate equivalent information.
The practical implication is to state module boundaries and dependency rules in a machine-parseable format before running the agent. This constrains the intended call structure rather than leaving it entirely to inference from prose. It does not guarantee obedience. Instead, it gives the subsequent review a sharper basis for distinguishing permitted relationships from violations, reducing the structural ambiguity the reviewer must resolve.
A structural specification guides what the agent builds, the resulting graph shows whether the relationships it captures follow that specification, and any violations found help tighten the constraints for the next session. Prose-only guidance leaves more of that structure implicit, creating room for the prompt-driven architectural variation identified by Konrad and colleagues. Graph inspection therefore serves both as a check on generated code and as feedback about where architectural intent needs a more precise expression.

Why CI enforcement of call graph constraints is the necessary backstop when human review cannot keep pace
A person reviewing the graph can find a problem in the current change, but future changes may not get the same care. Park and colleagues find that developers manage supervisory demand by delegating supervisory work to other agents and converting recurring guidance into reusable assets. Automated structural checks put that approach to work at merge time. A decision about architecture that reviewers have to make again and again becomes a written rule, so they no longer have to remember another instruction.
Architecture tests check properties of the structure and design in a deterministic way. With merge enforcement configured, a rule violation exits non-zero and blocks the merge, unlike probabilistic agent-on-agent review. The rules to use come straight from reviewing the graph. They can prohibit new cross-layer call edges, new dependency cycles, calls from specified boundary modules into internals, and orphaned entry points. The check’s scope must still be understood in terms of the relationships the analysis captures.
Canedo demonstrates that automated static constraint checking covers a substantial portion of architecture compliance and complements LLM-as-judge scoring. The checker catches violations the judge misses, and the reverse is also true. Neither alone is sufficient for complete assessment. Static checks nevertheless provide a reliable minimum for encoded rules, while human review remains responsible for design questions those rules do not settle.
Dente, Satriani, and Papotti (COLM 2026) find that imposing Clean Architecture cost 9.1 percentage points in assertion pass rate. That result argues against treating repeated prompt instructions as sufficient enforcement. Architectural constraints need to be preserved in CI, where a service such as Graphide CI, which runs a team's existing GitHub Actions jobs on faster runners with warm caches, splitting long test steps only where a check shows every result stays the same, so the same pass or fail verdict arrives with less waiting, can cut the wait those checks add to each agent push. A graph used this way is not just a reading aid. It becomes the basis for persistent, testable boundaries on what agent-generated code may introduce.


