ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by ruslanfialkovskii

md-render

A Claude Code mod that renders Claude's terminal replies as rich markdown with tinted headings, highlighted code, callouts, grid tables, math, mermaid diagrams and images.

ruslanfialkovskii@ruslanfialkovskii

ruslanfialkovskii/md-render

Translated

About this mod

md-render is a Claude Code mod that replaces how a terminal reply is drawn while leaving the stored reply unchanged. It adds tinted headings, highlighted code blocks, inline code and kbd styling, task lists, callouts (GitHub alerts and Obsidian callouts), bordered grid tables with alignment and CJK width handling, clickable links, footnotes and wiki links, Unicode and two-dimensional math, mermaid diagrams via mermaid-ascii, and images where the terminal supports kitty graphics. Colours follow Claude Code theme keys. Options are configured under md-render in /config. Includes safety notes: remote image downloading is off by default and is bounded to https with a 20 MB cap because prompt-injected URLs can leak data.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add ruslanfialkovskii/md-render
claude plugin install md-render
Original text / README

md-render

A Claude Code mod that draws Claude's replies in the terminal as rich markdown, after render-markdown.nvim: tinted headings, highlighted code, callouts, grid tables, math, mermaid diagrams and images.

md-render replaces only how a reply is drawn. The stored reply and what Claude reads stay as they were, ctrl+o still shows the raw text, and the desktop app and IDE extensions keep their own renderer.

╭─────────────┬──────────┬────────┬──────────╮
│ Service     │ Replicas │    p99 │  Status  │
├━────────────┼─────────━┼───────━┼━────────━┤
│ api-gateway │        3 │ 182 ms │    ok    │
│ auth        │        2 │ 340 ms │ degraded │
╰─────────────┴──────────┴────────┴──────────╯

                     n
      P(fail) = 1 -  ∏  (1 - pᵢ)
                    i=1

Requirements

  • Claude Code 2.1.287 or later, in a terminal. Mods are an early-access feature: their API may change between releases, and Anthropic can turn installed mods off remotely, in which case Claude Code's own renderer draws replies.
  • A Nerd Font for the default icons, or set icons to unicode.
  • Optional: mermaid-ascii for mermaid diagrams; macOS sips and a terminal with kitty graphics (Ghostty, kitty) for images.

Install

In a Claude Code session:

/plugin install md-render --marketplace ruslanfialkovskii/md-render

Or from your shell:

claude plugin marketplace add ruslanfialkovskii/md-render
claude plugin install md-render@md-render

/plugin then shows 1 mod active · md-render under its tabs. Update with claude plugin update md-render@md-render.

What it draws

| Element | Drawing | | --- | --- | | Headings | Level icon, colour and tinted bar (full width or behind the title), optional half-block border lines | | Code blocks | Tinted block with the language's icon and name and Claude Code's syntax colours; or boxed, or plain | | Inline code, ==highlight==, <kbd> | Background tints and inverse keys | | Lists and task lists | Bullets by depth; checkbox icons for [ ], [x] and the custom [-] state | | Quotes | A bar whose colour follows the nesting depth | | Callouts | GitHub alerts and Obsidian callouts (26 types), with custom titles | | Tables | Bordered grid (square, round, double, heavy), alignment markers, cells wrapped to fit, CJK widths | | Links | Icon by site; https links are clickable (OSC 8), other URLs are shown after the label | | Footnotes, wiki links | Superscript numbers and a notes section; [[page\|label]] | | Math | $…$ as Unicode on one line; $$…$$ laid out in two dimensions (fractions, limits, matrices) | | Mermaid | Flowcharts, sequence and ER diagrams drawn by mermaid-ascii, strokes in the accent colour | | Images | An image alone in its paragraph is drawn as a picture where the terminal supports kitty graphics | | HTML | Comments hidden; common inline tags styled; other tags left as written |

Colours are Claude Code theme keys, so md-render follows your theme: light, dark, daltonized and ANSI.

Options

Set them in /config under md-render; a change reloads the mod.

| Option | Values (default first) | | --- | --- | | enabled | true, false | | icons | nerd, unicode | | headings | full, block, plain | | headingBorders | false, true | | codeBlocks | full, block, box, plain | | codeBorders | false, true | | tables | full, normal, compact | | tableBorders | square, round, double, heavy | | links | clickable, url | | math | unicode, raw | | images | local, remote, off | | mermaid | ascii, code | | mermaidCommand | mermaid-ascii, or a full path to the binary | | indent | false, true |

Images and safety

local draws image files on this machine only. remote also downloads https images that a reply names. Downloading a URL a reply wrote is how a prompt injection leaks data (the data rides in the URL), so leave remote off unless you trust what the replies may contain. Downloads are https only, redirects included, and capped at 20 MB.

Pictures are measured and, when not PNG, converted with macOS sips; converted files go to $TMPDIR/md-render/. Without sips, or in a terminal without kitty graphics, the image's alt text is shown instead.

What md-render runs

To see what md-render does before you install it, clone the repository and run claude plugin validate .claude-plugin/plugin.json in it:

❯ ./register.tsx hooks: ui.render{component=AssistantMessage, surface=terminal}
❯ ./register.tsx calls: $.env.get (via readDiagram, readPicture), $.process.run (via readDiagram, readPicture), $.ui.resolve
❯ ./register.tsx env reads: HOME, TMPDIR

It runs mermaid-ascii on mermaid blocks; pwd, mkdir and sips for images, so sips reads the image files a reply names; and curl only with images set to remote. It reads no other files and makes no other network requests.

Turn it off

Set enabled to false in /config, or disable or uninstall the plugin from the Installed tab of /plugin.

Development

claude plugin validate --strict .                            # the marketplace
claude plugin validate --strict .claude-plugin/plugin.json   # the plugin and its hooks module
claude plugin test .

| Path | Holds | | --- | --- | | hooks/register.tsx | The hooks module: the render hook, and the image and diagram loaders ($ stays in this file) | | hooks/parse.ts | Markdown to blocks and inline nodes, with marked and extensions | | hooks/inline.ts | Inline content as styled runs, and word wrapping | | hooks/render.tsx | Blocks to Claude Code's elements | | hooks/table.ts, latex.ts, mermaid.ts, images.ts | Grid tables, TeX to Unicode, diagram runs, image paths and sizes | | hooks/style.ts, languages.ts | Options, colours and icons | | tests/ | Tests for claude plugin test | | dev/harness/ | Renders fixtures in a real session and captures the screen (README) |

claude plugin test runs only while Claude Code's remote switch for mods is on. With CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, as in CI, the CLI skips the remote check and the switch keeps its default.

To try a change without installing it, start Claude Code with claude --plugin-dir . in this folder; saving a file reloads the mod.

Credits

marked parses the markdown (MIT, vendored in hooks/vendor). Icons follow render-markdown.nvim's defaults, and language icons and colours come from nvim-web-devicons (both MIT).

License

MIT

Other works with the same name

Similar projects