mermaid-render: Mermaid diagrams rendered inside Claude Code

mermaid-render is a Claude Code plugin that turns every Mermaid diagram
Claude writes in a reply, reads, writes, edits or prints in
a file or a command's output, into a
rendered diagram right in the transcript: a colored Unicode card in any
terminal, a real SVG in the Claude Code desktop app and VS Code.
No more reading raw flowchart LR source. Flowcharts, sequence diagrams,
state diagrams, class diagrams and ER diagrams show up as pictures.


Quick install
In Claude Code, run:
/plugin marketplace add ejklock/claude-mermaid-render
/plugin install mermaid-render@mermaid-render
Or in one line:
/plugin install mermaid-render --marketplace ejklock/claude-mermaid-render
Answer y to add the marketplace and pick a scope (user scope is the
default). The plugin is active at once, with no restart.
Requirements: Claude Code 2.1.292 or newer (function-hook plugins).
Node.js 20+ for the SVG renderer (desktop, VS Code, and the terminal image
mode). rsvg-convert only for the image mode
(brew install librsvg / apt install librsvg2-bin).
What it renders
| Where | When | How it looks |
|---|
| Claude's replies | A closed ```mermaid fence in the answer | Prose stays Markdown; each diagram becomes a titled card |
| Tool rows | Read or Write of a .mmd / .mermaid file, or a .md file with mermaid fences | The diagrams appear under the tool row |
| Tool rows | A finished Bash run whose output holds a closed mermaid fence, or that prints a whole .mmd / .mermaid file (cat, sed -n) | The command's own row and output stay; each diagram appears as a card under it |
| Tool rows | A finished Edit of a .md file, for each mermaid fence the edit touched; of a .mmd / .mermaid file, the whole updated diagram | The edit's own diff stays; the updated diagrams appear as cards under it |
| Any terminal | Default unicode mode | Box-drawing art: bold labels, soft lines, accent-colored arrows |
| Ghostty, kitty, WezTerm | image mode | The real SVG, drawn as a picture (kitty graphics protocol); also inside a multiplexer that passes kitty graphics through, such as herdr |
| Desktop app, VS Code | Always | Native SVG |
Details that keep it pleasant:
- A fence that is still streaming stays text until it closes.
- A horizontal flowchart that does not fit the terminal is laid out vertically.
- In
image mode the picture fills the card width and is shrunk so the whole card fits on screen above Claude Code's prompt.
image mode sends the picture as data, not as a file name, so it draws inside a multiplexer that passes kitty graphics through, such as herdr.
- A picture over 2 MiB falls back to Unicode art.
- A diagram that does not parse shows the reason and its source, never a blank.
- Mermaid fences shown inside another fence (documentation) are left alone.
SVG themes
The desktop SVG and the terminal image mode use the diagram themes of
beautiful-mermaid:
Flowchart, tokyo-night | Sequence, tokyo-night | State, catppuccin-mocha |
|---|
 |  |  |
Configuration
Open /plugin, select mermaid-render, then Configure:
| Option | Values | Default |
|---|
terminalRender | unicode (any terminal), image (kitty graphics terminals) | unicode |
theme | tokyo-night, tokyo-night-storm, catppuccin-mocha, dracula, nord, one-dark, github-dark, zinc-dark, solarized-dark, github-light, catppuccin-latte, zinc-light | tokyo-night |
language | en, pt-BR (card titles, tool row counts and notices; any other value gives English) | en |
image mode sends the picture as data, so it also draws inside a multiplexer
that passes kitty graphics through, such as herdr. In tmux or a multiplexer that
does not, keep unicode. A picture over 2 MiB falls back to Unicode art.