Four levels, one page
System context, containers, components, code. Boxes open in place, arrows reattach to whatever is visible, and a selection keeps only what it connects to bright.
c4-model-agentic-plugin is a github.com/caviri project A Claude Code plugin that reads any repository It writes an interactive C4 map, from system context down to code Plus a slide deck that explains it to the next developer And user stories your team can draw and talk over Every box points to a file Built on Simon Brown’s C4 model Open source · Apache-2.0
A Claude Code plugin · C4 model
One command explores your repository and writes an interactive architecture map you can open from the system down to the code, a slide deck that explains it, and user stories your team can mark up. Every box points to a file.
Install the Claude Code plugin c4-model-agentic-plugin for me. Read https://raw.githubusercontent.com/caviri/c4-model-agentic-plugin/main/INSTALL.md and follow its "Steps for the agent" section exactly.
Paste it into Claude Code. It runs the install, checks Python, Node.js and Chrome, and tells you how to start.
›/plugin marketplace add caviri/c4-model-agentic-plugin ›/plugin install c4-model-agentic-plugin@c4-model-agentic-plugin
Type them in Claude Code. Then, in the project to explain: /c4-model-agentic-plugin:explain-project
$claude plugin marketplace add caviri/c4-model-agentic-plugin $claude plugin install c4-model-agentic-plugin@c4-model-agentic-plugin
From any shell with the Claude Code CLI. The plugin loads in your next session.
$claude plugin marketplace add caviri/c4-model-agentic-plugin --scope project $claude plugin install c4-model-agentic-plugin@c4-model-agentic-plugin --scope project
Run in your repository: both land in .claude/settings.json, so teammates are offered the plugin.
$git clone https://github.com/caviri/c4-model-agentic-plugin $claude --plugin-dir ./c4-model-agentic-plugin
Try it for one session without installing anything.
$git clone https://github.com/caviri/c4-model-agentic-plugin $cd c4-model-agentic-plugin/mcp && npm ci $claude mcp add c4-explorer -- node "$PWD/server.mjs" --stdio
The explorer as MCP tools, without the plugin. For ChatGPT or Claude on the web, host it and add its URL: how.
How it works
Claude reads from the outside in: README, deployment files, manifests, entrypoints, then the main flows.
README.mddocker-compose.ymlpyproject.toml
A few questions, each with a default: who will read it, what is in scope, which flows matter. Then you correct its summary.
audience?scope?flows?
It writes the brief: actors, containers, components, relationships, flows and state machines, each with the file it came from.
project-brief.md
It builds the map and the deck, opens both in a headless browser, and reads the screenshots before it reports back.
architecture-explorer/index.htmlproject-deck/index.html
Live example
This is the output the plugin generated for a small example project: an image annotation tool with a web app, an API, a worker and three stores. Its model has since gained use cases, three wireframes (labelled illustrative, because the project was never run) and a data layer; the page carries those versions as its history.
double-click a box to open it ⇅ in an open box draws a scenario inside it D scenarios A data / search
The map
System context, containers, components, code. Boxes open in place, arrows reattach to whatever is visible, and a selection keeps only what it connects to bright.
Each runtime flow in its own colour, with its use case: a sequence or collaboration diagram at any level, painted on the map's arrows, or drawn inside an open box with ⇅.
Screenshots, diagrams or photos on a box, an arrow, a scenario or a step, in a gallery and a full-size viewer. Mock-ups carry an illustrative label.
Lifecycles drawn as states and transitions inside the box that owns them, with initial and final states marked.
Every box carries its file and line, linked to the repository. The build checks that each path exists before it calls the page done.
Download the architecture as Turtle, JSON-LD or a single-file .rete graph in a published C4 ontology, and query it with SPARQL. The page can be rebuilt from the graph alone.
Press ✎ edit: drag new boxes from the sidebar onto the map, reorder them in the outline, Alt+drag to connect, change any field, step or picture. Or let an AI agent edit it, each change waiting for your Apply. Undo, then download the model or the page.
The whole map, the pinned board or a scenario diagram as an SVG, a PNG or a page of its own, in the colours on screen. Or the map as Mermaid text for a README.
Six colour themes (or follow the system), and a size menu for the interface, the spacing between boxes and the labels and arrows. Icons and technology logos on the boxes, in one colour or the brand’s.
And its data
And a deck
where label pointing at the file
And its history
No Claude Code needed
Measured, not claimed
Every figure here is counted from the example on this page: a 39-file project with a web app, an API, a background worker, PostgreSQL, Redis and MinIO, where people annotate images and every annotation is reviewed.
PUT originals to FOR UPDATE SKIP LOCKEDimages.storage_key or an id in the COCO fileINSERT images to the export file.rete fileBackground
The four levels this plugin draws (system context, containers, components and code) are the C4 model, created by Simon Brown. It grew out of the software architecture workshops he ran from the mid-2000s, when attendees could not make sense of the diagrams they were drawing; the name “C4” first appeared in his QCon London workshop in March 2011.
This plugin is an independent project, not affiliated with or endorsed by Simon Brown. It uses the C4 levels as its map. For the model itself, go to the source.
Install
Needs Claude Code. Python 3 builds the deck; Node.js 18+ and Chrome or Edge are optional, for building and checking the map.
Install the Claude Code plugin c4-model-agentic-plugin for me. Read https://raw.githubusercontent.com/caviri/c4-model-agentic-plugin/main/INSTALL.md and follow its "Steps for the agent" section exactly.
› /plugin marketplace add caviri/c4-model-agentic-plugin › /plugin install c4-model-agentic-plugin@c4-model-agentic-plugin
› /c4-model-agentic-plugin:explain-project [deck | explorer | stories] [audience or focus]