ClaudeCodeMod

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.

In Claude Code
/plugin marketplace add YeonwooSung/my-claude-code-mods
/plugin install loop-detective@my-claude-code-mods
Open the repo

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

The loop-detective section on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • session.endWhen a session ends
  • tool.callAround a tool call, where it can hold one
  • turn.completeWhen a turn ends
  • command.runWhen you run its slash command/loop-report/loop-reset/loop-pane
  • ui.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
Repo
YeonwooSung/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

Other mods in Safety

display-redactionmelodic-softwareMasks email addresses and secret-shaped text in what Claude Code draws, and leaves the transcript, the model's context, and the files unchanged.jev-permission-gatemadisonrickertHolds a commandHolds routine tool calls in auto mode for Jev to allow or deny, and sends the uncertain ones on to Claude Code's built-in classifier.subagent-wallerikdarlingdataHolds a commandHolds a subagent after a time limit to git, gh, and Markdown or text writes, and nudges a code-changing subagent that has edited nothing.public-repo-guardSzotaszHolds a commandAsks in a popup before a push to a public GitHub repo, or before one goes public, when outgoing commits hold keys, emails, local paths, or private repo names.agentic-qe-fleetproffesor-for-testingHolds a commandHolds a command that would delete or overwrite .agentic-qe learning data, and toasts when the guard is set to notify.secrets-guardBioInfoHolds a commandDenies writes of secret files and credential-shaped content, and Bash that would print those secrets.wp-credential-guardnathanonnHolds a commandMasks a WordPress username and application password, refuses a slash command that carries one, and denies Bash when a placeholder is unknown.cockpittsergeytovarovHolds a commandDraws context weather and the plan limits above the prompt, and can stop a dangerous command.taxi-speedcamdevbrother2024Holds a commandStops a risky shell command and asks before it runs, shown as a taxi speed camera.guardrails-mdberget-aiHolds a commandSends each Bash command to a Berget AI scoring model and blocks it when the score says it destroys data, leaks a secret, or breaks your GUARDRAILS.md.pdpa-thaiBoom-VittHolds a commandRefuses a tool call that repeats a placeholder for Thai or other personal data it redacted before sending, and masks that data on screen.subagent-fenceerikdarlingdataHolds a commandRefuses a force-push, a push to a protected branch, a git command that skips hooks, and killing a process by name.
All 73 in Safety