Token-Guard — Caching & Autonomy Optimizer

    1

    Cut agent input-token cost up to 80% and hard-stop runaway loops with cache-aware compaction, non-destructive offload, and deterministic loop guards.

    $39

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Token-Guard — Caching & Autonomy Optimizer

    Example session with this skill installed

    I'm starting a large refactor. Initialize Token-Guard to manage this session. Set a budget of 50 iterations and offload any tool outputs larger than 2KB.

    • Read your context and instructions
    • Compiled the token-guard

    I have initialized the Token-Guard control layer for this refactoring session. I will monitor the execution budget and apply cache-aware compaction as the context grows. Tool outputs exceeding 2KB will be offloaded to local storage with pointer references maintained in the active window.

    Session Optimization Plan

    ComponentPolicy / LimitStrategy
    Loop Guard50 IterationsHard-stop at iteration 45 for manual review.
    Token Budget200k Input TokensMonitor via scripts/token_guard.py.
    Offload Trigger> 2,048 BytesMove to logs/offload_[timestamp].jsonl.
    CompactionEvery 5 turnsPreserve system prefix; emit delta summaries.

    Initial Budget Ledger

    {
      "max_iterations": 50,
      "token_budget": 200000,
      "used": 450,
      "halted": false,
      "session_start": "2023-10-27T10:00:00Z"
    }
    

    Next steps

    1. Run python scripts/token_guard.py --limit 50 in a separate terminal to enable external process monitoring.
    2. Approve the creation of the ./logs directory for artifact offloading.
    3. Proceed with the first step of the refactor; I will alert you before any destructive compaction occurs.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Reduce API costs by up to 80% through cache-stable context management.Prevent runaway agent loops from exhausting token budgets.Offload large tool outputs to local files without losing context.Maintain high performance in long-horizon coding and research tasks.

    About this skill

    Token-Guard keeps long-horizon coding-agent sessions cheap and bounded. It's a bundled control layer of three cooperating SKILL.md sub-skills:

    • Cache-aware compaction — protects a byte-stable system+early prefix and emits incremental delta summaries, so prompt-cache hits stay near 90% (no cache-miss spikes from naive rewrites).
    • Non-destructive offload — moves verbose tool output and documents to local JSONL/temp files with a searchable pointer, so nothing is deleted and the agent can re-read on demand.
    • Deterministic loop guards — enforce hard max-iteration, step-wise token-budget, and retry caps the model cannot override, stopping Infinite Agentic Loops that otherwise burn $50/day.

    What you get: a root SKILL.md orchestrator + 3 sub-skills (compaction, offload, loop-guard), an MIT-licensed helper script, and worked examples. Net effect: up to ~80% lower input-token cost on long sessions, and a hard stop on runaway loops.

    Human-in-the-Loop by design: before any destructive compaction or offload, Token-Guard presents a plan and waits for your explicit approval. It never invents metrics or silently drops your code.

    Works with Claude Code, Cursor, Gemini CLI, Codex CLI, and any agent that loads SKILL.md.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 5 days ago

    • Passed all security checks, Safe to install

    Listed5 days ago

    Frequently Asked Questions