Automation·terminal · desktop·no license file
loop-detective
Opens a case when the same Bash command keeps failing the same way, with the evidence.

loop-detective opens a case when Claude Code runs the same Bash command from the same folder and gets the same failure three times in a row. The case holds the evidence: the command, the failing line, the call numbers and the files edited between attempts. It only watches. Tool calls, permissions, prompts and files are left alone, and nothing goes through the model.
Unlike Loop Breaker, which refuses the next identical failed call and resets its count after any edit, loop-detective never blocks anything and keeps counting through edits, which is how it spots an edit-and-retry cycle.
What it does
- Edit-retry cases. When at least two of the retries followed a successful Edit, MultiEdit, Write or NotebookEdit, the case is labelled
edit-retryinstead ofretry: code keeps changing and the same check keeps failing the same way. The edited paths are listed as activity, not as the cause. - Next checks. Each open case ends with a suggestion. For an edit-retry case, look at the test expectations, the input data, the dependencies or another code path before the next edit. For a plain retry, compare inputs and environment and try a different hypothesis.
- Status line and toast. A line under the prompt counts the main agent’s open cases and the longest streak, such as
loop: 1 active · max 4 failures. Each new case can also raise one toast. - Pane and report.
/loop-paneopens a pane with the main agent’s live cases./loop-reportprints them into the transcript,--agentsadds subagents, tracked separately, and--historyadds up to 100 closed cases. - Closing. A case closes as
recoveredwhen the same command succeeds,changedwhen it fails differently, andunknownwhen the result is denied, interrupted, timed out, sent to the background, truncated or longer than 65,536 characters./loop-resetclears everything.
Install
Needs Claude Code 2.1.287 or later.
claude plugin marketplace add YeonwooSung/my-claude-code-mods
claude plugin install loop-detective@my-claude-code-mods
Cases open on their own. In the /plugin settings menu, threshold sets how many identical failures open a case (3 to 10, default 3) and toastAlerts turns the toasts off.
How it works
The mod hooks every tool call. From Bash it reads the command, the session’s working folder and the result: the exit code, an explicit engine error, or a failing summary from Node’s test runner, Jest, Vitest, pytest, Cargo or Go. Printing the word “error” is not enough, and a failing test summary counts even when the shell exits with zero. From the edit tools it reads only the file path.
Two failures match when their full output is identical after colour codes, line endings and test timings are stripped. Assertion values, failure counts and test names stay in, so a falling failure count starts a new streak. Different arguments, quoting or folder also start a separate one: commands are compared as whole strings, by non-cryptographic hash.
Everything stays in memory: hashes, counters and display excerpts of up to 160 characters, with common secrets such as tokens, passwords and authorization headers masked on a best-effort basis. It keeps no prompts, edit contents or full output, writes no files, makes no network or model calls and spends no tokens. Reload, resume, /clear and /loop-reset start from zero, and a case with no activity for 200 tool calls expires.
Limitations
- A repeated failure is not proof of a loop, and the report says so. Edits made through Bash, outside Claude Code or by another agent are not credited to a case.
- The author documents the pane in the terminal and the desktop app. The engine tests ran on Claude Code 2.1.280, with type checks against 2.1.292, and the live interface has not been checked in an interactive run. The VS Code chat panel and headless sessions get the text report only.
- The repository has no license file.
Similar Claude Mods
pin-memo
Notes and clickable todos pinned above the prompt, back when you resume the session.
agent-profiler
Model wait, tools and subagents as shares of session time, live, with OTLP export.
context-inspector
What fills the context window, what is waste and what compaction kept, with advice.
threads
Spin up Claude sessions on other models, watch them in a pane, get their answers back.
Popular Claude Mods
The whole directory →cache-keeper
Prompt-cache timer, keep-warm pings, cold-send guard, a board of chats and a handoff.
multi-core
ChatGPT, Cursor, Zen, Antigravity and Grok models in one Claude Code session, via /model.
savvy-progress
Running, finished and planned subagents with model, context, cost and time, in one panel.
glass
The transcript redrawn like a desktop app: colored commands, a tool tree, code cards.



