hashswingingslasher/model-hint
プロンプトを送信する前に、必要なモデルを教えてくれるClaude Code mod
model-hintは、プロンプトを入力する際にhaiku、sonnet、opusを提案し、入力欄の上に一行の理由を表示するオープンソースのClaude Code modです。prompt.edit、ui.render、$.model.completeなどのmods(関数フック)APIを使用し、単語ルールによる即時フィードバックと、短い一時停止後のhaikuによる判定を行います。
この mod について
この記事では、model-hintの構築について説明しています。これは、下書きのプロンプトを読み取り、送信する前に提案されたモデル(haiku、sonnet、opus)と一行の理由を表示するオープンソースのClaude Code modです。mods/関数フックAPIを使用しています:prompt.editで下書きを読み取り、ui.renderでバンドを描画し、$.model.completeでhaikuに下書きを判定させます。単語ルールは即時の回答を提供し、300msの一時停止がhaiku判定をトリガーし、テストプロンプトで10/10のスコアを約1.5秒で達成しました。Switch、Hide、Offボタンが含まれ、VS Codeチャットパネルの動作に言及し、APIキーのように見える下書きが送信されないようにするセキュリティ監査修正についても触れています。リポジトリ:https://github.com/hashswingingslasher/model-hint
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add hashswingingslasher/model-hint claude plugin install model-hint@model-hint
原文 / README
TLDR: Dynamic model suggestions as you are typing a task I typed "build a AAA game like GTA 5" and my first version said sonnet. So I rebuilt it to read the prompt properly. What I built model-hint is an open-source Claude Code mod. As you type, a band above the prompt says haiku, sonnet or opus with a one-line reason, before you hit Enter. Buttons: Switch, Hide, Off. How Claude Code was used I'm not a developer. I built all of it in Claude Code sessions, using the mods (function hooks) API: prompt.edit to read the draft, ui.render to draw the band, and $.model.complete to have haiku judge the draft. Claude Code also wrote the 63 tests and drove live terminal sessions to check the band actually draws before calling anything done. What I learned Word rules are fast and miss intent. Nothing in "GTA 5" says huge. Now the rules answer instantly, and after a 300 ms pause haiku reads the draft. It got 10 out of 10 on my test prompts, in about 1.5 s. Speed is the network, not the model. Haiku 4.5 and 5.5 measured the same. The VS Code chat panel sends mods no keystrokes. From extension 2.1.301 it draws the band, so the mod reads the draft on a timer there. Switch, like /model , saves your default model, not just the session's. Found by testing, and now the toast says it. An independent security audit caught that "off" only hid the band while drafts were still being sent. Fixed, and drafts that look like API keys are never sent. https://github.com/hashswingingslasher/model-hint submitted by /u/berd_is_the_word to r/ClaudeCode [link] [comments]