The first RTL patch with proper math handling for the Claude Desktop app on macOS. Hebrew, Arabic, Persian & more. ENSURE LaTeX & KaTeX stay upright.
SaferSkills independently audited Claude-UniMath (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<div align="center">
<img src="assets/banner.svg" alt="Claude-UniMath" width="100%">
The first RTL patch to bring proper mathematics handling to the Claude Desktop app on macOS. Hebrew, Arabic, Persian, and every other right-to-left script — with LaTeX and KaTeX that stay upright and correct.
</div>
Claude Desktop has no right-to-left support at all. If you work in Hebrew, Arabic, or Persian, every long conversation is a struggle — and the moment Claude writes mathematics, it falls apart completely. A rendered formula or an inline $x^2$ dropped into RTL prose gets scattered by naive direction-flipping, and the line becomes unreadable.
*While processing Hebrew with AI agents requires a higher token consumption, it remains the best alternative if language barriers limit your use of English.
Browser extensions solved this for claude.ai in the web browser. Nobody solved it for the desktop app — the official Anthropic request even notes that the Chrome extension "works for web but not desktop," because injecting into Electron through the DevTools protocol fails. The desktop-only patches that do exist just flip whole lines and leave math broken.
Claude-UniMath is the first to bring isolated-math RTL handling to the macOS desktop app.
Hebrew flows right-to-left, every formula stays an upright left-to-right island, code stays LTR.
<table> <tr> <td> <img src="./assets/before-n-after.png" alt="Before and After Matrix Comparison"> </td> </tr> </table>
Every other RTL patch answers one question: "is there an RTL character? then align the line right." That breaks on mixed content. Claude-UniMath is built on a different idea — isolation, not line-flipping:
| Other desktop patches | Browser extensions | Claude-UniMath | |
|---|---|---|---|
| Works on the macOS desktop app | ✅ | ❌ | ✅ |
| Math isolated correctly in RTL text | ❌ | ✅ | ✅ |
| Rendered KaTeX and raw LaTeX | ❌ | partial | ✅ |
Currency-aware ($20 ≠ math) | ❌ | ❌ | ✅ |
| Every RTL Unicode script | partial | partial | ✅ |
| Live during streaming | ✅ | ✅ | ✅ |
| Non-destructive (original app untouched) | varies | n/a | ✅ |
| Tested (54 assertions) | ❌ | ❌ | ✅ |
<details> <summary><b>The three ideas no one else implements on desktop</b> (click to expand)</summary>
<br>
unicode-bidi: isolate left-to-right island. הערך העצמי הוא $\lambda = 3$ עם ריבוי $2$ renders with the Hebrew flowing right and the formula upright and correct, exactly where it belongs.$ from a price ($20) is never mistaken for math — and, critically, it is never allowed to "steal" the closing delimiter of real math later on the same line. שילמתי $20 עבור $x^2 + 1$ isolates only $x^2 + 1$.It also isolates citation chips and inline UI atoms so they sit on the correct side of an RTL line, handles content live as it streams, and is fully idempotent — re-processing never double-wraps or corrupts anything.
</details>
git clone https://github.com/DavidiBellaire/Claude-UniMath.git
cd Claude-UniMath
chmod +x install.sh # only needed if you downloaded the ZIP
./install.sh --installA patched copy is built at ~/Applications/Claude-UniMath.app and launches automatically. Your original `/Applications/Claude.app` is never touched.
<details> <summary><b>First launch: Gatekeeper & Keychain prompts (both expected)</b></summary>
<br>
</details>
./install.sh --install # Install, or re-apply after a Claude update
./install.sh --uninstall # Remove the patched copy
./install.sh --status # Show install status and fuse state
./install.sh # Interactive menuType or read any RTL language and it aligns automatically. Math stays upright and correct.
/Applications/Claude.appbrew install node) — provides npx for @electron/asar and @electron/fusesxcode-select --install) — provides codesign<details> <summary><b>How it works</b> (the patching pipeline)</summary>
<br>
The patcher is non-destructive — it never modifies the original app. Instead it:
Claude.app → ~/Applications/Claude-UniMath.appapp.asar archiveEnableEmbeddedAsarIntegrityValidation Electron fuse (required — Electron validates the archive hash at startup and would otherwise refuse to launch the modified copy)Because it builds a separate copy, no sudo is ever needed, your original Claude keeps auto-updating normally, and if anything goes wrong you just delete the copy.
After a Claude update: the auto-updater only touches the original. Re-run ./install.sh --install to rebuild a fresh patched copy from the updated version.
</details>
The engine is split so the logic is testable in isolation from Electron:
npm install # installs jsdom (dev dependency) for the DOM tests
npm test # full suite — 54 assertions, 0 failuressrc/core.js is pure and DOM-free. src/payload.js inlines a synchronized copy for runtime injection; the suite verifies the inlined copy matches the module exactly, so they never drift.
Claude-UniMath/
├── install.sh # macOS patcher (copy → inject → repack → sign)
├── assets/
│ └── banner.svg # README banner
├── src/
│ ├── core.js # Pure BiDi + math-detection engine (DOM-free, testable)
│ ├── dom.js # DOM layer: isolates math & inline atoms, sets RTL direction
│ └── payload.js # Self-contained IIFE injected into Claude Desktop
├── test/
│ ├── core.test.js # RTL detection + math segmentation
│ └── dom.test.js # isolation, streaming, idempotency, citation chips
├── package.json
├── LICENSE
└── README.md<details> <summary><b>"Claude quit unexpectedly" on launch</b></summary> <br> The ASAR integrity fuse wasn't disabled. Re-run <code>./install.sh --install</code>. If it persists, confirm <code>npx</code> works: <code>npx --yes @electron/fuses --help</code>. </details>
<details> <summary><b>No RTL alignment</b></summary> <br> Make sure you're running <code>Claude-UniMath.app</code> from <code>~/Applications/</code>, not the original. Check Console.app for <code>[Claude-UniMath]</code> messages. </details>
<details> <summary><b><code>.vite/build/ not found</code></b></summary> <br> A Claude update changed the internal structure. This is the first place to look when a new version breaks the patch. </details>
This patch modifies Claude Desktop's internal files, which Anthropic does not officially support and which may be against their Terms of Service. It is provided as-is, for personal use, with no warranty. Use at your own discretion. The real fix is native RTL support in Claude — if you want that, add your voice to the official request.
MIT © 2026 Davidi Bellaire
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.