# Cachecut

> Identify and fix prompt-cache busters to reduce LLM API costs using measured hit-rate optimization.

Cachecut is a paid AI agent skill on Agensi by Sujal Tangde, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $1.9 (one-time purchase)
- Creator: [Sujal Tangde](https://www.agensi.io/creators/sujal-tangde)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-28
- Security: scan passed (2026-11-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/cachecut
- Tags: llm-ops, python, openai, anthropic, cost-optimization, prompt-engineering

## About this skill

High LLM bills often stem from a 0% cache hit rate caused by a single changing byte in your prompt prefix. This skill identifies cache-busters like timestamps, unsorted JSON, or dynamic user data that silently break prompt caching, and restructures your code to fix them.

### What it does
- **Automatic scanning** of your repository to locate all LLM call sites and potential cache-breaking patterns.
- **Hit rate measurement** by analyzing raw usage objects or replaying traffic to establish a cost baseline.
- **Prompt restructuring** to move dynamic variables after static system instructions, tools, and RAG context.
- **Deterministic ordering** of tool definitions, examples, and JSON keys to ensure prefix consistency.
- **Provider-specific implementation** including Anthropic's `cache_control` and OpenAI's prefix optimization rules.
- **Savings verification** through before-and-after reports with real measured token counts.

### How it works
1. **Inventory**: Run the scan script to map out provider models, call sites, and static prefix sizes.
2. **Baseline**: Capture current `cached_tokens` usage from logs or test requests to calculate the existing hit rate.
3. **Diagnose & Fix**: Move busters like "Current Date" or user IDs out of the prefix and enforce sorted serialization.
4. **Report**: Generate a table showing the hit rate delta and the percentage reduction in input token costs.

### Frameworks & tools
Works with Python-based LLM applications using OpenAI, Anthropic, or Gemini SDKs. Includes specialized scripts for repo scanning and usage log analysis.

### Why this beats prompting it yourself
Generic prompts often miss the subtle provider-specific rules, like Anthropic's explicit opt-in requirement or OpenAI's 1024-token block minimums. This skill uses measured usage data to prove savings rather than guessing, ensuring you don't pay "cache-write" premiums for prefixes that never get reused.

### Use cases
- **Cost optimization** for RAG pipelines with large, static document corpora.
- **Fixing broken caching** in agents that use frequently changing tool definitions or system prompts.
- **Scaling chat applications** by optimizing append-only conversation history.
- **Pre-ship audit** to ensure new LLM features are cache-ready before hitting production.

### Known limitations
Does not support prompts where the static prefix is below the provider's minimum cacheable threshold. Requires access to raw usage logs or the ability to run test traffic.

## Requires

- Python

## 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 Cachecut skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does Cachecut specifically reduce my LLM API costs?

Cachecut identifies and fixes 'cache-busters'—minor dynamic elements like timestamps or unsorted JSON that reset your prompt prefix—ensuring that your static instructions and RAG context are successfully cached by providers to lower your API bills.

### What exactly is included in the Cachecut package?

The skill includes a repository scanner, diagnostic scripts for log analysis, and implementation templates optimized for Anthropic's cache_control and OpenAI's prefix requirements.

### Which AI frameworks and model providers are compatible with this skill?

Cachecut works with Python-based applications utilizing the OpenAI, Anthropic, or Gemini SDKs, and is particularly effective for RAG pipelines and agents with large system prompts.

### What is the initial setup process for scanning my codebase?

Setup involves running the included inventory script on your repository and providing access to your usage logs or a small sample of test traffic to establish a cost baseline.

### Does Cachecut account for the different caching thresholds across various providers?

Yes, the skill includes logic to ensure your static prefixes meet the minimum token requirements (such as OpenAI's 1024-token blocks) so you don't incur 'cache-write' fees for prompts that are too short to be cached.

### Are there any scenarios where Cachecut might not improve my cache hit rate?

Cachecut is designed for static or semi-static prefixes; if your entire prompt changes completely with every request and shares no common header, you may not see significant savings.

---

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.
