Claude got stuck in a loop.
ContextGuard stopped it.
Catches loop patterns and bloated output mid-session. Surfaces the root cause and offers safe intervention.
Runs 100% locally. Code and transcripts never leave your machine without action.
Free, no signup required
Claude action → npm test • same failure • attempt 1
Analyzing action sequence
Monitoring action sequence
Immediate value, no setup drama, no guesswork
1. Install the CLI
Add ContextGuard to any project in under a minute using curl, PowerShell, or npx.
2. Run locally
Everything analyzes on your machine with zero data leakage and no forced signup flow.
3. Stop the loop
Prevent repeated reads, detect root cause, and keep the session stable before spending more tokens.
Less waste, less chaos, no privacy tradeoff
Fewer repeat reads
ContextGuard catches the loop before it burns context, time, and patience.
Less wasted spend
Token telemetry reveals where inputs, outputs, and cache reads are silently drifting.
No external leak
All audits happen locally; only explicit opt-in pushes aggregated stats to the dashboard.
Precision Control Over Claude Code Loops & Costs
From deep cache and token cost telemetry to live loop interruption and invariant rule retention.
Cost & Prompt Caching Telemetry
Real-time visibility into token input/output, cache write efficiency, and dynamic session cost.
Sub-penny precision accounting calibrated to official Anthropic model pricing.
Granular accounting of context payload vs generated code stream.
Continuous tracking of the 5-minute Prompt Caching window saving up to 90% cost.
Maintaining 96%+ cache reuse to maximize 5-hour quota availability.
Interactive Terminal: Loop Interception & Recovery
Step-by-step reproduction of a real Claude Code session: repeating errors, circuit breaker engagement, evidence telemetry, and stabilization.
Instant .jsonl Session Audit
Drop a Claude Code session file or test the sample transcript to see real costs, loops, and cache efficiency.
Transcripts are parsed purely in JavaScript inside your browser. Zero server uploads.
You see the problem before it burns your budget and context window.
ContextGuard does more than inspect a transcript. It intercepts repeated failure patterns, reveals the root cause, and helps restore session stability before more tokens are wasted.
How ContextGuard Intercepts Loops in Claude Code
Zero cloud code shipping, no network proxying, no binary patching. 100% local client-side Runtime Guard.
ContextGuard vs Writing Your Own Hooks
Claude Code hooks are powerful, but reliable loop prevention requires deep AST and git delta heuristics. Here is the architectural difference:
Swipe to see the full comparison
| Capability | DIY Custom Bash Hook | ContextGuard Runtime Guard |
|---|---|---|
| Loop Detection Logic | ✕Primitive exit code check (false-positives during iterative TDD) | ✓AST tool signatures + git diff delta inspection (triggers strictly on 0 code progress) |
| Token Savings Valuation | ✕Zero visibility into prompt cache boundaries | ✓Full amortized carry-forward valuation across subsequent turns + 5-min cache tracking |
| Claude Loop Recovery | ✕Hard block (Claude often guesses blindly or repeats identical query) | ✓Generates structured evidence dossier showing root cause so Claude pivots instantly |
| Upstream Compatibility | ✕Custom scripts break on hook schema updates | ✓Maintained, compiled zero-dependency binary tested against every Claude Code release |
Choose Your Level of Protection
The CLI is free forever for offline inspection. Pro adds active real-time runtime defense with instant automated activation.
Free Community
Local transcript audit, historical loop inspection, and config linting.
- ✓Local CLI audit of .jsonl session files
- ✓CLAUDE.md & MCP configuration cleanup
- ✓Cost estimation calibrated to Anthropic rates
- ✓100% offline processing on your local disk
- ✕No active real-time loop interception
- ✕No Continuity Guard (rules after /compact)
- ✕No Output Guard (test log distillation)
Pro Monthly
Active real-time protection for developers building with Claude Code daily.
- ✓Live Loop Interceptor: stops no-progress loops in runtime
- ✓Output Guard: compresses verbose test dumps & noise
- ✓Continuity Guard: preserves active rules across /compact
- ✓5-Hour Quota Radar & Velocity Alerts
- ✓Lossless Vault: local offline archive without token burn
- ✓Instant license key activation & cloud sync
Pro Lifetime
Lifetime access to all Pro capabilities and future updates with zero recurring fees.
- ★All Pro capabilities included forever
- ★No monthly subscriptions or recurring fees
- ★Priority access to new modules & beta updates
- ★Direct founder priority technical support
- ★Transferable license key
Team & Organization
Centralized quota visibility, team rule synchronization, and organization budget safety.
- ✓All Pro features for every team developer
- ✓Central team dashboard with cache reuse metrics
- ✓Security rule & policy synchronization
- ✓Centralized billing and invoice management
- ✓Dedicated team support
What are you paying for?
Based on typical workloads (10–15 hrs/week with Claude Code), intercepting runaway loops and optimizing prompt cache windows saves an estimated $40–$60/month in avoidable token waste. Explore your exact usage scenario in the interactive calculator below.
Payment Methods
Security Guarantee: Transactions processed via certified gateways (FreeKassa, TryBit). No card numbers stored.
- ✓Credit & Debit Cards (Visa, Mastercard, Mir)
- ✓Cryptocurrency (USDT TRC20, USDC Polygon, BTC, ETH, TON)
- ✓Fast Payment System (SBP)
Your ContextGuard Pro license activates automatically upon confirmation. You will instantly receive your activation token for one-line CLI linkage: contextguard login --key <YOUR_KEY>.
Put the product to work and stop paying for endless repeat loops.
Transparent Privacy Architecture
Your code and prompts never leave your local machine. Cloud telemetry is strictly opt-in and restricted to high-level numeric metrics.
Local Runtime (CLI, Plugin, Web Audit)
All parsing, transcript analysis, CLAUDE.md linting, and loop interception happen strictly on your computer.
- ✓Source code, git diffs, and repository files
- ✓User prompts and Claude model output text
- ✓CLAUDE.md contents, .env files, and secret tokens
- ✓Raw session transcripts (~/.claude/projects/)
- ✓Local hook telemetry vault (~/.contextguard/vault/)
Cloud Dashboard (Team Analytics)
Sent only when explicitly running npx contextguard audit --push or signing into the dashboard.
- ✓Aggregated token counts (Input / Output / Cache)
- ✓Estimated session cost in USD and cache hit rate
- ✓Anonymous hostname label for team aggregation
- ✓Account email and Pro license status
What ContextGuard Never Does
Architecturally isolated perimeter with zero telemetry leak, no proxying, and zero access to proprietary code.
- ✕Never reads or uploads source code to the cloud
- ✕Never intercepts your Anthropic or OpenAI API keys
- ✕Never transmits telemetry without an explicit --push flag
- ✕Never sells or shares user data with third parties
Data Processing & Isolation Diagram
Clear visual separation of the local perimeter and optional cloud layer
ContextGuard hooks connect locally via Node.js middleware. Token analysis and loop detection run instantly in-process with zero external network sockets.
Frequently Asked Questions
Everything you need to know about privacy, pricing, compatibility, and real-time runtime defense in ContextGuard.
01Where are my prompts, source code, and repository files sent?↓
Nowhere, ever. ContextGuard operates under a strict Local-First architecture. All parsing, .jsonl transcript auditing, loop interception, and config linting run entirely in your local environment. Not a single line of code or prompt is transmitted. Optional cloud dashboard and team analytics activate strictly via opt-in (--push) and transmit only anonymous aggregated token counts.
02Do I need a separate Claude paid subscription or an Anthropic API key?↓
ContextGuard works alongside the official Claude Code CLI under any authentication mode: whether you use a Claude Pro / Max web subscription or a direct Anthropic API key. ContextGuard does not require its own API key and does not alter your billing relationship with Anthropic.
03How does ContextGuard calculate dollar cost estimations?↓
Costs are calculated directly from the token usage fields in official Claude Code session logs and official Anthropic API pricing rates across Sonnet, Opus, and Haiku models, including Prompt Caching write and 90% read discount tiers.
04Does runtime inspection slow down Claude Code command execution?↓
No. ContextGuard hooks execute locally with negligible overhead (< 2ms median, p95 < 4ms). In fact, by compressing massive test failure dumps via Output Guard, ContextGuard actively speeds up Claude's generation latency.
05Which operating systems and terminal environments are supported?↓
ContextGuard is cross-platform and natively supports macOS (Apple Silicon M-series & Intel), Linux (Ubuntu, Debian, Fedora, Arch), and Windows (PowerShell, WSL2, CMD). It only requires Node.js 18+.
06How accurate are the token metrics and loop detection algorithms?↓
Token accounting is exact relative to official Claude Code session logs generated by Anthropic's backend. The loop detector inspects tool call parameters, exit-code sequences, and git diff deltas to prevent false positives.
07How does subscription cancellation work and is there a refund guarantee?↓
You can cancel your monthly subscription with a single click from the dashboard at any time with no questions asked. We offer a full 14-day money-back guarantee on all initial purchases. For any billing questions or refund requests, our team is available 24/7 at support@contextguard.tech.
08What is included with the Pro Lifetime license?↓
Pro Lifetime is a one-time $79 investment instead of recurring fees. You receive permanent Pro access to all current and future ContextGuard CLI modules, a personal license key, beta channel access, and direct technical support from the founders (team seat licenses and centralized organization cloud compute billed separately).
09Why use ContextGuard instead of writing a custom Claude Code hook script?↓
A simple custom hook can intercept basic exit codes, but cannot safely distinguish genuine iterative work from token-burning loops. ContextGuard performs real-time git working-tree delta analysis, amortized token savings valuation across subsequent session turns, automated prompt-cache boundary tracking, and generates structured recovery evidence that forces Claude to break out of failure loops without losing session context.