loop-guard

Reviewed at commit 50c740d

Holds back a shell command once when the exact same command already failed twice in a row, and tells Claude to change approach; retrying it still goes through.

Made by
Vedant Andhale
What we checked

When the exact same Bash or PowerShell command has failed twice in a row, it holds the next attempt back once and tells Claude to change approach. Running the same command again right after goes through. It reads only the command text and failure status, keeps counts in memory, and shows a status line.

Review details

Static review of the source at the pinned commit; not run. Registers tool.call (only for Bash and PowerShell), session.compact and session.end. It counts failures per command string and per agent in memory (at most 200 entries), returns a one-time deny with a short message after two consecutive failures, and lets the next identical call through; a success clears the count. Counters are cleared on compaction and session end. Uses $.ui.status for a short 'retries held back' line. No files, programs, network, model calls or persistent storage. Failure behaviour: none special; it only wraps next(e).

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: no
  • Runs programs on your machine: no
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: no
  • Shows something on screen: yes
Hooked events
Screenshot of loop-guard
Made this mod? Add a badge to your README

modsforClaude badge for loop-guard

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/loop-guard.svg)](https://modsforclaude.com/mods/loop-guard/)

← All mods