# Token Guardian: Plan Context Budget Without Losing Evidence

> Spend context where it matters: rank what the agent must read, keep required evidence even over budget, defer the rest, and report only savings you actually measured.

Token Guardian: Plan Context Budget Without Losing Evidence is a free AI agent skill on Agensi by a365ngay, in Productivity. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [a365ngay](https://www.agensi.io/creators/a365ngay)
- Category: [Productivity](https://www.agensi.io/skills/productivity)
- Version: 0.1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/token-guardian-plan-context-budget-without-losing-evidence
- Tags: productivity, python, project-management, documentation

## What it does

- Prioritizes essential files so the AI never skips important instructions to save space
- Reads exact duplicates once, only when their content and role are interchangeable
- Calculates data sizes in tokens or bytes to stay within your specified limits
- Generates a report showing exactly what evidence was used and what was deferred
- Handles large tasks by suggesting a phased approach if the data exceeds the budget

## Who it's for

- **Developers working in large codebases:** Stop your AI from getting lost or hitting limits when working on big projects. Try: "Review this repo and fix the auth bug within a 30k token budget."
- **Technical writers managing long documents:** Keep your AI focused on the important parts of your text without wasting space on repeats. Try: "Edit these ten chapters but keep the total context under 50,000 bytes."
- **Founders auditing technical assets:** Get a clear report on what files your AI is actually reading and how much space they take. Try: "Audit the files in the source folder and plan a migration within a strict budget."

## About this skill

When you give an AI agent too much information at once, it can get confused, miss details, or simply stop working because the "context window" is full. This skill helps your AI agent manage its memory by planning exactly what to read, what to skip, and how to stay within a specific budget. It acts like a filter that ensures the most important files are prioritized while duplicate data is removed.

### How it works
1. You provide a task and a list of files or data you want the AI agent to look at.
2. The skill identifies which items are required and which are optional based on your goal.
3. It uses a planning script to calculate the size of your data in bytes or tokens to see if it fits your budget.
4. The AI agent removes exact duplicates to save space while keeping all the necessary evidence.
5. You receive a report showing what was used, what was deferred, and how much of your budget remains.

### Frameworks & tools
This skill uses JSON files for planning and a Python script to calculate budgets and manage data lists. It also includes Markdown templates for reporting its findings to you.

### Why this beats prompting it yourself
Plain AI agents often try to read everything at once, which leads to "context overflow" or forgotten instructions. This skill forces the AI to create a formal plan and verify sizes before it starts working, preventing it from silently dropping important files when things get crowded. It also uses math via a script to get accurate measurements instead of just guessing how much it has read.

### Use cases
- Analyzing a large software project without hitting model limits.
- Cleaning up repeated data when merging multiple long text documents.
- Planning a multi-step task that needs to be broken into smaller chunks.
- Tracking exactly how much data your AI agent consumes for a specific job.

### Known limitations
This skill cannot see your actual billing or subscription limits. It only manages the data you explicitly give it and relies on the sizes you or the host provide.

## Requires

- Optional: Python 3.10+

## Technical details

Uses a Python 3.10+ engine (scripts/engine.py) to process UTF-8 JSON inputs for budget planning. It supports SHA-256 hashing for deduplication and uses a structured schema (references/input-schema.json) to manage item priorities and byte/token counts. The workflow is designed for LLMs with large context windows to avoid overflow by calculating evidence requirements before execution.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Token Guardian: Plan Context Budget Without Losing Evidence skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Why would I need this skill if my AI agent can already read files?

This skill acts as a memory filter for your AI agent. It stops the agent from getting confused by too much data by creating a plan to prioritize essential information, removing duplicate files, and staying within a specific token or byte budget.

### What kind of results will I see after the agent uses this?

You will receive a clear report showing exactly which files were used, which were skipped to save space, and how much of your budget remains. It uses a planning script to give you accurate measurements of data usage instead of just guessing.

### Do I need any special software to make this work?

To get the most accurate measurements, your agent needs access to Python 3.10 or newer on its system. If Python is not available, the agent will still follow the logic manually but will flag that the formal script checks were not run.

### Can this skill lower my monthly AI subscription costs?

This skill cannot see your actual billing, subscription limits, or the hidden reasoning steps the AI takes. It only manages the specific text and files you provide and relies on the sizes or limits you tell it to follow.

### How do I tell my AI agent to start using these tools?

You can tell your agent to use this skill when you have a large project or a long list of documents to analyze. Simply provide your task and the files, then ask the agent to create a context budget plan before it starts reading.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
