0xGondarxyz/claude-code-mods/tree/main/spiral-stop
spiral-stop
一個能偵測修復迴圈的 Claude Code 模組:同一個錯誤在 3 次修復嘗試後再次出現時,會通知你和 Claude 停止,並說出錯誤的假設。
關於這個 mod
spiral-stop 是一個會停止修復迴圈的 Claude Code 外掛/模組。它會追蹤失敗 Bash 呼叫的錯誤簽章;當相同簽章經過 3 次修復嘗試後仍再次出現(或連續出現 3 個「還是壞的」提示)時,會加入備註,告訴 Claude 停止修改程式碼並說出錯誤的假設;同時在提示上方顯示帶有 Dismiss 按鈕的提示列,並顯示通知訊息。它提供 /spiral 和 /spiral reset 指令;同一個指令之後成功時會丟棄簽章,並說明記憶體計數器和啟發式簽章等限制。透過 /plugin marketplace add 0xGondarxyz/claude-code-mods 和 /plugin install spiral-stop@claude-code-mods 安裝,或使用 claude --plugin-dir claude-code-mods/spiral-stop 執行。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add 0xGondarxyz/claude-code-mods claude plugin install spiral-stop
原文 / README
spiral-stop
A Claude Code mod that stops fix loops. Claude runs a test, edits code, runs it again, gets the same error, and repeats. This mod notices. After 3 fix attempts with the same error, it tells you and tells Claude to stop and name the assumption that might be wrong.
Install
/plugin marketplace add 0xGondarxyz/claude-code-mods
/plugin install spiral-stop@claude-code-mods
Or try it without installing:
git clone https://github.com/0xGondarxyz/claude-code-mods
claude --plugin-dir claude-code-mods/spiral-stop
Mods are not sandboxed. They run with the same access as Claude Code. Read the source before you install any mod, including this one.
What it does
- Every failed Bash call gets an error signature. The mod keeps the first 2 error-looking lines and removes numbers, hex ids, durations, timestamps,
:line:coland path prefixes. If no line looks like an error, it uses the last output line. - A fix attempt is a Write, Edit, MultiEdit or NotebookEdit call, or a new prompt from you. The same signature counts again only when a fix attempt came in between. Running the same failing command twice with no edit counts once.
- At count 3 the mod:
- adds a note for Claude: stop changing code, name the wrong assumption in 1 or 2 sentences, ask you one diagnostic question.
- shows a band above the prompt:
Spiral: same error after 3 fixes: <signature> [Dismiss]. - shows one toast.
- A second trigger: 3 prompts in a row from you that say it is still broken ("still not working", "same error", "didn't fix it"). Any other prompt resets this counter.
- When the same command later succeeds, its signature is dropped (and the band, if it was for that signature).
The note reaches Claude as context after the failing tool result (or after your prompt for the prompt trigger). It never adds a conversation row.
Commands
/spiralprints the top 5 tracked signatures with counts, and whether the band is up./spiral resetclears all signatures and the band.
The band has a Dismiss button.
Limits
- The counters live in memory. A hot reload or a new session starts them at zero.
- Failure means the Bash tool reported an error (non-zero exit). A command that prints errors and exits 0 is not tracked.
- The signature is a heuristic. Two different errors with the same first lines look the same.
- Fixed values: threshold 3, top 5, 200 characters. No options.
License
MIT