Fanyi
A Claude Code mod that translates your prompts to English and shows streamed translations of Claude's replies in your own language.
At a Glance
MIT-licensed Claude Code mod for translating prompts and replies; free to use, copy, modify and distribute. API engine requires your own OpenAI-compatible API key (external cost).
Engagement
Available On
Alternatives
Listed Nov 2026
About Fanyi
Fanyi is an open-source Claude Code mod published by the GitHub user JrCx7scC. It lets you write prompts in your own language while Claude Code works in English, and it displays translations of Claude's replies beneath the original text. Translation runs through either an OpenAI-compatible API or Apple's on-device Translation framework.
What It Is
Fanyi is a plugin for Claude Code that adds a bilingual layer to the terminal interface. A prompt written in your language is translated to English before Claude reads it. Your message row shows what you typed, with the English version dimmed underneath. Prompts already in English are sent as typed.
Each text block of Claude's reply gets a translation into your language in a dim box underneath. The translation streams in as it is generated and renders as Markdown. Replies translate for display only, so the conversation history Claude reads stays English.
Questions, Tool Rows and Typed Answers
The mod also translates parts of the interface beyond plain replies. AskUserQuestion dialogs show each question, option description and header chip with its translation. Option labels stay English because they are the answers Claude receives. Tool row titles, such as the description of a Bash command or subagent, get a translation beneath them. Text you type as an answer to a question is translated to English before Claude receives it.
Translation Engines and Settings
The API engine uses any OpenAI-compatible Chat Completions endpoint, with a configurable host, key and model picked from the endpoint's model list. The Apple on-device engine keeps text on your Mac and needs the matching language packs installed. The README notes that it handles technical terms less well and does not stream.
A status line above the prompt toggles translation on or off and opens a settings pane. The /fanyi command offers the same controls. Language detection can run on the Mac or ask the model. API keys are kept in the macOS Keychain, or in a user-readable file on other systems.
Setup and Limitations
Installation goes through the Claude Code plugin marketplace, followed by /fanyi settings to enter the API host and key. It requires Claude Code v2.1.287 or later and Node.js 18 or later. The Apple engine and on-device detection need macOS 15 or later with the Xcode command line tools.
Documented limitations include:
- Prompts beginning with
/or!are never translated. - Subagent replies are not translated.
- Translation adds roughly 1.5–5 seconds (API) to a prompt before it is sent.
Community Discussions
Be the first to start a conversation about Fanyi
Share your experience with Fanyi, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
MIT-licensed Claude Code mod for translating prompts and replies; free to use, copy, modify and distribute. API engine requires your own OpenAI-compatible API key (external cost).
- MIT License
- Apple on-device translation engine (macOS 15+)
- API engine using your own OpenAI-compatible endpoint (external cost)
- Bilingual display of prompts, replies, questions and tool rows
- Requires Claude Code v2.1.287+ and Node.js 18+
Capabilities
Key Features
- Translates prompts in your language to English before Claude reads them
- Streams translations of each reply text block in a dim box under the reply
- Bilingual AskUserQuestion dialogs and tool row descriptions
- Typed answers translated to English before sending
- API engine for any OpenAI-compatible Chat Completions endpoint
- Apple on-device engine using the Translation framework
- On-device language detection via NaturalLanguage on macOS
- In-app toggle and settings pane with /fanyi commands
- API key stored in macOS Keychain or a user-only file
- Persistent per-engine, per-language translation store
