ljmerza/prompt-spellcheck/tree/main/plugins/prompt-spellcheck
この mod について
モデルが読む前にプロンプトのスペルミスや誤字を修正する Claude Code プラグインです。
you type: look uo claude code mods woth tests
model reads: look up claude code mods with tests
toast: ✎ spellcheck: uo→up, woth→with
Enter を押すと、プラグインはプロンプトを小さく高速なモデル(Haiku)に送り、スペルだけを直すよう指示します。言い回し、句読点、コード、パス、URL、フラグ、チケットキーは入力どおりに保たれます。修正されたテキストがプロンプトを置き換え、トーストに変更点が表示されます。
インストール
マーケットプレイスから:
/plugin marketplace add ljmerza/prompt-spellcheck
/plugin install prompt-spellcheck@prompt-spellcheck
クローンから:
git clone https://github.com/ljmerza/prompt-spellcheck.git
claude --plugin-dir prompt-spellcheck/plugins/prompt-spellcheck
フラグを渡せない場所(デスクトップアプリ、SDK ホスト)では、CLAUDE_CODE_PLUGIN_DIRS=/path/to/prompt-spellcheck/plugins/prompt-spellcheck で同じように使えます。
このプラグインは Claude Code の function-hook API(hooks.json の "modules")向けに作られています。この API は早期アクセスで、リリース間で変わる可能性があります。Claude Code 2.1.287 でビルドとテストを行っています。
使い方
入力するすべてのプロンプトでチェックが実行されます。次で切り替えます。
/spellcheck off
/spellcheck on
/spellcheck status
設定はセッションをまたいで保持されます。
スキップされるもの
- スラッシュコマンド(
/…)とシェルモード入力(!…) - コードフェンスを含むプロンプト
- 2 語未満または 4,000 文字を超えるプロンプト
- あなたが入力したものではないプロンプト:バックグラウンドタスクの通知、スケジュール実行、別セッションからのメッセージ、自動継続
チェックに失敗した場合
次の場合、プロンプトは変更せずに通過します。
- モデルが 8 秒を超えて処理した
- API がエラーを返した
- 返信が
<fixed>タグで囲まれていない - 返信の長さが元の 20–25% を超えて異なる(モデルが修正ではなくプロンプトへの回答を返すのを防ぐため)
コストとプライバシー
チェックされたプロンプトごとに、自分の Claude Code アカウントで Haiku の追加リクエストを 1 回行います。セッションの他の部分と同じクライアントとプロバイダーを通ります。送信のたびに、そのリクエスト分のレイテンシーが加わります。不要なときは /spellcheck off で無効にしてください。
モデルを変更する
モデルは hooks/register.ts の MODEL で設定します。--model が受け付けるエイリアスやモデル ID はどれでも使えます。
開発
claude plugin validate .
claude plugin test .
テストではモデルを偽の model.complete hook に置き換えるため、API 呼び出しは発生しません。
ライセンス
MIT
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add ljmerza/prompt-spellcheck claude plugin install prompt-spellcheck
原文 / README
prompt-spellcheck
A Claude Code plugin that fixes spelling mistakes and typos in your prompt before the model reads it.
you type: look uo claude code mods woth tests
model reads: look up claude code mods with tests
toast: ✎ spellcheck: uo→up, woth→with
When you press Enter, the plugin sends the prompt to a small, fast model (Haiku) with instructions to fix spelling only. Wording, punctuation, code, paths, URLs, flags and ticket keys stay as typed. The corrected text replaces the prompt, and a toast lists what changed.
Install
From a marketplace:
/plugin marketplace add ljmerza/prompt-spellcheck
/plugin install prompt-spellcheck@prompt-spellcheck
From a clone:
git clone https://github.com/ljmerza/prompt-spellcheck.git
claude --plugin-dir prompt-spellcheck/plugins/prompt-spellcheck
CLAUDE_CODE_PLUGIN_DIRS=/path/to/prompt-spellcheck/plugins/prompt-spellcheck does the same where you can't pass a flag (desktop app, SDK hosts).
The plugin is written against Claude Code's function-hook API (hooks.json "modules"), which is in early access and can change between releases. Built and tested on Claude Code 2.1.287.
Usage
The check runs on every prompt you type. Toggle it with:
/spellcheck off
/spellcheck on
/spellcheck status
The setting persists across sessions.
What it skips
- Slash commands (
/…) and shell-mode input (!…) - Prompts containing a code fence
- Prompts under two words or over 4,000 characters
- Prompts that didn't come from you: background-task notifications, scheduled runs, messages from other sessions, auto-continuations
When the check fails
Your prompt goes through unchanged when:
- the model takes longer than 8 seconds
- the API returns an error
- the reply isn't wrapped in
<fixed>tags - the reply's length differs from the original by more than 20–25% (this guards against the model answering the prompt instead of correcting it)
Cost and privacy
Each checked prompt is one extra Haiku request on your own Claude Code account, through the same client and provider as the rest of the session. It adds that request's latency to every submit. Turn it off with /spellcheck off when you don't want it.
Changing the model
The model is set by MODEL in hooks/register.ts. Any alias or model ID that --model accepts works there.
Development
claude plugin validate .
claude plugin test .
The tests replace the model with a fake model.complete hook, so they make no API calls.
License
MIT
