diagram-render

Reviewed at commit 0e4c0dd New version, not yet reviewed

Renders the mermaid blocks of the model's replies with an installed mmdc after each turn and draws each picture under its reply.

Made by
Kerem Gok
What we checked

After each turn it takes the mermaid code blocks from Claude's reply, renders them to PNG with the mmdc program you installed yourself, and draws the pictures under that reply. It writes temporary files to your temp folder, makes no network calls of its own and stores only an on/off switch.

Review details

Static review of the source at the pinned commit; not run. Hooks: session.start (registers /diagram-render), command.run (status, on, off), turn.complete (finds closed mermaid blocks in the answer and queues them; main loop only), ui.render for AssistantMessage in the terminal (adds the rendered image under the message). Runtime calls: $.process.run 'mmdc --version' once, then 'mmdc -i <TMPDIR or /tmp>/diagram-render/<hash>.mmd -o <hash>.png -b transparent -t dark -q' per block with a 60 s timeout, one at a time; $.fs.write of the block source, $.fs.read of the PNG header to get its size; $.env.get for TMPDIR; $.store get/set for the switch; $.clock.after, $.ui.log, $.ui.invalidate. mmdc is an external program that starts a headless browser on model-written diagram text; it was not reviewed and the mod does not install it (it only prints the npm install hint). A failed block is not retried. No network calls from the mod, no obfuscation.

What it uses
  • Reads your prompts: no
  • Sees tool calls: no
  • Blocks or changes tool calls: no
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for diagram-render

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/diagram-render.svg)](https://modsforclaude.com/mods/diagram-render/)

← All mods