---
title: "一個 Claude Code 模組，在你傳送提示之前告訴你需要哪個模型"
url: "https://claudemods.dev/zh-tw/builds/a-claude-code-mod-that-tells-you-which-model-your-prompt-nee-966bdc"
source: "https://github.com/hashswingingslasher/model-hint"
source_type: "github"
repo: "https://github.com/hashswingingslasher/model-hint"
author: "berd_is_the_word"
author_handle: "berd_is_the_word"
stars: 0
category: "多代理與協作"
categories: ["agents"]
tags: ["hooks", "model-selection", "prompt-editing", "statusline", "ui-render"]
permission_level: 3
scan_complete: true
install: "claude plugin marketplace add hashswingingslasher/model-hint\nclaude plugin install model-hint@model-hint"
added: "2026-10-21T02:04:18.215Z"
updated: "2026-10-20T14:25:07Z"
locale: "zh-tw"
content_locale: "zh-tw"
---

# 一個 Claude Code 模組，在你傳送提示之前告訴你需要哪個模型

model-hint 是一個開源的 Claude Code 模組，在你輸入提示時建議 haiku、sonnet 或 opus，並在輸入框上方的帶狀區域顯示一行理由。它使用 mods（函式鉤子）API，例如 prompt.edit、ui.render 和 $.model.complete，透過單字規則提供即時回饋，並在短暫停頓後基於 haiku 進行判斷。

## Description

這篇文章描述了建構 model-hint 的過程，這是一個開源的 Claude Code 模組，它會讀取你的草稿提示，並在你傳送之前顯示建議的模型（haiku、sonnet 或 opus）以及一行理由。它使用 mods/函式鉤子 API：prompt.edit 讀取草稿，ui.render 繪製帶狀區域，$.model.complete 讓 haiku 判斷草稿。單字規則提供即時答案，而 300 毫秒的停頓會觸發 haiku 判斷，該判斷在測試提示上得分 10/10，耗時約 1.5 秒。它包含 Switch、Hide 和 Off 按鈕，記錄了 VS Code 聊天面板的行為，並提到了一項安全審計修復，因此看起來像 API 金鑰的草稿永遠不會被傳送。存儲庫：https://github.com/hashswingingslasher/model-hint

## Install

```
claude plugin marketplace add hashswingingslasher/model-hint
claude plugin install model-hint@model-hint
```

## Original 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]
