ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 ekinertac

rewrite-prompt

按下 Ctrl+P 時就地重寫提示框中的草稿;按下 Enter 前不會送出任何內容。

ekinertac@ekinertac

ekinertac/claude-code-mods/tree/master/rewrite-prompt

已翻譯

關於這個 mod

rewrite-prompt 是一個 Claude Code mod,將 Ctrl+P 綁定為就地重寫提示框中目前的草稿,使用你的方案中的模型(Sonnet)。按下 Enter 前不會送出任何內容,Ctrl+_ 可以復原重寫。它會保留草稿的意圖、語言與具體細節,不會新增任何需求。

透過 plugin marketplace 安裝:

claude plugin marketplace add ekinertac/claude-code-mods
claude plugin install rewrite-prompt@ekinertac-mods

接著在 ~/.claude/keybindings.json 的 Global 區塊中綁定按鍵:

"ctrl+p": "app:toggleDiffNoiseFilter"

然後啟動新的工作階段。這個 mod 會在提示列上方繪製零尺寸按鈕,將按鈕動作綁到這組按鍵;畫面上不會顯示任何內容。

已在 Claude Code 2.1.287 測試;mod 事件與方法可能在版本之間變動。終端機繪製尚未在所有環境驗證——如果提示列上方出現空白列,請開 issue。測試指令:claude plugin test <mod>(會 stub 模型,不使用網路)。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add ekinertac/claude-code-mods
claude plugin install rewrite-prompt
原文 / README

claude-code-mods

Claude Code mods I use daily.

  • rewrite-prompt: press Ctrl+P and the draft in the prompt box is rewritten in place by a model (Sonnet, on your plan). Nothing is sent until you press Enter, and Ctrl+_ undoes it.
  • write-for-me: press Ctrl+N and the next prompt is written for you from the last 12 messages of the conversation. If the box has text, it is used as a hint ("tests too") and expanded. Nothing is sent, and Ctrl+_ undoes it.
  • prompt-box: the prompts you type are drawn in the scrollback inside a thick cyan box instead of one > text line. Task notifications and messages from other sessions keep their normal rows. No key binding needed.
  • tool-oneline: each tool call is drawn as one line (⏺ Bash(echo hello) (ctrl+o to expand)) with no result block under it. Set detail to runs for one line per run of calls (⏺ Ran 3 tools: Bash ×2, Read). Ctrl+O still shows the full rows. A failed call keeps its error text.

Setup

claude plugin marketplace add ekinertac/claude-code-mods
claude plugin install rewrite-prompt@ekinertac-mods
claude plugin install write-for-me@ekinertac-mods
claude plugin install prompt-box@ekinertac-mods
claude plugin install tool-oneline@ekinertac-mods

Then bind the keys. Add these to the Global block of ~/.claude/keybindings.json and start a new session:

"ctrl+p": "app:toggleDiffNoiseFilter",
"ctrl+n": "app:toggleDiffPreSession"

To use the runs level, add this to ~/.claude/settings.json:

"pluginConfigs": { "tool-oneline": { "options": { "detail": "runs" } } }

How the shortcut works

No keybinding action runs a mod command. The mod draws a zero-size button above the prompt whose action is app:toggleDiffNoiseFilter (inert outside the diff panel; write-for-me uses app:toggleDiffPreSession the same way, so the two never share an action), and the chord you bind to that action presses it. Nothing shows on screen.

Limits

  • Tested on Claude Code 2.1.287. Mod events and methods can change between releases.
  • The rewrite replaces the draft. It keeps the intent, language and concrete details, and adds no requirements.
  • Not checked in every terminal: if you see a blank row above the prompt, open an issue.
  • Tests: claude plugin test <mod> (stubs the model, no network).

更多類似作品