Skip to content
 
 

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Desktop RTL Patch

Proper Hebrew & Arabic (right-to-left) support for Claude Desktop on Windows.

Auto-detects RTL text and aligns direction where it should, without breaking English or code blocks.

English · עברית

License: MIT Platform: Windows PowerShell 5.1+ PRs welcome GitHub stars


✨ What it does

  • Auto-detects RTL text in Claude's responses and the input box, and aligns the direction in real time, even while a reply is still streaming.
  • Handles code, math formulas, and tables — code blocks and LaTeX ($x^2$, $$…$$) stay left-to-right inside Hebrew, and Hebrew tables read right-to-left.
  • Fixes the broken window UI on RTL systems (see the note below).
  • Backs up every file it touches, with one-click restore and automatic rollback if anything goes wrong.
  • Stays applied across updates (optional), via a desktop shortcut or a background auto-updater.

Note

On a Windows system whose display language is set to Hebrew/Arabic, Claude Desktop's entire window UI flips to RTL on its own. This is a pre-existing bug, not caused by the patch. It pushes the title-bar window controls (minimize / maximize / close) on top of Claude's own settings and navigation buttons, hiding them, and sends the preview window to the far left. The patch fixes this by forcing the window chrome back to LTR, without affecting the direction of the chat text itself.


🚀 Quick install

Open Windows PowerShell and run:

irm https://raw.githubusercontent.com/shraga100/claude-desktop-rtl-patch/main/install.ps1 | iex

A UAC prompt will appear. Click Yes to grant administrator privileges, then choose 1. Install from the menu.

Tip

Prefer not to pipe to iex? Download patch.ps1 from the repo, right-click it, and choose Run with PowerShell.


📋 Requirements

Requirement Notes
Windows 10 / 11 With Claude Desktop installed (download)
Node.js npx must be on your PATH (nodejs.org), used to repack the app archive
Administrator The installer elevates automatically via UAC

Important

Windows only. On macOS, use soguy's Mac patch instead. (I haven't personally tested the Mac version, use at your own risk.)


🎛️ Menu options

When you run the script, you get an interactive menu:

# Option What it does
1 Install Smart RTL Patch Backs up the originals and injects RTL support
2 Restore Original State Reverts every change the patch made
3 Create 'Quick Update' Shortcut Adds a desktop shortcut for one-click re-patching
4 Enable Auto Re-Patch Installs a background watcher that re-patches after each Claude update
5 Disable Auto Re-Patch Removes that background watcher
6 Exit Close the patcher

🔄 Keeping the patch applied

Claude Desktop updates often, and each update overwrites the patch. Two optional features keep it effortless:

  • Quick Update shortcut (option 3): a desktop shortcut named "Update Claude RTL". Double-click it to silently fetch and re-apply the latest patch.
  • Auto-updater (option 4): a lightweight Windows scheduled task that detects when a new claude.exe version launches, re-applies the patch automatically, and shows a notification when it's done.

🗑️ Uninstall

Run the script and choose 2. Restore Original State. This restores all original files from backup and removes the self-signed certificate from your Windows certificate store. If you enabled the auto-updater, choose 5. Disable Auto Re-Patch as well.


🛠️ Troubleshooting

"Node.js (npx) is required": Install Node.js from nodejs.org and reopen PowerShell.

Claude won't start after patching: Run the script again, choose 2 (Restore), then 1 (Install).

Claude updated and the patch broke: Run the "Update Claude RTL" shortcut, or use the auto-updater. To fix it manually, delete any .bak files in the Claude app directory and run the installer again.

Import-Module … The member AuditToString is already present: You ran the command in PowerShell 7 (pwsh), which has a known bug that breaks the patch. Use the built-in Windows PowerShell instead:

  1. Press Win + R, type powershell, and press Enter. This opens the classic blue Windows PowerShell window (not the black pwsh one).
  2. Paste the install command and run it.

🔍 How it works (technical)

Claude Desktop is a digitally signed Electron app, so editing its UI code breaks the integrity checks. The patch works around this in three phases, all atomic, with automatic rollback on failure:

Phase 1, ASAR injection. Claude's UI lives inside app.asar. The script extracts it with npx @electron/asar, prepends the RTL-detection payload to the renderer files (and forces the window UI to LTR in the main process), repacks the archive, and computes its new SHA-256 header hash. The payload's detection logic lives in src/rtl-core.js (pure, unit-tested) plus src/rtl-payload.js (DOM layer); tools/build-payload.ps1 assembles them into patch.ps1.

Phase 2, hash replacement in claude.exe. The original ASAR hash is stored as an ASCII string inside claude.exe. The script does a byte-level search-and-replace to update it. If the format ever changes, it falls back to disabling the Electron integrity fuse.

Phase 3, certificate swap in cowork-svc.exe. This service verifies claude.exe against Anthropic's embedded certificate. The script locates that certificate (by pattern-matching around the "Anthropic, PBC" string), replaces it in-place with a self-signed one (padded with 0x00 to keep the file size), re-signs both binaries, adds the new certificate to the Windows trusted root store, and then wipes the private key.

All original files are backed up as .bak next to the originals before anything changes.

🔐 Security & verification

install.ps1 verifies an RSA-4096 signature over patch.ps1 before running it. A compromised GitHub repo alone is not enough to ship malicious code; the attacker would also need the maintainer's offline private key.

Public-key fingerprint (SHA-256):

6e:f4:c2:a6:c2:42:34:a1:5f:e5:cd:e5:5d:a5:b0:3c:94:64:b4:56:7f:81:04:7c:83:9a:50:1c:7c:6f:07:c9

To double-check, recompute the fingerprint of the key embedded in install.ps1 and confirm it matches:

$content = Invoke-RestMethod "https://raw.githubusercontent.com/shraga100/claude-desktop-rtl-patch/main/install.ps1"
if ($content -match "ExpectedPubKey\s*=\s*'([A-Za-z0-9+/=]+)'") {
    $bytes = [Convert]::FromBase64String($matches[1])
    $hash  = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes)
    ([BitConverter]::ToString($hash)).Replace('-', ':').ToLower()
}

A mismatch means the embedded key was swapped. Do not proceed, and report it as a security issue.

To audit a release without installing:

git clone https://github.com/shraga100/claude-desktop-rtl-patch
cd claude-desktop-rtl-patch
powershell -ExecutionPolicy Bypass -File tools\verify-signature.ps1

⚠️ Disclaimer

Caution

This patch modifies Claude Desktop's binaries. It replaces Anthropic's code-signing certificate inside cowork-svc.exe with a self-signed one, adds that certificate to your Windows trusted root store, and bypasses the app's integrity verification.

By installing, you accept that:

  1. You use it at your own risk. The authors take no responsibility for system damage, data loss, or instability.
  2. Modifying the app may not align with Anthropic's Terms of Service. It's worth reviewing them and using your own judgment.
  3. You trust this repository. Running irm | iex as Administrator executes code with full privileges, so always verify the source.
  4. It's temporary. Claude updates overwrite the patched files, so re-run the installer (or use the auto-updater) after each update.
  5. It's a stopgap until Anthropic adds native RTL support. Please request that feature through official channels.

🤝 Contributing

This project is open source under the MIT license. Contributions that improve RTL accuracy are very welcome, and PRs are open. 🙏

The math-formula isolation approach is credited to Claude-UniMath by Davidi Bellaire.

License

MIT

About

CSS patch for Claude Desktop windows version to enable RTL (right-to-left) support for Hebrew and Arabic

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages