Vatroslav/cc-mod-suggestion-sentence-case/tree/main/plugin
cc-mod-suggestion-sentence-case
一个 Claude Code 模组,它的 prompt.suggest hook 会重写由 Tab 接受的灰色提示词建议,让建议以大写字母开头、句号结尾,同时保持斜线命令不变。
关于这个 mod
一个 Claude Code 模组。每轮结束后,Claude Code 会在空的提示词框中用灰色文字提出下一条提示词,按 Tab 即可接受。建议通常以小写开头且没有句号;如果你把提示词写成句子,每次接受后都要在发送前修正。这个模组会在建议显示前重写它:以大写字母开头,以句号结尾。
| Suggested | Shown |
|---|---|
| run the tests | Run the tests. |
| why did it fail? | Why did it fail? |
| čekaj da završi | Čekaj da završi. |
| `npm test` again | `npm test` again. |
| /commit | /commit |
规则
- 只有第一个字符是字母时才会将其大写。以代码、引号或数字开头的建议会保留开头。
- 在
.,?,!,…或:后不会添加句号。 - 斜线命令保持原样。
- 会去掉两端的空格。
- 只有建议会改变。你输入或发送的任何内容都不会被触碰。
工作原理
plugin/hooks/register.ts 中的一个 prompt.suggest hook 会重写文本,并通过 next({ ...e, text }) 传递下去。它在 $ 上不调用任何东西:没有文件、进程、网络或模型调用。
它会处理所有建议,包括 Claude Code 自己的建议,以及其他插件通过 $.prompt.suggest 提出的建议。
安装
claude plugin marketplace add <path-to-this-repo>
claude plugin install cc-mod-suggestion-sentence-case@cc-mod-suggestion-sentence-case --scope user
在 2.1.287 之前的 Claude Code 构建中,已安装插件的函数 hook 可能需要在 ~/.claude/settings.json 的 env 块中加入 "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1"。已在 Claude Desktop 的 Code 标签页中实时验证。
检查和测试:claude plugin validate ./plugin 与 claude plugin test ./plugin。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add Vatroslav/cc-mod-suggestion-sentence-case claude plugin install cc-mod-suggestion-sentence-case
原文 / README
cc-mod-suggestion-sentence-case
A Claude Code mod. After a turn, Claude Code proposes your next prompt as dim text in the empty prompt box, and Tab accepts it. The suggestion often comes in lowercase and without a full stop, so if you write your prompts as sentences, every accepted suggestion needs fixing before you send it. This mod rewrites the suggestion before it is shown: it starts with a capital letter and ends with a full stop.
| Suggested | Shown |
|---|---|
| run the tests | Run the tests. |
| why did it fail? | Why did it fail? |
| čekaj da završi | Čekaj da završi. |
| `npm test` again | `npm test` again. |
| /commit | /commit |
Rules
- The first character is capitalized only if it is a letter. A suggestion that starts with code, a quote or a digit keeps its start.
- No full stop is added after
.,?,!,…or:. - A slash command stays exactly as it is.
- Spaces at either end are trimmed.
- Only the suggestion changes. Nothing you type or send is touched.
How it works
One prompt.suggest hook in plugin/hooks/register.ts rewrites the text and passes it on with next({ ...e, text }). It calls nothing on $: no files, processes, network or model calls.
It handles every suggestion, both Claude Code's own and any that another plugin proposes through $.prompt.suggest.
Install
claude plugin marketplace add <path-to-this-repo>
claude plugin install cc-mod-suggestion-sentence-case@cc-mod-suggestion-sentence-case --scope user
On Claude Code builds before 2.1.287, function hooks of installed plugins may need "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" in the env block of ~/.claude/settings.json. Verified live in the Code tab of Claude Desktop.
Check and test: claude plugin validate ./plugin and claude plugin test ./plugin.
