# Repository Briefing: amElnagdy/claude-arabic-bidi
> Source: https://repoforai.com/repo/amElnagdy/claude-arabic-bidi (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/amElnagdy/claude-arabic-bidi
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A (77/100 · Maintenance 35/35 · Adoption 11/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: CLI
- **Momentum**: 73 ★ total (+1 24h / +73 7d) · 6 forks
- **When to Use**: Best for: Claude Code users who write or read Arabic technical prose mixed with English identifiers, paths, and commands, especially in the desktop Code tab or a terminal that renders Unicode isolates correctly. Skip if: Stock rendering is already adequate, your terminal still mishandles isolates, or your workflow requires copied prose to be character-for-character identical to the original.

## Overview
```text
### Architecture & Core Mechanics
This TypeScript Claude Code plugin sits in the message-drawing path rather than the model or conversation-storage path. `hooks/register.ts` wires the rendering hook, and `hooks/bidi.ts` implements the bidirectional formatting. The repository includes `.claude-plugin/` and `tsconfig.json`; no separate service or MCP transport is part of the described integration.

The formatter decides line by line whether to apply Arabic layout. It adds a leading right-to-left mark (RLM), encloses a qualifying line in an RTL isolate, and applies LTR isolation to English words, paths, or other technical fragments where the Markdown handling permits it. The same display-layer approach covers user messages and Claude replies without rewriting stored conversation text.

### Key Capabilities & Differentiators
In a mostly Arabic reply, any line containing an Arabic word is treated as Arabic. Otherwise, a line qualifies when its first letter is Arabic or its Arabic word count is at least half its English word count. Arabic punctuation alone does not qualify, and an English reply that merely quotes an Arabic word can remain LTR. The intended result is an RTL, right-aligned sentence even after an opening term like `React`, without reversing the punctuation in `.env`, `init()`, or `40%`.

The formatter preserves bold, italic, strikethrough, and bracket pairing. It can adjust link labels while leaving link destinations and reference-link definitions untouched. Inline code and fenced code blocks, including nested fences and `~~~` fences, are left unmarked, as are English-only text and English-only table cells. Four-space indented code blocks are not detected.

### Trade-offs & Limitations
Compared with stock rendering based on the first letter, the plugin makes a better distinction between an English-led Arabic sentence and an English sentence quoting Arabic. That distinction is heuristic: it depends on reply-level language context and line-level word counts, so teams should test short, terminology-heavy lines from their own work. Switching terminal emulators addresses how isolates render, but does not by itself change how Claude Code decides which lines are Arabic.

The desktop Code tab renders isolates fully, whereas terminal results depend on the emulator. The main copy/paste trade-off is that manual selections from Arabic prose can include invisible marks. Use inline code or fenced blocks for exact command copying; do not assume that four-space indented code gets the same protection. MIT allows commercial use and modification subject to its notice requirements.

### Hardware & Deployment Guide
The host is Claude Code. In an interactive session, run `/plugin install arabic-bidi --marketplace amElnagdy/claude-arabic-bidi`, approve adding the marketplace, and select user scope to activate it across sessions. The shell equivalent is `claude plugin install arabic-bidi --marketplace amElnagdy/claude-arabic-bidi`. The desktop app uses the Plugins picker to add that marketplace and install the plugin; a user-scoped terminal installation also loads in the desktop Code tab.

No standalone server, separate model, or GPU setup is part of this installation path. For local development, run `claude plugin validate .` and `claude plugin test .` from the repository root. There is no published GitHub release milestone to use as a compatibility checkpoint. Before rolling it out, test representative mixed-language Markdown and copied commands on the clients your team actually uses.
```

## Key Capabilities
```text
- Integration: `hooks/register.ts` attaches `hooks/bidi.ts` to Claude Code message drawing for both prompts and replies.
- Classification: In mostly Arabic replies, any line with an Arabic word qualifies; otherwise, the first letter and Arabic-to-English word ratio determine eligibility.
- Unicode rendering: A leading RLM and an RTL isolate establish the line direction, while LTR isolates preserve technical fragments such as `.env`, `init()`, and `40%`.
- Markdown handling: Fenced code, inline code, link destinations, reference-link definitions, and English-only table cells are left unmarked; link labels can be adjusted.
- Data boundary: Conversation storage is unchanged, but hand-copied Arabic prose can carry invisible direction marks.
- Compatibility: The desktop Code tab renders the isolates fully; terminal behavior varies, and four-space indented code blocks are not detected.
```

## Quick Start / Clone
```bash
claude plugin install arabic-bidi --marketplace amElnagdy/claude-arabic-bidi
```
