Mermaid Live Preview AIWhat this doesThis extension renders Mermaid diagrams from Markdown files as live visual previews inside VS Code. While you edit the Mermaid block in your Markdown file, the rendered diagram updates in real time. You never leave the Markdown file. The diagram and the text stay side by side. Right-click a Mermaid block, the preview opens, you edit the Markdown, the diagram shifts to match. When you need to jump back to a specific block in the source, you can do that from the preview. Why it existsAgents and humans both work in Markdown. When workflows, routing logic, or decision trees live as Mermaid blocks inside shared Markdown files, agents read and edit the text directly. But humans need to see the diagram rendered to verify it's correct. Without a visual preview, the only way to QA a workflow defined in Mermaid is to read the raw syntax and trace the logic in your head. That works for small diagrams. It stops working when you have multiple files with complex branching logic that agents are actually executing. This extension closes that gap. The agent works with the text. The human sees the picture. Both are looking at the same file. The human never has to leave the shared Markdown to do QA, and the diagram updates live as the text changes. The trade-offMermaid syntax costs slightly more tokens than a plain bullet list would. A large diagram might add 1,000-2,000 tokens. In conversations running against 100k-1M token context windows, this is negligible. What you get in return: a single source of truth that both agents and humans can read, edit, review, and confirm -- in the format that works for each of them. The Markdown stays versionable, reviewable, and searchable in git. The diagram stays visual for the human doing QA. When this matters mostWhen you have agent configurations, automation rules, or workflow definitions living in Markdown files and you need to verify that the logic is correct before it runs. The more workflows you manage, the more you need a fast way to visually confirm what's actually defined. Using this with AI agentsTo get your agent producing visual workflows alongside text descriptions, add something like this to your system prompt, CLAUDE.md, AGENTS.md, or equivalent:
Commands
The editor context menu includes Open Mermaid Block Under Cursor when a Markdown file is active. Install
What this is notThis is not a diagramming app. You do not draw diagrams in this tool. You write Markdown, Mermaid blocks render live, and you confirm the logic visually. The Markdown is the authoring surface. The preview is the QA surface. |