rich-terminal
Reviewed
at commit d20c34a
Mermaid diagrams drawn inside Claude Code replies, and a truecolor status line under the prompt with a Token Weather forecast of the context window.
0 upvotes
Log in to upvote or save- Made by
- xiaolai
- Pinned commit
-
d20c34ad5f2cc535400417bed2b7557f22840f3a - What we checked
-
Redraws Mermaid diagrams in Claude's replies as text drawings, or as pictures made by headless Chrome in Ghostty or kitty when you turn that on, and /rich open shows one in your browser. /rich status setup copies a bash status line into ~/.claude and points the statusLine setting at it; it shows folder, git state, model, context, cost, rate limits and your account name. Nothing is sent over the network.
Review details
Static review of the source at the pinned commit; not run. One module (hooks/register.tsx) registers session.start (registers the /rich command, looks for a Chromium browser only when the images option is on and the terminal is Ghostty or kitty outside tmux, and in interactive sessions refreshes the copied status line scripts), turn.start and turn.complete (track running turns in plugin state), ui.render for AssistantMessage (finds mermaid fences and replaces them with a text drawing from the vendored @zombie-mermaid ascii renderer, or with an Image of a cached PNG; source is left as is when it does not fit), and command.run for /rich (help, list, open, on, off, status). Runtime calls: $.session.messages (assistant text only, for list and open), $.fs read/write/stat/exists, $.process.run and spawn, $.env.get (HOME, CLAUDE_CONFIG_DIR, TERM, TERM_PROGRAM, TMUX, KITTY_WINDOW_ID), $.settings.read (user statusLine), $.store, atoms and $.ui.log to debug. Programs run: chmod, id, stat and rm on its own files; bash on its bundled rich-status-ctl.sh for /rich status actions (writes only ~/.claude/rich-status.state); /usr/bin/open or xdg-open for /rich open; and, with images on (off by default), the configured or found Chrome/Chromium/Edge/Brave with --headless, background networking, sync, extensions and component updates disabled and a per-session profile under ~/.claude/plugins/data/rich-terminal, to dump the DOM and screenshot a local page. Diagram pages and PNGs are cached in that owner-only folder (checked against symlinks and ownership) and never cleaned up automatically, as the README says; the pages carry a CSP of default-src 'none' with scripts only from file:, so diagrams cannot reach the network, and links are stripped. /rich status setup reads the user's settings.json, keeps every other key and the statusLine's own extra keys, sets statusLine to bash "<config dir>/rich-status.sh" (replacing any existing status line; refuses a settings file that is not a JSON object) and copies three scripts into the config folder; at session start it only replaces copies that are still exactly what it installed, and moves its own pre-1.0 statusline-*.sh setup to the new names. During setup it also moves an existing ~/.claude/statusline.state into rich-status.state and deletes statusline.state and .statusline-account, names a different status line tool could also use. The status line script (read fully) runs git in the current folder with a time budget, fsmonitor, external diff and textconv disabled, runs jq on Claude Code's payload, reads oauthAccount.emailAddress or displayName from ~/.claude.json and caches it in ~/.claude/.rich-status-account (shown as the part before @ by default), and reads the terminal width from /dev/tty. Not read in full: hooks/vendor/mermaid-ascii.js (280 KB bundle of @zombie-mermaid 4.0.0, pure rendering; searched for network, process, eval and file calls, only a globalThis.process check for TTY color support) and viewer/mermaid.min.js (5.5 MB minified mermaid 12.1.0, runs only inside the CSP-locked browser pages; searched, its fetch hits are the KaTeX parser). Needs jq and bash for the status line.
- 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
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/rich-terminal/)