Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    LoopBrake: Agent Edit-Thrash & Doom-Loop Breaker

    1

    Detect and break agent edit-thrashing, shell-write bypasses, and tool-error doom loops in coding transcripts.

    $6

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    LoopBrake: Agent Edit-Thrash & Doom-Loop Breaker

    LoopBrake: Agent Edit-Thrash & Doom-Loop Breaker

    Example session with this skill installed

    Audit my recent Claude Code transcripts for any high-severity edit thrashing or shell bypasses.

    • Read your context and instructions
    • Compiled the loopbrake

    The audit of ~/.claude/projects is complete. I analyzed 14 session transcripts and identified 3 sessions with high-severity loops.

    LoopBrake Audit Report

    Session IDScoreRuleFindings
    cl-8f2j42LPB001CRITICAL: 6 mutations to src/auth.ts.
    cl-8f2j42LPB004MEDIUM: 2 shell-write bypasses via sed -i.
    cl-9a1165LPB009HIGH: 3 consecutive FileNotFound tool errors.
    cl-3k0418LPB010CRITICAL: CWD escape detected. Shell reset to ~.
    cl-4m2292LPB007INFO: Documentation updates only (README.md).

    Analysis Summary

    The agent is currently thrashing on src/auth.ts. It attempted to bypass the structured Edit tool twice using sed commands after the first three edits failed to pass linting. In session cl-3k04, the agent deleted its own working directory, causing a CWD escape to the user home directory.

    Next steps

    1. Run node scripts/loopbrake.mjs --emit-hook to install the circuit-breaker.
    2. Review reference/loopbrake-playbook.md for the LPB010 remediation strategy.
    3. Manually inspect src/auth.ts to resolve the root cause of the linting failures.
    Documentation updates only (README.md

    Connects securely to your tools. The creator never sees your data.

    About this skill

    AI coding agents often get stuck in expensive loops, repeatedly patching the same file or retrying failing commands. LoopBrake detects and prevents agent edit-thrashing and tool-error doom loops across Claude Code and Codex CLI transcripts.

    What it does

    • Edit-Thrash Detection: Identifies when an agent performs four or more mutations on a single source file in a session.
    • Shell-Write Bypass Tracking: Catches agents attempting to bypass structured Edit tools using sed, cat, or tee via shell commands.
    • Doom-Loop Prevention: Flags consecutive tool-error streaks and identical shell command retries that drain tokens without progress.
    • Circuit-Breaker Injection: Generates PreToolUse and PostToolUse hooks to halt execution when safety thresholds are reached.
    • CWD Escape Monitoring: Detects deleted-sandbox escapes where the agent loses its worktree and resets to the home directory.

    How it works

    1. Run the audit script against ~/.claude/projects or ~/.codex/sessions to analyze local JSONL transcripts.
    2. Review the Loop-Safety Score (0–100) and specific rule violations (LPB001 to LPB014).
    3. Use the --emit-hook flag to generate a circuit-breaker script for your agent harness.
    4. Integrate the analyzer into CI pipelines using --fail-on high to block low-quality agent PRs.

    Frameworks & tools

    This tool works with Claude Code, Codex CLI, and custom tool-calling harnesses. It is built with Node.js and processes JSONL session transcripts.

    Why this beats prompting it yourself

    Standard prompts cannot track internal state or mutation counts across multiple turns effectively. LoopBrake uses deterministic log analysis to catch shell-level bypasses that agents use to hide their own failures from system prompts.

    Use cases

    • Auditing local agent sessions to identify why a task failed or wasted tokens.
    • Setting up a CI gate to fail automated agent runs that exhibit looping behavior.
    • Hardening agent environments against "shell-write" bypasses of governed edit tools.
    • Automating the cooling-off period when an agent hits a three-error streak.

    Known limitations

    Currently optimized for Claude Code and Codex CLI transcript formats. Analysis is performed on JSONL session logs. demo.png

    Optimized for Claude Code and Codex CLI JSONL logs. Mutation tracking is scoped to the current session transcript. Requires Node.js to run the audit and hook scripts.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 11 days ago

    Requires

    Node.js

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed11 days ago

    What's inside

    Frequently Asked Questions

    Detect and break agent edit-thrashing, shell-write bypasses, and tool-error doom loops in coding transcripts.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use LoopBrake: Agent Edit-Thrash & Doom-Loop Breaker on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in LLM Ops