An X-ray for the code AI writes

AI writes the code. X-ray what you’re shipping.

Code an agent wrote is not a black box. visualdiff X-rays a pull request and draws what is inside: the architecture, the dependencies and the risk. See what changed, how it connects, and where your judgment is needed.

Start with a public pull request. No account required.

The feature looks right. Does the architecture?

A sample pull request written with an agent, X-rayed three ways: what was asked for, what the picture shows, and what to decide before merging.

acme/subscriptions-api #214Open in the sample reviewOpen
Blueprint · Changes · @ 0e91fb0 #214 feat(billing): usage-based billing with Meterly Layered service · Express · a composition root · middleware for cross-cutting concerns 31 modules · 19 packages · 8 routes · 5 outside systems · 12 findings · tests 20% of source Arch B 76 −20 Deps A 100 Config A 90 −10 Security A 100 Resil. B 86 Observ. A 93 Tests A 92 Build A 96 Maint. A 100 A 96 → 93 ▼ −3 c0dd2e9 → 0e91fb0 1 the wrong way 3 findings introduced +1 outside system +3 packages 7 changed +15 import paths 1 resolved Entry src/server.ts server Application shell Entry points: where the process starts. 1 package · 1 file Composition root Where the parts are assembled. 1 package · 1 file assembles 10 packages Interface Routes, controllers and handlers: how requests arrive. 5 packages · 7 files · 8 r… all under api/ Business Domain rules and services. 4 packages · 7 files ↻ 4 imports inside Cross-cutting Auth, middleware and logging, used across requests. 1 package · 3 files Infrastructure Databases, queues and clients for other systems. 5 packages · 8 files ↻ 3 imports inside Shared Utilities and types any layer may use. 1 package · 3 files Configuration Settings every layer may read. 1 package · 1 file Beyond the boundary What the code reaches: datastores by driver, services by config, SaaS… PostgreSQL database plans-catalog 2 callers Sentry monitoring Stripe payments api.meterly.io hard-coded host new a package, sized by lines of code routes it serves findings, coloured by the worst imports downward (colour of the layer they leave) imports the wrong way one request, followed added by the change changed removed imports cut from a run finding introduced finding resolved visualdiff.ai · blueprint Repository acme/subscriptions-api Revision c0dd2e9819eb → 0e91fb00010a Read sample Source JavaScript/TypeScript · src · 8 l… 7 imports from business 5 imports from business 5 imports from application shell 3 imports from interface 2 imports from application shell 2 imports from interface 1 import from application shell 1 import from interface 1 import from cross-cutting 1 import from cross-cutting 1 the wrong way, new (root)changed1 file · 29 lines1 wiringchanged1 file · 37 lines · ◇1 health1 file · 10 lines⇄ 1 plans1 file · 9 lines⇄ 1 subscriptions2 files · 35 lines⇄ 3 usagenew2 files · 33 lines⇄ 2 webhooks1 file · 13 lines⇄ 11 billingchanged1 file · 25 lines1 meteringnew2 files · 54 lines · ◇2 plans2 files · 26 lines · ◇1 subscriptions2 files · 55 lines · ◇2 middleware3 files · 27 lines2 adapters/meterlynew1 file · 13 lines · ↗2 adapters/plans-catalogchanged1 file · 13 lines · ↗ adapters/stripechanged2 files · 40 lines · ◇11 db1 file · 7 lines repositorieschanged3 files · 75 lines1 lib3 files · 20 lines configchanged1 file · 24 lines · ◇1 1 2 3 POST /usage/events
See what the agent added, and the shortcut you didn’t ask for: the dashed red line is an import from the Stripe adapter into a route, against the layer order.
  1. The request

    “Add usage-based billing.” Claude Code writes 1 of 2 commits on acme/subscriptions-api #214, 259 changed lines, and a person commits after it.

  2. The visual change

    3 new packages in the layers they belong to, api.meterly.io as a new outside system, and one import that crosses a layer boundary: infrastructure reaching up into interface.

  3. The review decision

    Investigate adapters/stripe → api/usage before merging. It runs against the layer order, so the gate you set fails the build on it; the design score drops from 96 to 93.

More code. The same human attention.

Another agent. Another pull request. Another set of changes your team needs to understand.

Generating software is only part of the job. Someone still has to decide whether the change belongs in the system, and whether it should ship. An agent’s pull request is not a black box; it only looks like one from the outside.

You don’t need a faster rubber stamp. You need to see inside the change.

See through the change. Understand the impact. Know where to look.

A pull request is a system change. Review it that way. Start with the architecture, not a wall of changed files: see the modules and connections being added, changed or removed, then investigate the findings that need your attention. Every row below comes from a sample X-ray, with the agent that wrote the change.

See how the system changes.

Compare the architecture before and after the change. Spot new modules, new outside systems and imports that break the layer rules your team set.

  • api/usagenewinterface · 2 files · 33 lines · 2 routes
  • meteringnewbusiness · 2 files · 54 lines
  • adapters/meterlynewinfrastructure · 1 file · 13 lines
  • api.meterly.ionew outside systemhard-coded host · reached by adapters/meterly
  • adapters/stripe → api/usagebuild failsan import the wrong way: infrastructure reaching up into interface
  • design score96 → 937 packages changed, 15 import paths added

Know what just entered your stack.

Each new or upgraded dependency, listed; npm and PyPI additions checked against the registry and the names they imitate; the vendor an SDK brings, named with what it receives.

Catch the surprises before they ship.

Changes beyond the stated intent, install scripts, secrets sent out, a redirected registry and instructions aimed at the next agent, checked in the files a skim would skip, lockfiles and minified files included.

  • acme/orders-api #482beyond the stated intent“feat(orders): add idempotency keys to order creation” also changes migrations, auth and infra. See the intent check
  • Criticalpackage.jsonInstall script wired to a malicious module. An install hook runs on every install, and this change also adds code that fetches remote code or exfiltrates data (src/telemetry.ts).
  • Criticaltelemetry.tsPossible data exfiltration. This file collects environment variables and sends them to webhook.site.
  • High.npmrcPackage registry redirected. Pointing installs at another registry is how a dependency-confusion or a poisoned-mirror attack lands.
  • HighCLAUDE.mdPrompt injection in an agent instruction file. Instruction files are read by coding agents as commands; hidden or imperative text here steers the agent against the reviewer.
  • Hightelemetry.tsOutbound to a data-sink host. webhook.site is a paste/webhook/tunnel/file-drop host — a place exfiltrated data is collected.
  • Mediumpackage.jsonnpm postinstall script added. An install hook runs automatically on npm install, before any code is reviewed or run deliberately.

What poisoned code looks like

Focus your review. Keep your judgment.

Get a prioritised reading plan that separates sensitive changes from routine edits, moves and formatting noise. Spend your attention deliberately, not evenly across every line.

In the fictional sample, 582 lines changed; the plan reads 65 closely, skims 190 and skips 327, with the reason on each line.

acme/orders-api #482582 changed lines, 15 files
54123

20 minutes instead of 127, by the plan’s estimate

acme/orders-api #482, feat(orders): add idempotency keys to order creation: a fictional pull request, not a measured result
Read
65 lines: a dropped column, SQL built from strings, a TLS bypass, deletion protection switched off.
Skim
190 lines of new but ordinary code, tests and config.
Skip
327 lines moved unchanged, reformatted, or lockfile and docs churn.

Less mental reconstruction. More engineering judgment.

What changed? What connects to it? Which boundary did it cross? What deserves a closer look? These should be the questions your review interface helps you answer, not questions you reconstruct from scattered files. The X-ray shows the system first; then you read the code with context.

Your architecture. Your rules. Even when an agent writes the code.

Define the boundaries your software should respect. Flag unexpected dependencies, circular imports and architectural regressions in CI, from a policy file that lives in your repository.

Give coding agents the constraints before they write. Give reviewers the evidence before they merge.

The architecture part of a .visualdiff.json
{
  "architecture": {
    "gates": {
      "wrongWay": "block",
      "newCycle": "block",
      "newBoundary": "warn",
      "gradeDrop": 8,
      "minGrade": "B"
    },
    "layers": [
      {
        "path": "src/clients/**",
        "layer": "infrastructure"
      },
      { "path": "src/jobs/**", "layer": "app" }
    ],
    "allow": [["infrastructure", "shared"]]
  }
}

One visual language. From plan to production.

Plan against the architecture you have. Give agents its constraints. Review the proposed changes. Check the rules in CI. Keep a design record with each release. Not another diagram to maintain: a shared view of the software you’re building, drawn from every build.

  1. Plan

    Start from the building as it is

    Every main-branch build publishes the as-built blueprint. A feature is planned against the real layers and outside systems, not last year’s diagram.

    --as-built → after.svg, blueprint.json

  2. Code

    Give the agent the rules before it writes

    agent-brief.md lists the layers, which way imports may point, and what the last run flagged. Put it in the agent’s instructions; it runs the CLI itself and fixes what it introduced before anyone reviews.

    agent-brief.md

  3. Build

    Fail the job on a design regression

    The CI step reads the shape of both revisions where the code already is. An import that runs the wrong way, a new package cycle or a grade drop fails the gates you set, and --fail-on hold exits 1.

    exit code, job summary

  4. Review

    Open the pull request on what moved

    The comment leads with the design delta: packages added, imports against the layer order, new outside systems, findings introduced and resolved, and the drawing one click away.

    PR comment, changes.svg

  5. Release

    Keep a design record per release

    Upload the blueprint with the build’s artifacts. Every tag keeps its drawing and its JSON, so “when did billing start calling Meterly?” has an answer.

    build artifact per tag

  6. Operate

    Know what the code reaches

    Beyond the boundary lists every datastore, SaaS, service and hard-coded host the code calls, and which packages call it: the inventory on-call, vendor review and ArchCanvas start from.

    boundary in blueprint.json

Connect the change to the cloud.

Add ArchCanvas to see the running resources matched to your code changes. A Terraform block, a Kubernetes manifest, an env var or a hostname in the change becomes the resource it names, with its neighbours one and two hops away, and the change opens on the live map.

  1. infra/terraform/rds.tforders-dbdb.sql
  2. src/orders/idempotency.tsorders-apicontainer.service
24 more resources within two hops, from the sample map of a fictional production account.

Two ways to use it

Run a workspace that reviews every pull request across your repositories, or add one step to the pipeline you already have and keep everything inside your code host.

Sign up and connect your code host

Create a workspace, connect GitHub, GitLab, Bitbucket, Azure DevOps or Gitea with a token, and add one webhook. Every push is reviewed, posted back to the pull request and kept in your inbox.

  • An inbox of reviews with shareable report pages
  • A weekly sanity index per repository
  • ArchCanvas, Slack and your review policy in one place
Set up a workspace

Use it inside your code host

Add one CI step. The review runs in GitHub Actions, GitLab CI, Bitbucket Pipelines or Azure Pipelines and answers in the pull request. No account needed.

  • A comment edited in place, a status check and a job summary
  • Block merges on a hold with --fail-on hold
  • Policy read from .visualdiff.json at the base branch
Add it to your pipeline

Compare the two

Developer scorecards built from the code, not the activity

The same stored reviews become a scorecard for every developer: what their work achieved, how well made it is, and what to work on next, weighed the way your team decides. No host is called to read any of it, nobody is ranked, and nobody is shown as last.

Handiwork scorecards

A scorecard per developer. Outcome weighs each piece of work by what it did, who the repository serves, how complex it is and how well made it stands. A quality score reads pull requests, commit craft and the health of the code they work in, and a work-to-do list names what to fix next, file and line. Trunk-based teams get it too: commits are graded by the repository reviews that read them.

Scorecards engineers trust · Scoring what your culture values · Improvement plans

Awards

Winners by month, quarter and year in nine categories, outcome first, with runners-up; badges in bronze, silver and gold for volume, craft, complexity, languages, rhythm and style; the team’s feats and the workspace’s milestones. Says vs does reads each commit message against its own diff.

Celebrating without a leaderboard

Dependencies

Every package a repository pins, read from its last review and checked against the open advisory database after each review and on demand. Alerts open, close when the version moves on and reach Slack or a webhook. One click opens the update pull request on GitHub, GitLab or Gitea, automatically for the repositories you choose, and it is reviewed like any other change.

Patched without a bot army · Compared with Dependabot · with Renovate

What a skim misses

Deterministic checks over the diff, the repository and your infrastructure. Every finding names a file, points at a line where there is one, says why it matters, and links to the sample where you can see it.

A review plan that fits your attention

Every hunk is sorted into read, skim or skip against a time budget you set. Code moved between files unchanged, formatter churn, lockfiles and generated files go to skip, with the reason on each line.

Read 65 lines in 20 minutes. Skim 190. Skip 327: moved, reformatted, lockfile or docs.
Intent drift

The description says what the change is for. visualdiff checks the code against it and names the areas nobody mentioned.

“Add idempotency keys” also changes auth, a migration and Terraform.
Hallucinated and squatted packages

Agents import packages that were never published, or one letter away from a real one. New dependencies are checked against npm and PyPI and against the names they imitate.

“reqeusts” is not “requests”, and PyPI has never heard of it.
Where your data goes

Every host a change reaches is listed and classified, and the lines that read secrets are joined to the lines that send them. Request bins, tunnels, raw IPs and unknown domains stand out.

Reads every environment variable, encodes it, and POSTs it to webhook.site.
Poisoned installs and instructions

Install scripts, registry redirects, lockfile tampering, pipeline changes and hidden instructions to coding agents are flagged, including in the files the plan would skip.

A hidden comment in CLAUDE.md tells agents to auto-approve telemetry.ts.
New outside vendors

A new SDK, API key or tracking script means a new company your data reaches. Each one is named with what it typically receives, ready for a vendor review.

Adds PostHog (analytics): user events, optionally session recordings.
Déjà vu

New helpers that already exist under another name, and bodies copied from elsewhere in the change.

formatCents is written again in receipt.ts; format.ts already has it.
Who, or what, wrote it

Commit trailers, bot identities, branch names and descriptions reveal Claude Code, Copilot, Cursor, Devin, Codex and a dozen more. Policy can be stricter for agent-written changes.

3 of 3 commits by Claude Code, no human commit after the last one.
Reach into production

Terraform, Kubernetes, env vars and hostnames are matched against your live ArchCanvas map, so the reviewer sees the database behind the diff and what sits two hops away.

Touches orders-db (deletion protection off) and orders-api; 24 resources nearby.
The design, before and after

The whole codebase drawn as layers from facts your build reads, with the change painted over it. An adapter that imports a route, a new package cycle or a new outside system fails the architecture gates you set, at build time.

The Stripe adapter now imports a route: wrong way, build fails. Grade 98 → 94.
A map of the change

Changed files laid out by architectural layer, with the imports added and removed between them and everything that depends on them faded in behind.

15 files across 6 layers, with every import added or removed between them.

Wherever your pull requests live

Fetch any pull request by its link, review every push through a webhook, or run the CLI in any CI. Marketplace apps for each host are on the roadmap.

All integrations and marketplace plans

Six pull requests, X-rayed

Fictional repositories, real X-rays: each sample runs through the same engine as your pull requests every time the page builds.

Evidence you can inspect. Rules you control.

Findings point to source lines. Review policy lives in your repository. Deterministic checks drive the verdict.

Findings point to source lines

Every finding names a file, points at a line where there is one, and says why it matters. Risk, the plan and the verdict come from rules you can read, so the same change gets the same review.

Review policy lives in your repository

.visualdiff.json on the default branch sets size limits, protected paths, which findings block and the architecture gates. It is read from the base revision, so a pull request cannot loosen its own rules.

What leaves your environment, exactly

visualdiff receives the diff and the changed files it needs to review. The blueprint step sends facts about the build, never source. If you switch the optional model on, it writes the summary from counts, paths and finding titles, never code, and it cannot set the verdict. visualdiff can only comment and set a status: it cannot push, merge or change a setting.

visualdiff informs the decision. Your team owns it.

Before you merge, see inside the change.

Bring your next pull request into visualdiff. The X-ray shows the system first, so you can focus on the code that needs you.