diagram

diagram is a command for Claude Code from geo-mena/distill. It costs 18 tokens per session (875 once invoked), scanned A, original, MIT.

A command that creates one Distill-style SVG diagram from a topic, using a matching diagram building block such as a graph, heatmap, grid, or molecule view.

In plain words
What is it for?
Use it to illustrate topics such as reinforcement learning, search trees, attention weights, molecules, or other technical ideas in articles and documentation.
Why use it?
It removes the need to choose and assemble the right diagram parts by hand. It also keeps diagrams in a consistent visual style.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the distill-design plugin — 1 skill, 7 commands shipped together

Good fit Use it to illustrate topics such as reinforcement learning, search trees, attention weights, molecules, or other technical ideas in articles and documentation.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/geo-mena/distill/diagram
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/geo-mena/distill

Made for: Claude Code.

Or install distill-design, the plugin that ships this one along with the rest of its 1 skill, 7 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagram

README.md
[![agentmods](https://agentmods.dev/badge/commands/geo-mena/distill/diagram/github.svg)](https://agentmods.dev/commands/geo-mena/distill/diagram)
Your own site
<a href="https://agentmods.dev/commands/geo-mena/distill/diagram"><img src="https://agentmods.dev/badge/commands/geo-mena/distill/diagram/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagram

Your own site · 80×15
<a href="https://agentmods.dev/commands/geo-mena/distill/diagram"><img src="https://agentmods.dev/badge/commands/geo-mena/distill/diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 875 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00875
Opus 5 $0.00009 $0.00438
Sonnet 5 $0.00004 $0.00175
Haiku 4.5 $0.00002 $0.00088

Measured 9d ago against content hash 0c7c8104bd1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

diagram scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/distill-design/commands/diagram.md · 37 lines

What it actually says

Load the distill-design skill, then produce one Distill-style SVG diagram for the subject in $@.

Workflow:

  1. Read plugins/distill-design/SKILL.md decision tree and pick the matching primitive file. Quick map:
    • RL grid / cliffworld / value function / policy → ui_kits/article/RL.tsx (GridWorld, ValueHeatmap, PolicyArrows)
    • Beam search / HMM / debate tree / generic graph → ui_kits/article/Graph.tsx (GraphNode, GraphEdge, BeamSearchTree, DebateTree, HMMState)
    • Attention weights / CTC alignment / Game of Life / LSTM-GRU recurrence / variable tensor / convolution → ui_kits/article/Heatmap.tsx (AttentionHeatmap, CellGrid, RecurrentArrow, VariableTensor, ConvGrid)
    • Molecule / cellular automata / Feynman / annotated raster / boxplot → ui_kits/article/Specialized.tsx (MoleculeViewer, AutomataGrid, FeynmanDiagram, ImageWithAnnotations, DistillBoxplot)
    • FiLM-style conditioning (concat / bias / scaling / fan-out network) → ui_kits/article/Diagrams.tsx + Primitives.tsx
    • Generic from scratch → compose Primitives.tsx (TensorVector, Arrow, OperatorNode, SubNetBlock, PointerGlyph)
  2. State the chosen primitive(s) in one line before generating, so the user can correct you cheaply.
  3. Output a single self-contained SVG file (not TSX). The SVG must declare its own <style> block with the system sans stack from DESIGN-SYSTEM.md § "Fonts", define any <symbol> it needs in its own <defs>, and not depend on cross-file <use href> — see hard constraints below.
  4. If the diagram needs a service icon (DNS, compute, database, etc.), inline-copy the matching <symbol> block from plugins/distill-design/resources/diagrams/_service-icons.svg into the SVG's own <defs>. The library currently has 29 symbols, all service-<slug> namespaced.

Output location:

  • Default: plugins/distill-design/resources/diagrams/<slug>.svg (slug = lowercased, hyphenated topic).
  • If the user asks for paste-ready output for a one-off (chat, README snippet), return the SVG inline in the response and skip the file write.

Hard constraints (non-negotiable):

  • English only. Do not translate labels.
  • No emoji. No multi-color icons. No gradients, no filters, no shadows.
  • Strokes 1.5–2px in #666 with stroke-linecap="round", stroke-linejoin="round", fill="none" unless intentional.
  • Diagram palette defaults to salmon #e49381 (data), powder-blue #81bee4 (conditioning), lavender #b8a8d8 (attention/memory). Use the extended palette (navy, penalty red, debate orange/blue, olive, burgundy, slate) only when the domain demands the semantic — see DESIGN-SYSTEM.md § "Extended palette".
  • Solid arrows for primary flow, dashed (stroke-dasharray="3 3") for optional / attention / observability paths.
  • No <use href="../_service-icons.svg#..."> cross-file refs — GitHub renders SVGs via <img src> which sandboxes external refs, and file:// blocks them too. Always inline-copy the <symbol> into the consumer SVG's <defs>.
  • No year literals in label text or <title> / <desc>.

Verification:

  • Open the SVG with chrome-devtools (file:// is fine for SVGs that are inline-self-contained) and screenshot. Check the user-facing labels render with the system sans, not Times-fallback. Surface any visual issues actively rather than claiming success.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 37 lines · 18 tokens per session scan A 0c7c8104bd1d

Subscribe to this mod's changes

diagram is a command published in the GitHub repository geo-mena/distill (2 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 875 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.