AI loop circuit breaker · measured 93% Rust-helper example · works with Cursor, Claude Code, and Codex MCP

You’re looping.
Your AI
doesn’t know it.

The guardrail layer for AI coding agents.

Cuts the loop before it costs you — detects the moment you or your agent cycles through the same error, with exact time and tokens burned.
Focused reads for AI tools — use clipboard mode in the extension, or wire LoopGuard into MCP-compatible agents like Claude Code, Cursor, Windsurf, Codex, and VS Code / Copilot.
Code never leaves your machineWindows · macOS · LinuxFree — no credit card
userData.tsapi.ts
LoopGuard
37
38
39
40
41
42
43
44
45
async function fetchUser(id: string) {
const res = await api.get(`/users/${id}`)
return res.data.map(x => x.value)
}
 
const user = await fetchUser(userId)
console.log(user.profile.name)|
 
TypeScriptNo problemsLn 44, Col 28
Works withVS CodeCursorWindsurfCodex CLIClaude Code (terminal)GitHub Copilot

Up and running in 60 seconds.

Pick your path. IDE extension or Claude Code terminal — both take under a minute.

VS Code · Cursor · Windsurf
1

Install the extension

Search LoopGuard in the Extensions panel, or run: ext install LoopGuard.loopguard

Full setup guide →
2

Open any project

LoopGuard activates automatically. The status bar shows it is running — no config needed.

3

Sign in to sync

Run LoopGuard: Sign In from the Command Palette to see your loops and token savings in the dashboard.

Create free account →
Claude Code terminal — no VS Code needed
Context compression via MCP + PreToolUse hook
Shell output compression — 90+ CLI patterns
No account required — runs 100% locally
Loop detection requires the VS Code extension — not available in terminal-only mode
1

Download the binary

Grab loopguard-ctx for your platform from GitHub Releases, then:

chmod +x loopguard-ctx && mv loopguard-ctx /usr/local/bin/
GitHub Releases →
2

Wire Claude Code

Registers LoopGuard as an MCP server and installs a PreToolUse hook. No account needed.

loopguard-ctx setup --agent=claude
3

Restart Claude Code

Close and reopen your terminal. Every file read Claude Code makes is now routed through the context engine automatically.

Full Claude Code guide →

Two things no other tool does.

Every other context tool is passive — it compresses when you ask. LoopGuard is active. It watches, intercepts, and intervenes before the damage is done.

01
Loop Circuit Breaker

Cuts the circuit before the bill arrives

Every turn a stuck AI takes costs real money. LoopGuard watches both your diagnostics and your edit history. The moment it detects a loop — whether you're typing or an agent is running — it fires an alert with the exact time and token estimate burned.

02
Relevance Engine

Your AI reads the file. It gets 7% of it.

LoopGuard sits between your editor and your AI. Every context request — manual copy or MCP-backed agent read — is filtered through the relevance engine. Focused signatures, exact error context, smaller project maps. The rest is dropped.

Sound familiar?

Every developer using AI hits these walls. LoopGuard was built to break them.

Same error. Different variable name.

AI gives you the fix you tried 20 minutes ago — just renamed. You don't notice until you're three attempts in and an hour behind.

You pasted 800 lines for a 3-line bug.

The AI gets your entire file on every message. It wastes tokens on unrelated code — and gives you worse answers because of the noise.

Two hours gone. No warning.

You don't realize you've been on the same bug for two hours until you check the clock. No circuit breaker. No alert. Just lost time.

LoopGuard — Session Timeline● 4 loops
1
Cannot read property "map" of undefined
8min
14:03
2
Cannot read property "map" of undefined
16min
14:11
3
Cannot read property "map" of undefined
24min
14:19
4
Cannot read property "map" of undefined
32min
14:27
Loop Detected — 32 minutes wasted
Loop Detection

Catch the loop at turn 2.
Not turn 10.

Two independent detection methods run in parallel — diagnostic-based and edit-pattern. Either one can trigger. Catches loops even when the error message changes. Works with autonomous agents running in the background, not just manual sessions.

  • Watches VS Code diagnostics in real time — all 14 languages
  • Detects edit-pattern loops even when the error message changes
  • Fires an alert the moment a loop is confirmed — with exact time wasted and local token estimates
  • Works with autonomous agents — catches Claude Code and Cursor agents spinning silently
  • Session dashboard: every loop, every cost, every pattern across your history
Context Engine

Your AI reads the file.
It gets 7% of it.

The Rust helper can parse structure, score lines for information density, and produce smaller focused reads for clipboard or MCP workflows. What remains: the signatures and nearby context your AI needs, without making every request drag along the whole file.

  • Rust engine: 89–99% token reduction — not compression, selection
  • AST parse: function signatures sent, full bodies dropped
  • Shannon entropy scoring: complex logic surfaced, boilerplate removed
  • Session memory: if your agent read auth.ts 3 times, the 4th costs 13 tokens
  • Myers delta: only what changed since the last request — not the whole file again
  • 14 languages: TypeScript, Python, Rust, Go, Java, C++, and more
Ctrl+Shift+PLoopGuard: Copy Optimized Context
Context window — live compression
Without LoopGuard12,400 tokens
With LoopGuard12,400 tokens
Token reduction
0%
Cost saved / session
~$0.00
Rust engine
AST + Entropy
14 languages

Works everywhere you code.

One extension. One binary. Every major platform and IDE — same experience across all of them.

Windows 10 / 11
Full support · x64 + ARM
macOS 12+
Full support · x64 + ARM
Linux
Full support · x64 + ARM
Tested with
VS CodeCursorWindsurfCodex CLIClaude Code (terminal)GitHub Copilot

One layer. Three surfaces.

In your IDE, inside your AI agent, or at the terminal — LoopGuard intercepts context at every point where noise enters your AI workflow.

Free

IDE Extension

VS Code · Cursor · Windsurf — Windows · macOS · Linux

Loop circuit breaker + relevance engine built in. Free forever. One click install, zero config. Hit a loop: instant alert with time and tokens burned. Copy context: AI gets the 7% that matters.

Pro

AI Gateway

Claude Code · Cursor · Windsurf · Codex CLI · VS Code / Copilot

Wire LoopGuard once. Compatible agents can call LoopGuard's MCP tools for focused reads, compact search results, and cleaner shell output instead of grabbing full files every time.

Pro

Terminal Filter

Surfaces signal. Drops noise. Every CLI command.

`npm install` pumps 3,400 tokens of progress bars and resolved packages into your AI. LoopGuard intercepts it and sends 12 lines: the warning that broke your build, the peer conflict, the final status. Nothing else.

93%
Measured reduction example from the Rust helper
~$77
Avg saved/month (10 sessions/day)
47min
Avg time saved per day from loop detection
8.6×
ROI on Pro at $9/mo

The loop tax is real.

Every stuck AI turn costs money. Loops aren’t just frustrating — they have a line item.

A typical stuck session

Same error. 8 AI turns. Each turn: ~2,000 tokens context.

16,000 tokens$0.48

LoopGuard catches at turn 2. 2 turns × 140 tokens context.

280 tokens$0.01
Saved on one loop$0.47

5 loops/day × 22 working days = 110 loops/month.
110 × $0.47 = $51.70 saved per month — just on loop turns.
Add context reduction on every other request: ~$77/month total.

The agent problem

When you loop, you notice. When Claude Code, Cursor, or Codex workflows keep revisiting the same problem, token spend can climb quietly in the background. LoopGuard is designed to surface that waste and give you a smaller, more relevant next step.

Session memory

Your agent read auth.ts three times this session? The fourth read costs 13 tokens — not 2,400. LoopGuard caches every file read and serves delta-only updates. Files your AI already knows don’t get resent.

Relevance, not compression

Every other tool tries to make context smaller. LoopGuard decides what context should exist at all. The 200-line helper your AI keeps re-reading but never uses? It never gets sent again.

Simple pricing.

Start free. Upgrade when the ROI is obvious — and it will be.

Free
$0
Forever
  • Loop detection — unlimited sessions
  • Edit-pattern loop detection
  • Alert notifications with time wasted
  • Context Engine — TypeScript (~80% reduction)
  • Status bar + session dashboard
  • Works on Windows, macOS, Linux
Get Started Free
Pro
Most popular
$9
per month · cancel anytime
Pays for itself after 26 context copies. Average user saves ~$77/month.
  • Everything in Free
  • Rust engine (89–99% reduction)
  • MCP server — richer AI tool access
  • Shell hooks — CLI output compression
  • Expanded history and reporting
  • Premium usage surfaces
  • Priority support
See Pro features →

Stop losing hours.
Start right now.

60 seconds to install on Windows, macOS or Linux. The next time you hit a loop, LoopGuard catches it — and tells you exactly how much time you just saved.

Free forever · No credit card · Windows · macOS · Linux · Your code never leaves your machine