Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By DennisLiuCkv1.0.0In 1 marketplace
Keeps Claude working on one prompt across repeated attempts until a completion phrase appears or an iteration limit is hit. A Stop hook blocks Claude from exiting after each response, so the loop runs inside your current session.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
1 caution to review before installing
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Of the plugin's README
Chinese
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
在 Claude Code 中實現迭代式、自引用 AI 開發循環的 Ralph Wiggum 技術。
Ralph Loop 是一種基於連續 AI 代理循環的開發方法。正如 Geoffrey Huntley 所描述的:「Ralph 是一個 Bash 循環」 - 一個簡單的 while true,反覆向 AI 代理提供提示檔案,允許它迭代改進其工作直到完成。
該技術以《辛普森一家》中的 Ralph Wiggum 命名,體現了儘管遇到挫折仍堅持迭代的理念。
此插件使用 Stop 鉤子 實現 Ralph,該鉤子攔截 Claude 的退出嘗試:
# 您只需運行一次:
/ralph-loop "您的任務描述" --completion-promise "DONE"
# 然後 Claude Code 自動:
# 1. 處理任務
# 2. 嘗試退出
# 3. Stop 鉤子阻止退出
# 4. Stop 鉤子回饋相同的提示
# 5. 重複直到完成
循環發生在您當前的會話內 - 您不需要外部 bash 循環。hooks/stop-hook.sh 中的 Stop 鉤子通過阻止正常會話退出來創建自引用反饋循環。
這創建了一個自引用反饋循環,其中:
/ralph-loop "構建待辦事項的 REST API。要求:CRUD 操作、輸入驗證、測試。完成時輸出 <promise>COMPLETE</promise>。" --completion-promise "COMPLETE" --max-iterations 50
Claude 將:
在您當前的會話中啟動 Ralph 循環。
用法:
/ralph-loop "<提示>" --max-iterations <n> --completion-promise "<文本>"
選項:
--max-iterations <n> - N 次迭代後停止(預設:無限制)--completion-promise <文本> - 表示完成的短語取消活動的 Ralph 循環。
用法:
/cancel-ralph
不好:「構建待辦事項 API 並使其良好。」
好:
構建待辦事項的 REST API。
完成時:
- 所有 CRUD 端點工作
- 輸入驗證就位
- 測試通過(覆蓋率 > 80%)
- 帶有 API 文檔的 README
- 輸出:<promise>COMPLETE</promise>
不好:「創建完整的電子商務平台。」
好:
階段 1:用戶身份驗證(JWT、測試)
階段 2:產品目錄(列表/搜索、測試)
階段 3:購物車(添加/刪除、測試)
完成所有階段時輸出 <promise>COMPLETE</promise>。
不好:「為功能 X 編寫程式碼。」
好:
按照 TDD 實現功能 X:
1. 編寫失敗的測試
2. 實現功能
3. 運行測試
4. 如果有任何失敗,調試並修復
5. 如需要則重構
6. 重複直到全部通過
7. 輸出:<promise>COMPLETE</promise>
始終使用 --max-iterations 作為安全網,以防止無法完成的任務的無限循環:
# 推薦:始終設置合理的迭代限制
/ralph-loop "嘗試實現功能 X" --max-iterations 20
# 在您的提示中,包括如果卡住該怎麼辦:
# "15 次迭代後,如果未完成:
# - 記錄阻礙進度的內容
# - 列出嘗試的內容
# - 建議替代方法"
注意:--completion-promise 使用精確字串匹配,因此您不能將其用於多個完成條件(如「SUCCESS」與「BLOCKED」)。始終依賴 --max-iterations 作為您的主要安全機制。
Ralph 體現了幾個關鍵原則:
不要在第一次嘗試時追求完美。讓循環完善工作。
「確定性地差」意味著失敗是可預測且有資訊量的。使用它們來調整提示。
成功取決於編寫良好的提示,而不僅僅是擁有良好的模型。
不斷嘗試直到成功。循環自動處理重試邏輯。
適合:
不適合:
ralph-loop/
├── .claude-plugin/
│ └── plugin.json # 插件元資料
├── commands/
│ ├── ralph-loop.md # 啟動循環命令
│ └── cancel-ralph.md # 取消循環命令
├── hooks/
│ ├── hooks.json # 鉤子配置
│ └── stop-hook.sh # Stop 鉤子腳本
├── scripts/
│ └── setup-ralph-loop.sh # 設置腳本
└── README.md # 本文件
在 Claude Code 中運行 /help 以獲取詳細的命令參考和示例。
此插件遵循 MIT 授權條款。
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub dennisliuck/claude-plugin-marketplace --plugin ralph-loopPlugins from other owners that cover similar ground