See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
Two mechanisms, routinely confused
In the agent path, a coding assistant like Claude Code or Cursor reads the repository on your machine, decides what the architecture is, and calls tools to draw it. The reading is a language model reading files, so it is fast, flexible, and capable of being wrong in confident ways.
In the sync path, a parser reads declared structure from the repository and rebuilds the diagram from it on a schedule. It cannot invent a service, because it only draws what a file declares. It also cannot understand anything that is not declared.
The distinction matters for one practical reason. The agent draws when you ask. The parser draws when the branch changes. If you only run the first, the diagram is exactly as current as your last session with an agent.
The agent path: it already read the code, the problem is the output
Ask any model for a diagram and it hands back Mermaid or PlantUML. That output is text the model never sees rendered, so overlap, grouping, and layout are guesses. Past a dozen boxes it produces something a human has to redraw before showing anyone.
Connecting a diagram tool over MCP changes the shape of the work. The agent stops writing a picture in one shot and starts operating a canvas: adding nodes, connecting them, grouping into zones, running a layout, then measuring and validating the result. The Datadef MCP server exposes 36 tools for exactly this, 9 whole-diagram tools such as create_diagram and export_diagram plus 27 canvas tools for the fine work, and a design guide the agent should read before its first call.
What leaves your machine is the structure the agent decided to draw: node names, zones, edges, column names where you asked for lineage. The source is never requested, because no tool accepts it.
> Read this repo and diagram how our data flows. ⏺ Read - dbt_project.yml, models/staging/*.sql (14 files) ⏺ Read - terraform/kinesis.tf, terraform/redshift.tf ⏺ get_design_guide - zone and edge rules ⏺ create_diagram - "Order Analytics Platform" ⏺ canvas_add_nodes - 4 zones, 16 nodes ⏺ canvas_connect_nodes - 11 labelled edges ⏺ canvas_layout_canvas - layered ⏺ canvas_validate_canvas - no orphans, no overlaps ⏺ export_diagram - png
The sync path: nothing guesses what exists
Connect the repository read-only from GitHub, GitLab, or Azure DevOps, pick a branch or tag, and the diagram plus an architecture doc regenerate daily. For Terraform repositories every .tf and .tfvars file is parsed directly: no init, no state file, no cloud credentials. Modules become zones, registry module calls keep their source and version, and per-environment counts come from the tfvars rather than from a guess.
The parse also declines to draw things, which is what makes it useful rather than exhaustive. Every resource type carries a weight in the parser catalog: major becomes a box, minor rolls up into a counted node when there is no room, and glue is counted but never drawn. IAM roles, policy attachments, log groups, and metric alarms are glue, as is every resource from the random, null, local, time, tls, archive, template, external and terraform providers. That is why a repository holding more identity objects than real resources still produces a diagram of the resources.
Two properties make this the half that survives contact with a real team. Node identity is derived from the declared address, so a re-sync updates the picture instead of reshuffling it, and hand-moved nodes keep their positions. And a commit whose parsed structure hashes to the same value as the previous one skips generation entirely, so a documentation-only commit costs nothing and produces no new version.
The two paths meet at the same canvas. An agent can check freshness with repo_status and trigger a sync with repo_refresh, so the session that changed the infrastructure can also bring the picture forward. See how repository sync works.
What neither path can do
Neither reads runtime. Which path carries the traffic, what is deployed but deprecated, which queue is actually empty, none of that is in the source or in a parse of it. Neither knows intent either: why the boundary is where it is, what the team plans to retire, which system is owned by another department.
That is not an argument against generating the diagram. It is an argument for treating the generated version as the accurate base layer and adding the human layer on top: zone labels that name the domain, notes on the deprecated path, an annotation where the manual step lives. More on the boundary in what an agent can infer from code.
A quick way to test either path
FAQ
Can an AI agent really produce a usable architecture diagram from a codebase?
Does the diagram tool need a copy of my source code?
Which is more accurate, the agent or the repository parse?
Will the diagram stay up to date on its own?
How long does the first generation take?