diagram is a visual modeling plugin for Codex and Claude Code.
Use it when a diagram would make an explanation easier to understand, even if your request is not phrased as a drawing task. It can model architecture, code dependencies, API call chains, workflows, state transitions, data models, and existing Mermaid source.
- Turns architecture, dependency, workflow, state, data-model, and call-chain discussions into diagrams.
- Renders diagrams to local
htmlPath,svgPath, andpngPathoutputs by default. - Validates Mermaid before rendering and reports useful diagnostics when something is wrong.
- Defaults to
zenumlfor new sequence-diagram requests unless you explicitly ask for Mermaid nativesequenceDiagram. - Can create a Diagramly.ai online diagram for long-term storage and sharing after local rendering succeeds.
This plugin currently targets Codex CLI. Enable plugins in your Codex config:
[features]
plugins = trueAdd the marketplace:
codex plugin marketplace add zenuml/diagram
codexThen run /plugins inside Codex CLI and install diagram from the list.
Add the marketplace and install the plugin:
claude plugin marketplace add zenuml/diagram --sparse .claude-plugin plugins
claude plugin install diagram@diagramDraw a diagram for the architecture design we discussed earlier.
Create a flowchart for checkout:
cart review -> payment -> fraud check -> order placed
add a failure branch from payment to payment failed
Draw a sequence diagram for oauth login flow.
This defaults to zenuml unless you explicitly request Mermaid native sequenceDiagram.
Draw a stateDiagram for order status with cancel support.
Draw a class diagram for Order, Customer, Payment, and Shipment.
Validate this Mermaid, fix it if needed, render it, and return the html path, svg path, and png path:
stateDiagram-v2
[*] --> Created
Created --> Paid
Paid --> Shipped
Shipped --> Delivered
Explain the complete call chain for this @codepath.
You can ask for any diagram type supported by the plugin, including:
architectureblock/block-betaC4Context,C4Container,C4Component,C4Dynamic,C4DeploymentclassDiagram/classDiagram-v2erDiagramflowchart,flowchart-elk, andgraphganttgitGraphishikawa/ishikawa-betajourneykanbanmindmappacket/packet-betapiequadrantChartradar-betarequirement/requirementDiagramsankey/sankey-betasequenceDiagramstateDiagram/stateDiagram-v2timelinetreeView-betatreemap/treemap-betavennwardley-betaxychart/xychart-betazenuml
When local rendering succeeds, the final response includes a stable text summary like:
+----------------------------------------------------------------------------------------------------------------------+
| diagram draw |
+----------------------------------------------------------------------------------------------------------------------+
| Status: OK |
| Diagram Type: flowchart |
| |
| Resources |
| HTML Path: /tmp/dv/payment-flow/index.html |
| SVG Path: /tmp/dv/payment-flow/diagram.svg |
| PNG Path: /tmp/dv/payment-flow/diagram.png |
+----------------------------------------------------------------------------------------------------------------------+
Open the returned htmlPath directly to view the rendered diagram. The svgPath and pngPath files are suitable for copying into docs, tickets, or presentations.
Local rendering works without signing in to Diagramly.ai.
If you want an online diagram for long-term storage and sharing, the assistant can create one after local rendering succeeds. When authorization is needed, it will first return your local files, then ask whether you want to continue with Diagramly.ai sign-in.
After authorization succeeds, the final response includes a Diagramly.ai PreviewUrl.