Smartypants

For Claude Code, Codex, Pi, Muse Code, and Grok Build

A live architecture diagram of the code your agent writes.

Smartypants listens to the conversation and the working tree. It draws the system the way a staff engineer would on a whiteboard, remembers what you intended, and tells you the moment the code leaves it.

Click any box, arrow, boundary, or layer to read about it. Drag boxes, frames, and layers. Double-click a box to go deeper. Scroll to zoom.

How it reads

One convention everywhere, so every diagram reads the same way.

  1. Users and clientswho starts the journey
  2. EdgeCDN, WAF, load balancer, ingress, gateway
  3. Frontendabove the API it calls
  4. APIpublic APIs and backends-for-frontends
  5. Servicesdomain logic; third parties at the right edge
  6. Asyncstreams on the left, then their workers
  7. Datacaches beside the databases they front
  8. Storageobjects, files, and archives at the bottom

Top to bottom is the stack, from who calls to where data rests.

Left to right is the journey inside a layer, as long as it needs to be.

Dashed frames are network and trust boundaries — public internet, edge, cluster namespaces, private subnets — taken from your Kubernetes, Helm, compose, and Terraform files.

Every box has a plain name and a one-line description. Click it for what, why, deep-dive notes, flows, drift, and the intent recorded about it.

Arrows point the way data moves; a reply is its own arrow back to the caller. Solid is data, dashed is control.

What it does

Catches up from code

Turn it on in an existing repo and it builds the whole diagram in the background: services, dependencies, routes, tables, topics, then the compose, Kubernetes, Helm, and Terraform that wire them, including ingress, network policies, namespaces, and subnets.

Reviews every turn

When the agent finishes a turn, it looks at what actually changed in git — dirty files, new commits, untracked files — and asks one batched question per file. Code that leaves the design is flagged in red; new services and infra changes redraw the diagram.

Knows evolution from drift

If you change a decision in chat, the design evolves and the old choice is remembered as excluded. If the code contradicts a decision, constraint, or boundary, that is drift.

Goes deeper on request

“Go deeper on the aggregator”, a double-click, or smartypants deeper expands a system into components, a component into modules, and a module into the data model, algorithm, and failure notes an interviewer would ask about.

Remembers intent in a few hundred tokens

IntentCode keeps what you meant as keyed atoms — N redirect.latency p99<50ms, D link-store dynamodb>cassandra — grouped by part, never a transcript. A whole design interview fits in about 200 tokens.

Cheap by design

Two models, two jobs: Jev selects, Claude writes. A free local pass drops noise, Typesafe Jev decides in about 200 ms what a turn is worth and which part it touches, and Claude, through your own Claude Code sign-in, writes the diagram update or drift note only when there is work. Greetings, “run the tests”, and doc edits cost nothing, and your agent never waits.

Install

In a project

npm install -D @logan-robbins/smartypants
npx smartypants init        # hooks, config, and catch-up if code exists
# Claude writes the diagram through your Claude Code sign-in: no key needed
export TYPESAFE_API_KEY=... # optional: Jev picks in ~200 ms (console.typesafe.ai/keys)
npx smartypants serve       # open the printed URL

As a plugin

# Claude Code
/plugin marketplace add logan-robbins/smartypants
/plugin install smartypants@smartypants

# Codex
codex plugin marketplace add logan-robbins/smartypants
codex plugin add smartypants@smartypants

# Pi
pi install git:github.com/logan-robbins/smartypants

Commands: deeper, catchup, review, intent, drift, mermaid, stats, reset. Everything is inert without smartypants.config.json.

Measured, not promised

Live runs: Typesafe Jev selecting and Claude writing, on labeled agent changes to a real repo and held-out design turns.

Jev + ClaudeClaude alone
End-of-turn drift review, 22 labeled turns22/22, none missed, no false alarms, 7.3 s22/22, 9.7 s
“Worth remembering?” on held-out turnsnone worth keeping dropped34/34 (local rules alone: 23/34)
Per-turn decision~0.2 s, a fraction of a cent~2.9 s, ~1.5¢
Catch-up of an existing reporeal service names, flows, and network boundaries from code plus compose, k8s, Helm, Terraform; 36–115 s and about a cent on 10 open-source repos

Details and raw runs: results/.