Set up LoopGuard
Start with the extension if you want loop alerts inside your editor. Add the local helper when you want your AI agent to read only the code that matters — not whole files — and get cleaner terminal output.
What you get in 60 seconds
- →Loop alerts — LoopGuard notices when you keep hitting the same error and tells you before you waste another hour.
- →Focused context copy — instead of pasting an entire file into AI chat, copy only the few lines that actually matter.
- →Smaller AI prompts — the helper trims noisy terminal output so your AI agent gets a compact, useful summary instead of 3,000 lines of npm logs.
Install the VS Code extension in VS Code, Cursor, or Windsurf and start coding right away.
Install loopguard-ctx to let your AI agent read only the relevant code, not whole files. Works with Claude Code, Cursor, Codex CLI, and more.
VS Code
extensionInstall from Marketplace
Search for LoopGuard in the Extensions panel, or install from the terminal:
code --install-extension LoopGuard.loopguardThe bundled helper is included in the extension package. No separate Rust install is required for the editor workflow.
Open any workspace
LoopGuard activates automatically. The status bar item appears, loop detection starts, and Copy Optimized Context is ready to use.
Optional: sign in for history
Use this only if you want web dashboard history and synced session metrics.
LoopGuard: Sign InCore loop detection and focused context still work fully without an account.
Cursor
extension + optional MCPInstall the LoopGuard extension in Cursor
Cursor can use the same extension as VS Code. Open the Extensions panel and install LoopGuard there first.
Use the editor features right away
Loop alerts, focused context copy, and the in-editor dashboard all work the same way as in VS Code.
Optional: add agent tools for Cursor chat
If you want focused MCP reads inside Cursor’s agent flow, choose one of these:
LoopGuard: Configure MCP ServerA picker appears — select Cursor from the list.
or from your project root:
loopguard-ctx setup --agent=cursor~/.cursor/mcp.json and, when run from a project root, adds .cursor/rules/loopguard-ctx.mdc so the agent starts from the focused LoopGuard tools.Windsurf
extension + optional MCPInstall the LoopGuard extension in Windsurf
Use Windsurf’s extension support exactly like VS Code. Install LoopGuard from the Extensions panel.
Work normally inside the editor
Loop detection, focused context copy, and sign-in behave the same way as they do in VS Code.
Optional: add agent tools for Windsurf
Use the built-in command or the standalone helper from your project root:
LoopGuard: Configure MCP ServerA picker appears — select Windsurf from the list.
or:
loopguard-ctx setup --agent=windsurf~/.codeium/windsurf/mcp_config.json and, from a project root, installs .windsurfrules so Windsurf can favor LoopGuard’s focused tools.Codex CLI
MCPCodex can use LoopGuard as an MCP server for focused reads, compact search, and smaller shell output.
Fastest path: configure it from the extension
LoopGuard: Configure MCP ServerA picker appears — select Codex CLI from the list.
This writes the MCP server entry to ~/.codex/config.toml using the bundled helper path.
Standalone helper path
If you are not using the extension, install the helper and run:
loopguard-ctx setup --agent=codex~/.codex/config.toml and writes a small LoopGuard instruction file in ~/.codex/.Restart Codex
Restart Codex so it reloads MCP servers. If you are coming back to a long-running project later, ctx_session load can restore the last saved helper session.
Claude Code (terminal)
helper + MCPNo editor required. This path is for terminal-first agent workflows where you want LoopGuard’s focused reads and smaller shell output.
Install loopguard-ctx
Choose the method that suits you.
Homebrew (macOS / Linux)
brew tap rodthenewcomer/loopguard https://github.com/rodthenewcomer/loopguard
brew install loopguard-ctxnpm (any platform with Node 16+)
npm install -g loopguard-ctx-binOr curl installer
curl -fsSL https://loopguard.vercel.app/install.sh | sh -s -- --downloadVerify:
loopguard-ctx --versionWire Claude Code
This sets up the Claude MCP entry plus the local helper guidance files.
loopguard-ctx setup --agent=claude~/.claude.json for MCP, ~/.claude/settings.json for local hooks, and ~/.claude/CLAUDE.md for tool guidance.Restart Claude Code and verify
Restart your terminal session, then run the doctor if you want a full check:
loopguard-ctx doctorRestore previous session context
Run this inside Claude Code before starting work to restore context from the previous session:
ctx_session loadGemini CLI
MCPGemini CLI and compatible Gemini-family tools such as Antigravity can use LoopGuard as an MCP server for focused context reads and smaller shell output.
Run the setup command
loopguard-ctx setup --agent=gemini~/.gemini/settings/mcp.json and installs the local guidance file the Gemini-family tools use.Resume agent session
Restart the tool after setup so it reloads the MCP list and starts using LoopGuard’s focused helper tools.
Shell helper
bash · zsh · fishThe shell helper is the lightest-weight install: same machine, same commands, less noisy output before it reaches an AI tool.
Install the helper
If you do not already have loopguard-ctx, install it:
curl -fsSL https://loopguard.vercel.app/install.sh | sh -s -- --downloadThen verify: loopguard-ctx --version
Install shell hooks
loopguard-ctx initThis updates your shell config and adds the LoopGuard shell wrapper.
Restart your terminal
Open a new shell and try a noisy command.
$ npm install
…
[LoopGuard: compressed 3,420 → 280 tokens · 91% reduction]
Need the deeper reference, command details, or troubleshooting steps?