render-figures

render-figures is a command for Claude Code from braininahat/brains-in-a-hat. It costs 17 tokens per session (423 once invoked), scanned A, original, MIT.

A command that compiles every Typst and TeX figure file in a chosen directory into SVG or PDF output.

In plain words
What is it for?
Use it to build figures in the default figures folder or another directory, retry an obvious compilation fix once, and review a summary of the results.
Why use it?
It saves time when a project contains several diagrams and reports which files succeeded or failed, including useful compiler errors.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the archer plugin — 5 skills, 2 commands, 2 agents shipped together

Good fit Use it to build figures in the default figures folder or another directory, retry an obvious compilation fix once, and review a summary of the results.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/braininahat/brains-in-a-hat/render-figures
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/braininahat/brains-in-a-hat

Made for: Claude Code.

Or install archer, the plugin that ships this one along with the rest of its 5 skills, 2 commands, 2 agents.

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 render-figures

README.md
[![agentmods](https://agentmods.dev/badge/commands/braininahat/brains-in-a-hat/render-figures/github.svg)](https://agentmods.dev/commands/braininahat/brains-in-a-hat/render-figures)
Your own site
<a href="https://agentmods.dev/commands/braininahat/brains-in-a-hat/render-figures"><img src="https://agentmods.dev/badge/commands/braininahat/brains-in-a-hat/render-figures/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 render-figures

Your own site · 80×15
<a href="https://agentmods.dev/commands/braininahat/brains-in-a-hat/render-figures"><img src="https://agentmods.dev/badge/commands/braininahat/brains-in-a-hat/render-figures.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 423 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.00017 $0.00423
Opus 5 $0.00009 $0.00211
Sonnet 5 $0.00003 $0.00085
Haiku 4.5 $0.00002 $0.00042

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

Security

Grade A, and why

render-figures 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.

archer/commands/render-figures.md · 55 lines

What it actually says

Compile all .tex and .typ figure files in a target directory and report results.

Steps

  1. Determine the target directory:

    • If the user specifies a path, use it
    • Default: figures/ in the current working directory
  2. Find all figure files:

    # Find all .typ and .tex files in the target directory
    find <dir> -name "*.typ" -o -name "*.tex"
    
  3. Compile each file:

    For .typ files (fletcher/Typst diagrams):

    typst compile <file>.typ <file>.svg
    # or for PDF:
    typst compile <file>.typ <file>.pdf
    

    For .tex files (TikZ diagrams):

    skills/tikz-render/scripts/compile.sh <file>.tex <file>.svg
    
  4. Track results — for each file record:

    • PASS: compiled successfully, output size > 0
    • FAIL: compilation error (include last 20 lines of error output)
  5. Print a summary table:

    PASS  figures/ctc-pipeline.svg        (12.4 KB)
    PASS  figures/jepa-architecture.svg   (8.7 KB)
    FAIL  figures/bigru-internals.tex     — Missing \usetikzlibrary{arrows.meta}
    
  6. For any FAIL: attempt the obvious fix (missing package, math mode error) and retry once. If still failing, report the full error without further retries.

Usage

/render-figures              # renders all in figures/
/render-figures paper/       # renders all in paper/
/render-figures --pdf        # compile to PDF instead of SVG
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 · 55 lines · 17 tokens per session scan A a3ed713e5d04

Subscribe to this mod's changes

render-figures is a command published in the GitHub repository braininahat/brains-in-a-hat (4 stars, last pushed 2mo ago), licensed MIT. It adds 17 tokens to every session and 423 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.

Related

Other commands, from other repositories

latex-polish

Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages. Use when compilation succeeds but title pages, floats, tables, figures, or layout still need publication-quality review. Not for basic compilation health; use $latex-health-check.

flonat/flonat-research · 60 tokens

latex

Compile one specified LaTeX document, resolve build errors, audit citations, and report build quality. Use when a .tex source must be built or a concrete compilation failure repaired. Not for corpus-wide build checks, visual polish after a clean build, or creating a project; use $latex-health-check, $latex-polish, or…

flonat/flonat-research · 72 tokens

bib-filter

Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation. Use before submission or after large revisions.

flonat/flonat-research · 41 tokens

wtfp:export-latex

Export the manuscript and bibliography to portable LaTeX source with declared formatting.

akougkas/wtf-p · 22 tokens

autor.paper-writing

Workflow 3: Full paper writing pipeline. Orchestrates paper-plan → paper-figure → paper-write → paper-compile → paper-improver to go from a narrative report to a polished, submission-ready PDF. Use when user says "write paper pipeline", "paper writing", or wants the complete paper generation workflow.

llv22/AutoResearchWithEyes · 69 tokens

paper-tex

Typeset the draft below as a house-style LaTeX paper and build the PDF. Detect the input format and convert the body with pandoc, wrap it in the EB Garamond template under assets/, and build with latexmk via scripts/formatpaper.py. Then do the house-specific finishing by hand: \figcap title+note captions, [H] floats…

scdenney/open-science-skills · 0 tokens