More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Stuck Agent Loop Detection & Verify-Before-Done Gate

    1

    Stop wasting tokens on agents that cycle through the same failing fixes.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Stuck Agent Loop Detection & Verify-Before-Done Gate

    Stuck Agent Loop Detection & Verify-Before-Done Gate

    Example session with this skill installed

    The agent has tried to fix a 'KeyError: user_id' three times and it keeps failing. Check if the agent is stuck and get a verdict.

    • Read your context and instructions
    • Compiled the stuck agent loop

    I have analyzed the session log to check for looping or drifting behavior.

    Stuck-Check Verdict

    MetricValue
    VerdictLOOPING
    EvidenceKeyError: 'user_id' detected 3 times in src/auth.py
    Convergence0.22 (Low)
    Impact4 files imported this module; full suite recommended

    The analysis shows the agent is trapped in a retry loop. It has attempted to patch src/auth.py three times without a successful test run, and the error remains identical. The impact analysis indicates that src/api/routes.py and tests/test_auth.py are directly affected by these changes.

    DO NEXT:

    1. Stop editing src/auth.py immediately.
    2. Read src/models/user.py to verify the schema for user_id.
    3. Run a minimal reproduction script python scripts/repro_key_error.py before attempting another fix.

    Next steps

    • Execute the suggested reproduction script to confirm the root cause.
    • Check the imported files listed in the impact report for mismatched definitions.
    • Once fixed, run python scripts/read.py | python scripts/impact.py | python scripts/judge.py done to verify.

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

    About this skill

    Stop wasting tokens on agents that cycle through the same failing fixes. When a coding agent hits a wall, it often tries the same patch repeatedly or claims a task is finished without ever running a test. This skill provides a local safety net that detects loops, drifts, and stalls before they drain your budget.

    What it does

    • Loop detection identifies when the same error occurs three or more times despite repeated edits.
    • Drift monitoring flags sessions with significant line changes that have not been validated by a successful command.
    • Stall alerts catch agents making numerous tool calls without performing edits or passing checks.
    • Completion gating verifies that every modified file has been exercised by a passing test before allowing the agent to exit.
    • Impact analysis lists which files and tests are affected by recent edits to ensure proper test coverage.

    How it works

    1. The agent executes a three-part Python pipeline that reads the local session log of Claude Code, Cursor, or Gemini.
    2. An impact analyzer identifies which downstream files or tests need to be run based on the specific changes made.
    3. A judge evaluates the session data against a convergence score and issues a verdict: LOOPING, DRIFTING, STALLED, or ON_TRACK.
    4. The agent follows the specific "DO NEXT" instruction provided by the verdict to break the cycle or verify the work.

    Frameworks & tools

    This tool uses a series of Python 3.8+ scripts that run locally within your repository. It natively supports session logs for Claude Code, Cursor, Codex CLI, and Gemini CLI, with a fallback JSONL format for other environments.

    Why this beats prompting it yourself

    Prompting an agent to "not loop" fails because the agent's internal state is often compromised by the loop itself. This skill uses an externalized script to analyze the actual session history objectively, providing a hard exit gate that standard system prompts cannot enforce.

    Use cases

    • Preventing "doom loops" where an agent applies and reverts the same fix repeatedly.
    • Auditing long-running sessions to see where tokens were wasted on unproductive retries.
    • Ensuring "Verify-Before-Done" compliance so agents don't ship untested code.
    • Responding to user queries like "Why is this taking so long?" with a data-backed status report.

    Known limitations

    Requires Python 3.8+ installed on the local machine. It cannot detect loops occurring across multiple separate terminal sessions if the log is cleared between them.

    Requires Python 3.8+ locally. Cannot track loops across fresh sessions if logs are cleared. Best results with Claude Code or Cursor; other agents require manual event logging.

    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 10 days ago

    Requires

    Python
    Git

    Permissions

    Terminal / Shell
    Read Files
    Listed10 days ago

    What's inside

    Frequently Asked Questions

    It uses an external Python-based analyzer to objectively audit your agent's session logs. Unlike system prompts, which the agent can ignore when stuck in a cycle, this provides a hard gate that forces the agent to address the loop or pass a specific test before proceeding.

    The skill natively supports Claude Code, Cursor, Codex CLI, and Gemini CLI. It also includes a fallback JSONL format, allowing it to work with most custom agent environments that export local session logs.

    Your purchase includes the core Python 3.8+ diagnostic scripts, the configuration files for impact analysis, and the integration guide for setting up the 'Verify-Before-Done' gates in your specific environment.

    The 'Stuck Check' skill runs locally within your repository to analyze session logs. It does not send your source code to external servers for the analysis, ensuring your data remains within your local environment.

    While it effectively identifies loops and stalls within active sessions, it cannot track patterns across multiple separate terminal sessions if the local log history is cleared or deleted between runs.

    New in Testing & Debugging