yibudak/cc-prompt-enhance-mod
cc-prompt-enhance-mod
A Claude Code mod that adds an Enhance button above the prompt, using Sonnet and the recent conversation to turn vague drafts into precise prompts.
About this mod
A Claude Code mod that adds an Enhance button above the prompt. Pressing Ctrl+E (or Ctrl+X Tab then E) asks Sonnet to rewrite a vague draft into a precise prompt grounded in the recent conversation, resolving ambiguous references, fixing typos, carrying over constraints and splitting multi-part asks. Clear drafts are left unchanged, and pressing again reverts the edit. It requires Claude Code v2.1.287 or later in a terminal, ships a VHS-recorded demo GIF, and installs via the plugin marketplace with a one-time keybinding entry in ~/.claude/keybindings.json.
Installation
Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.
claude plugin marketplace add yibudak/cc-prompt-enhance-mod claude plugin install cc-prompt-enhance-mod
Original text / README
You type fix that error so the test pases. Claude already knows which error you mean, but your prompt doesn't say. Enhance asks Sonnet to fill that in:
- fix that error so the test pases
+ fix the `KeyError: 'mail'` in `app/users.py:2` so `tests.test_users.TestUsers.test_create_user` passes
- Grounded edits. It fixes typos, resolves "this", "that file" or "the error" from the recent conversation, names what "done" looks like, carries over constraints you already settled, and splits multi-part asks into steps. Everything it adds comes from your draft or the conversation; choices you left open stay open.
- Leaves clear drafts alone. If there's nothing to resolve, your draft comes back unchanged, in the language you wrote it in.
- One key, both ways. Ctrl+E enhances. Press it again to revert.
Install
Run these as two separate prompts in Claude Code:
/plugin marketplace add yibudak/cc-prompt-enhance-mod
/plugin install cc-prompt-enhance-mod@cc-prompt-enhance-mod
Then run /reload-plugins, or start a new session. The button appears once you type. Drafts under two words or ten characters turn red with "This prompt is too short to enhance".
Ctrl+E (one-time setup)
A plugin can't add key bindings, so add this to ~/.claude/keybindings.json. Run /keybindings to open the file, and merge the entry if you already have bindings:
{
"bindings": [
{ "context": "Global", "bindings": { "ctrl+e": "app:cycleDiffBase" } }
]
}
<details>
<summary>Why this action, and why <code>Global</code></summary>
- A mod's button can only be pressed through an existing Claude Code action.
app:cycleDiffBaseis used only by the/diffpanel, so it's free at the prompt. While/diffis open, Ctrl+E goes to the panel. - In the
Chatcontext, the prompt's own Ctrl+E (move to end of line) wins.Globaldoesn't have that problem. - While the button shows, Ctrl+E doesn't move to the end of the line. Use End instead.
Without the binding, press Ctrl+X Tab, then E. In fullscreen rendering (/tui), you can also click the button.
How it works
| | |
| :- | :- |
| Model | sonnet, through your own Claude Code session and account. The alias resolves on Anthropic, Bedrock and Vertex. |
| What's sent | The system prompt in hooks/register.tsx, your draft, and the session's last 10 messages. Each message is capped at 2,000 characters and the whole context at 12,000. Tool calls are listed by name and file path or command. |
| Your draft | Replaced with the edit. If you kept typing while Sonnet answered, your version stays. |
| Revert | Brings back the original. Editing the text or sending it clears Revert. |
Requirements
- Claude Code v2.1.287 or later, in a terminal
- Not tested in the Desktop app's Code tab. The app draws its own prompt box, and the mods API says a mod can't read or fill a box like that, so expect it not to work there.
Permissions
A mod runs with your permissions, so check what it reaches before you install it:
claude plugin validate .claude-plugin/plugin.json
It reads the conversation and the prompt box, fills the prompt box, makes one model call per press and shows toasts. It doesn't read files, start processes or make other network requests.
Development
git clone https://github.com/yibudak/cc-prompt-enhance-mod
claude --plugin-dir ./cc-prompt-enhance-mod # loads it and hot-reloads on save
claude plugin validate ./cc-prompt-enhance-mod/.claude-plugin/plugin.json
claude plugin test ./cc-prompt-enhance-mod
cd cc-prompt-enhance-mod && vhs scripts/demo.tape # re-records assets/demo.gif
Claude Code writes the API types to .claude-plugin/types/ when it loads the mod. That folder is ignored by git.
License
MIT © Yigit Budak
