@ssgk4422/loopbreaker
v1.0.0
Published
Autonomous AI Bug-Loop Interrupter & Circuit Breaker for Cursor and Claude coding sessions.
Maintainers
Readme
The Problem: The AI "Whack-a-Mole" Loop
When building apps with AI (Cursor, Claude Code, Lovable, Bolt), non-technical builders frequently get trapped in oscillation loops:
- You prompt the AI to fix Bug A.
- The AI applies a patch that accidentally breaks Feature B.
- You prompt to fix Feature B, and the AI recreates Bug A.
- Within 15 minutes, you burn thousands of tokens, your files balloon into spaghetti code, and your project is broken.
┌───────────────────────────────┐
▼ │
Prompt to fix Bug A ──► AI breaks Feature B │ (Whack-a-Mole Loop)
│ │
└───────► Prompt to fix Feature BLoopBreaker stops this cycle cold.
⚡ Quickstart
Run a single zero-config command inside any project:
npx @ssgk4422/loopbreakerNo installation, no accounts, and zero API keys required. LoopBreaker runs 100% locally on your machine.
🛠️ How It Works
╔═══════════════════════════════════════════════════════════════╗
║ ⚡ LoopBreaker v1.0.0 ║
║ Autonomous AI Bug-Loop Interrupter & Circuit Breaker ║
╚═══════════════════════════════════════════════════════════════╝
=================================================================
🚨 CIRCUIT BREAKER TRIGGERED
=================================================================
File: src/App.tsx
Pattern: FLIP-FLOP
Diagnosis: Exact oscillation detected! 'src/App.tsx' was modified
and then immediately reverted back to its previous state.
👉 Paste this fix prompt into Cursor / Claude to break the loop:
---------------------------------------------------------------
STOP: Code oscillation detected on 'src/App.tsx'. You are alternating
between two conflicting implementations.
1. Stabilize the useEffect dependency array.
2. Lift state to a standalone AuthContext instead of inline patching.
---------------------------------------------------------------
Options: Press [R] to rollback to pre-loop snapshot | [C] to clear alarm🧠 Tri-Factor Detection Heuristics
| Heuristic | Detection Mechanism | Why it Happens |
|---|---|---|
| Flip-Flop Inversion | Symmetric diff inversion $\ge 70%$ across 3 consecutive edits | AI alternates between two conflicting patches |
| High Churn Velocity | $\ge 4$ edits in $<6$ mins with net delta $<15$ lines | AI is blindly guessing without understanding the bug |
| Circular Ping-Pong | Alternating edits across 2 files (A ↔ B) | Cross-file circular dependency conflict |
⌨️ CLI Commands
# Start background watcher (default)
npx loopbreaker
# 1-click rollback to clean state before the loop began
npx loopbreaker rollback
# View history of recent file snapshots & timestamps
npx loopbreaker history
# Display help and options
npx loopbreaker --help🤖 Agent Skill Integration
LoopBreaker includes an open-standard Agent Skill compliant with agentskills.io. AI coding agents can inspect their own edit history and halt their own loops autonomously.
📄 License
MIT © 2026 Prabhakar Pal. Free and open source.
