# token diet

> Reduce AI agent context bloat by pruning redundant instructions and sharpening vague rules without losing behavior.

token diet is a free AI agent skill on Agensi by Jeel Bhanderi, in Prompt & Skill Engineering. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Jeel Bhanderi](https://www.agensi.io/creators/jeel-bhanderi)
- Category: [Prompt & Skill Engineering](https://www.agensi.io/skills/prompt-skill-engineering)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-15
- Security: scan passed (2026-10-15); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/token-diet
- Tags: prompt-engineering, llm-ops, productivity, token-optimization

## About this skill

Stop paying for context bloat and sluggish agent performance. Large instruction files like `.cursorrules`, `CLAUDE.md`, and system prompts consume expensive tokens and cause models to lose focus. This skill audits your agent's configuration files to prune generic filler, merge duplicates, and sharpen vague rules while strictly preserving your core logic.

### What it does
- **Instruction classification** categorizes every rule into keep, merge, move, cut, or sharpen buckets.
- **Deduplication** finds redundant imperatives spread across multiple files or sections.
- **Context compression** rewrites verbose sentences into concise, imperative triggers without losing meaning.
- **Conflict detection** identifies contradictory instructions that confuse the agent.
- **Token estimation** provides before and after approximations to quantify context savings.

### How it works
1. **Initial Audit** scans the target files to measure character counts and estimate current token usage.
2. **Rule Mapping** identifies every unique instruction and labels "protected" rules that must remain untouched.
3. **Refactoring** merges duplicates, cuts fluff like "be helpful," and sharpens vague advice into concrete triggers.
4. **Validation** generates a behavior-preservation report to ensure all protected logic is present in the new version.

### Frameworks & tools
Works with any text-based instruction format including `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `SKILL.md`, MCP tool descriptions, and custom system prompts.

### Why this beats prompting it yourself
Generic "make this shorter" prompts often hallucinate new rules or accidentally delete critical safety constraints. This skill uses a systematic classification workflow and a mandatory preservation check to ensure your agent's behavior remains identical while its footprint shrinks.

### Use cases
- **Fixing "Agent Amnesia"** when long prompts cause the model to forget middle-of-file instructions.
- **Reducing API costs** by trimming unnecessary filler from every message sent to the LLM.
- **Cleaning up tech debt** in older instruction files that have grown messy over multiple iterations.
- **Standardizing instructions** across a team of different agents for better consistency.

### Known limitations
Token counts are estimates based on character ratios. It will flag but not automatically remove sensitive data like API keys. Files under 1,500 tokens may not see significant benefits.

## 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 diet 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

### What file formats and frameworks are compatible with Token Diet?

Token Diet specializes in structured instruction files like .cursorrules, CLAUDE.md, and custom system prompts, but it can optimize any text-based configuration or Markdown-heavy agent guide.

### How does the skill ensure my agent won't change its behavior after pruning?

The skill uses a strict 'Rule Mapping' process that identifies protected logic before optimization, ensuring that while the phrasing becomes more concise, the actual constraints and behaviors remain unchanged.

### What kind of token savings can I realistically expect for my agent?

While results vary based on the original file's verbosity, most users see a 20-40% reduction in token usage, which helps prevent 'middle-of-the-prompt' amnesia and lowers per-request API costs.

### Does the skill provide a report of what was changed during the optimization?

Yes, you will receive a validation report that highlights merged rules, deleted filler, and a side-by-side token estimation to verify the optimization before you deploy the new instructions.

### Is there a minimum file size or token count required for the skill to be effective?

Optimization is most effective for complex instruction sets; files under 1,500 tokens generally lack the redundancy required for the skill to provide a meaningful performance boost.

---

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.
