0xGondarxyz/claude-code-mods/tree/main/dashless
dashless
一個 Claude Code 外掛,會在 Claude 的回覆、Write/Edit 工具內容,以及 git commit / gh pr 訊息落地前移除 em dash 和 en dash,並顯示提示列計數器。
關於這個 mod
dashless
在 Claude 寫入的內容落地前移除 em dash。約 80 行 TypeScript。
| 位置 | 修正內容 |
| --- | --- |
| Write 工具 | 檔案內容 |
| Edit 工具 | 只有 new_string(old_string 必須符合檔案,因此永遠不會碰它) |
| Bash | 只有 git commit 和 gh pr / gh issue 的 create、edit、comment;其他指令照原樣執行 |
| 回覆 | Claude 回應中的文字區塊,在儲存前處理 |
改寫規則:
| 輸入 | 輸出 |
| --- | --- |
| 單字之間的 em dash | 改成逗號分隔形式 |
| 行首的 em dash | 移除,保留縮排 |
| 行尾的 em dash | 移除 |
| 帶空格的 en dash | 改成逗號分隔形式 |
| 數字範圍中的 en dash | 保持不變 |
| --force、-- file | 保持不變 |
提示列顯示累計計數:dashless: 3 em dashes fixed。
在一次性 git 儲存庫中用同一個提示執行兩次測試(寫入檔案、提交、用含 em dash 的句子回覆,每項都含一個 em dash)。沒有外掛時落地了 4 個 em dash;啟用後是 0。
執行測試:claude plugin test dashless
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add 0xGondarxyz/claude-code-mods claude plugin install dashless
原文 / README
dashless
Removes em dashes from what Claude writes, before it lands. About 80 lines of TypeScript.
| Where | What gets fixed |
| --- | --- |
| Write tool | the file content |
| Edit tool | new_string only (old_string must match the file, so it is never touched) |
| Bash | only git commit and gh pr / gh issue create, edit, comment; every other command runs as is |
| Replies | text blocks in Claude's responses, before they are stored |
Rewrite rules (<code>—</code> is the em dash, <code>–</code> the en dash):
<!-- Dashes in this file are HTML entities on purpose. With literal characters, dashless rewrites its own examples whenever Claude edits this file. -->| Input | Output |
| --- | --- |
| <code>a — b</code>, <code>a—b</code> | a, b |
| <code>— item</code> at line start | item (indentation kept) |
| <code>done —</code> at line end | done |
| <code>note: — x</code> | note: x |
| <code>a – b</code> (spaced en dash) | a, b |
| <code>1990–2000</code> (range) | unchanged |
| --force, -- file | unchanged |
The status line shows a running count: dashless: 3 em dashes fixed.
Tested by running the same prompt twice in a throwaway git repo (write a file, commit it, reply with a sentence, each with an em dash). Without the mod 4 em dashes landed; with it, 0.
Run its tests: claude plugin test dashless
