Built with Claude, for Claude.
Stop paying
full price
twice.
Automatic prompt caching for Claude Code. Detects stable content — system prompts, tool definitions, file reads — and marks them so you pay 90% less on every repeated turn.
# One command. That's it.
/plugin install flightlesstux/prompt-caching
# No npm. No config file. No restart.
# Savings start on the next turn.
cost reduction
How prompt-caching works
Anthropic's caching API stores stable content server-side for 5 minutes. Cache reads cost 0.1× instead of 1×. This plugin places the breakpoints automatically.
BugFix Mode
Detects stack traces in your messages. Caches the buggy file + error context once. Every follow-up only pays for the new question.
Refactor Mode
Detects refactor keywords + file lists. Caches the before-pattern, style guides, and type definitions. Only per-file instructions re-sent.
File Tracking
Tracks read counts per file. On the second read, injects a cache breakpoint. All future reads cost 0.1× instead of 1×.
Conversation Freeze
After N turns, freezes all messages before turn (N−3) as a cached prefix. Only the last 3 turns sent fresh. Savings compound.
Benchmarks
Measured on real Claude Code sessions with Sonnet. Break-even at turn 2.
| Session type | Turns | Without caching | With caching | Savings |
|---|---|---|---|---|
| Bug fix (single file) | 20 | 184,000 tokens | 28,400 tokens | 85% |
| Refactor (5 files) | 15 | 310,000 tokens | 61,200 tokens | 80% |
| General coding | 40 | 890,000 tokens | 71,200 tokens | 92% |
| Repeated file reads (5×5) | — | 50,000 tokens | 5,100 tokens | 90% |
Install prompt-caching
One command for Claude Code. For Cursor, Windsurf, ChatGPT, Perplexity, Zed, Continue.dev, and any other MCP-compatible client — use the npm install path below.
Run this inside Claude Code — no npm, no config file, no restart needed:
/plugin install flightlesstux/prompt-caching
Claude Code's plugin system handles everything automatically. The get_cache_stats tool is available immediately after install.
Install globally via npm
npm install -g prompt-caching
Add to your client's MCP config
Cursor → .cursor/mcp.json · Windsurf → MCP settings · Any MCP client → stdio
{
"mcpServers": {
"prompt-caching": {
"command": "prompt-caching"
}
}
}
Open source · MIT · Zero lock-in