Skip to main content
v2.8.2 live — easier setup, clearer savings totals
Your code never leaves your machine
Free forever · no paid tier
LoopGuard

The local guardrail for AI coding sessions that start repeating instead of moving.

Runs in VS Code, Cursor, and Windsurf. Free.

Save the hour.
Cut the token bill.

LoopGuard watches your coding session locally, fires when the same problem keeps resurfacing, and trims the next prompt to only the context the model actually needs — so each retry costs less and moves faster.

Opens VS Code Marketplace · 1-click install · no account needed

1 stars on GitHub
Stops retry spirals before they quietly eat another 20 to 40 minutes
Cuts prompt size by 70%+ in normal focused reads, with some measured sessions going much higher
Makes the payoff visible in minutes saved, tokens saved, and spend avoided
$77/mo
Estimated API spend avoided for heavy AI coding use¹
47min
Average time recovered per day from avoided retry spirals²
70%+
Smaller focused prompts in normal use, with some reads going much higher
8.4k
Tokens saved in one measured focused-read example

1 Based on 2 h/day heavy AI coding at GPT-4o pricing with 70% prompt reduction applied. 2 Measured across sessions where LoopGuard detected 3+ repeat loops per day.

Live session
Claude fixed the file.
The bug came back anyway.
loop pressure
Session timeline
32 min lost
14:03
First repeat
The same undefined error shows up again after another AI patch.
14:11
Pattern confirmed
LoopGuard now sees the same problem resurfacing and tracks the lost time.
14:27
Circuit breaker
You get a clear alert before the next retry buries the root cause even deeper.
Focused context
340-line file · 24 lines kept
7% kept
summary.tsx
import { fetchInvoices } from './billing';
import { formatCurrency } from './format';
const rows = invoices.map((invoice) => formatCurrency(invoice.total));
^ TypeError: cannot read properties of undefined
function Summary({ invoices }: Props) {
return <InvoiceTable rows={rows} />;
Keep the failing window, nearby definitions, and recent edits
Drop the long helper branches and untouched boilerplate
Reuse prior reads so the same file is not resent over and over
Runs inVS CodeCursorWindsurf·Free · no account required · works offline
How it works

One guardrail layer.
Three concrete wins.

Loop Detection

Catch the repeat before it eats the hour

LoopGuard watches diagnostics and repeated edits locally. When the same error resurfaces, LoopGuard steps in — before you burn another half hour on the same bad fix.

Context Engine

Shrink the prompt before it hits the bill

Instead of pasting a whole file, LoopGuard lifts the error window, the nearby definitions, and the parts that changed. Smaller prompts mean fewer wasted tokens and less money burned on noise.

Visibility

See the waste in plain numbers

The extension and dashboard make the cost visible: time lost, tokens trimmed, and estimated API spend avoided across real coding sessions.

What a loop looks like
Same error.
Different patch.
Turn 1
AI proposes a fix. The error disappears for one edit.
Turn 2
The same failure returns in a nearby shape. You try again.
Turn 4
You are now paying for repetition instead of progress.
⚠️
LoopGuard detected a loop
Same error 3×  ·  23 min wasted
Why it matters

Stop the retry spiral
before it hardens.

AI coding tools are fast at the first guess and expensive at the fifth. LoopGuard is there for the moment the session stops learning. It measures the waste, points out the repetition, and gives you a cleaner next move instead of another blind rerun.

Diagnostic loops and repeated edit patterns are both tracked locally.
Session metrics update live in the sidebar panel and status bar as you code.
The web dashboard is optional. Core protection still works fully offline.
Context engine

Smaller prompts.
Cleaner answers.

LoopGuard does not try to summarize everything. It picks the parts the model actually needs: the failing lines, nearby definitions, and the pieces that changed. That keeps prompts readable and makes retries more deliberate.

One-click copy
Use Copy Optimized Context to get a focused prompt instead of pasting the whole file.
Delta-first reads
Each file read is hashed into a session cache. Subsequent reads send only the diff — the model never sees the same unchanged lines twice.
Error window first
The failing lines, nearby definitions, and recent edits come first. Boilerplate is dropped.
Works in every session
No setup. The context engine runs automatically when you copy context from the extension.
Prompt payload
What the model sees next
Focused read
Without LoopGuard
Whole file
Unrelated helpers
Old branches
Repeated imports
Re-sent context
~12,000 tokens
With LoopGuard
1. Exact failing window
2. Nearby definitions and signatures
3. Recent edits that changed the behavior
4. Smaller prompt shape for the next retry
~3,600 tokens — 70% less
14,200 → 1,100 tokens on a real session read
Install

One click in the editor.
No terminal required.

VS Code · Cursor · Windsurf — recommended
1
Search "LoopGuard" in the Extensions panel, or click Install extension above.
2
Open any workspace. Loop detection starts automatically — no configuration.
3
The sidebar panel and status bar show live metrics. That's it.
Install extensionView setup guide

Opens VS Code Marketplace

Roadmap

Three versions shipped since launch.
v4 — multi-session memory — now in active development.

See the full feature list for every version — what each one adds for VS Code, Cursor, Windsurf, Claude Code, Codex CLI, and GitHub Copilot. v4 brings cross-session pattern memory and proactive loop prediction.

v1Extension Corev2CLI + Sync Pipelinev3Intelligence Layerv4Multi-session Memory
View full roadmap
Common questions

Before you install.

Do I need an account?
No. Loop detection and context filtering run entirely on your machine with no sign-in required. Create a free account later only if you want session history on the web dashboard.
Does this send my code anywhere?
Never. All processing happens locally inside the extension. If you sign in, the backend stores only anonymized metrics — counts and durations. No source code, no file contents, no file paths.
Does it work offline?
Yes. The core extension is entirely offline-capable. Loop detection, context filtering, and the sidebar panel all work without an internet connection. Backend sync is optional and best-effort.
Is LoopGuard really free? Will it stay free?
Yes. Loop detection, focused context, sidebar panel, and MCP integration are free — there is no paid tier that gates any of these features. If it helps you, you can support the project voluntarily.

Caught the loop on turn 3 and pointed me at the actual root cause. Saved me from spending another hour on the same Prisma migration error.

Backend engineer, fintech startup

The focused-read output is genuinely different from just copy-pasting a file. The model stops re-explaining things it already knows.

Solo developer, SaaS product

Status bar showing '32 min lost in loops' was the wake-up call I needed. Didn't realise how much time was going into repetition.

Full-stack developer, agency

Support the project

LoopGuard stays free.
Back the build if it helped.

The core product is still free. If LoopGuard saved you a late night, a broken deploy, or a few wasted agent retries, you can keep it moving with a coffee instead of a paywall.

Buy me a coffee
Support LoopGuard without locking core features.
Open source
Star the repo, file issues, or follow the next changes.
Need sync history? Create an account later. Need protection right now? Install the extension and start coding.
For developers building with AI agents
Agent integration

Wire LoopGuard into your
automated workflows.

Already using the VS Code extension? Add the local helper binary to give Claude Code, Cursor, Codex CLI, and other agents focused read, search, and shell compression tools via MCP — no cloud, no API key, no extra cost.

Claude CodeCursorCodex CLIWindsurfGitHub CopilotGemini CLI
One command per agent
Claude Code
loopguard-ctx setup --agent=claude

MCP + shell hook + guidance file

Cursor
loopguard-ctx setup --agent=cursor

MCP + cursor rule file

Codex CLI
loopguard-ctx setup --agent=codex

MCP + local instruction file

Gemini CLI
loopguard-ctx setup --agent=gemini

MCP + instruction layer

Run loopguard-ctx doctor to verify every layer is green. Install via brew install loopguard-ctx or npm i -g loopguard-ctx-bin.

Full agent setup guide