All shelves / Mods / Safety
loop-detective
By YeonwooSung
loop-detective is a Claude Code safety mod by YeonwooSung.
Opens a case when the same Bash command fails the same way again, ties it to the edits that followed, and shows the live cases in a pane and a status line.
Draws
Install
The marketplace name is my-claude-code-mods.
/plugin marketplace add YeonwooSung/my-claude-code-mods /plugin install loop-detective@my-claude-code-mods
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.1.3
- License
- Apache-2.0
- Repo stars
- 1089
- Last change
- 2026-10-23
What it can reach
- Draws in the session
- Sees tool calls
- Reads this turn's file edits
Claude Code 2.1.287 or later. Older engines need CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. The author says the engine suite runs on 2.1.280, and the interactive UI needs a separate live run. A case opens after 3 identical failures in a row of the same Bash command in the same folder; threshold sets that from 3 to 10. With at least two rounds of successful edits between the failures it is labelled edit-retry, otherwise retry, and the edited files show activity, not blame. A failure is an engine error, a nonzero exit code, or a failing summary from TAP, Jest, Vitest, pytest, Cargo, or Go tests. Success for the same command closes the case as recovered, and a different failure closes it as changed. /loop-report lists active cases with evidence and possible next checks, --agents adds subagents, and --history adds up to 100 closed cases. /loop-pane opens the live cases, and /loop-reset clears what it has seen. The status line reads loop: 1 active · max 4 failures, and each new case can show one toast. The author says it observes only: tool execution, permissions, prompts, and files are never changed. State stays in memory; no export, automatic file writes, network calls, or model calls. Commands and failure text are shown with common secrets masked, best effort.
The marketplace, my-claude-code-mods, holds seventeen mods by YeonwooSung, time-machine and token-run among them. This one installs on its own. Repeated failures that cost turns are why this page files it under safety. loop-guard, by arasovic, adds a note to the second identical failure of a tool call, telling the model not to try a third time. This one tells the model nothing: it keeps the evidence for you, in a report and a pane.
Demo

What it hooks into
session.startWhen a session startssession.endWhen a session endstool.callAround a tool call, where it can hold oneturn.completeWhen a turn endscommand.runWhen you run its slash command/loop-report/loop-reset/loop-paneui.renderDraws into the sessionPane
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- YeonwooSung
- Category
- Safety
- Marketplace
- my-claude-code-mods
- Folder
- loop-detective
- Version
- 0.1.3
- License
- Apache-2.0
- Repo stars
- 1089
- Last change
- 2026-10-23
- Language
- TypeScript
- Files
- 15