Ask Claude Code or Codex to explain some math and your terminal shows this:
H(p) = $-\sum_{i} p_{i} \log p_{i}$
That is LaTeX. A browser renders it into a clean equation. A terminal renders it into dollar-sign noise, because a TUI has no math engine to run. The more math-heavy your work (ML, statistics, optimization, proofs), the worse the output gets exactly where you need it clear.
The fix is not "render the LaTeX"
That is the hard, unsolved path: it needs a graphics backend like Kitty or SIXEL, plus a fallback for SSH and tmux. There is a cheaper move. The model does not have to output LaTeX at all.
Unicode already has most inline math: ∑, ∫, √, ≤, ≥, ∈, α, β, σ, x², pᵢ, set notation, even small matrices. A terminal renders all of it, because it is just text. So you teach the model to skip LaTeX and emit the Unicode directly:
before: H(p) = $-\sum_{i} p_{i} \log p_{i}$
after: H(p) = − ∑ᵢ pᵢ · log pᵢ
claude-math
claude-math does exactly that. It has no runtime; it is a SKILL.md the agent loads, with a glyph cheatsheet so the mapping stays consistent. It is copy- and search-safe (plain Unicode, not the "mathematical alphanumeric" styling codepoints that break find-in-page), and the same file works in Claude Code and Codex.
npx claude-math install # Claude Code
npx claude-math install --codex # Codex CLI
Restart your agent and math comes back as text you can read.
One caveat, stated plainly: this is a workaround, not native rendering. A dense derivation is still clearer as typeset math, and on a GUI surface that already renders LaTeX you want the LaTeX, not Unicode. claude-math is deliberately a terminal tool. Buh that fills an agent's answers, it is an immediate improvement.
Repo: https://github.com/vladimirrott/claude-math
If the Unicode mapping ever looks wrong, that is exactly the kind of issue I want to hear about.

Top comments (0)