MCP Plugin · Open Source · MIT

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.

Claude Code
# One command. That's it.

/plugin install flightlesstux/prompt-caching

# No npm. No config file. No restart.
# Savings start on the next turn.
90% average token
cost reduction
90% token cost reduction
4 session modes
0 config required
MIT open source

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.

stack trace detected
♻️

Refactor Mode

Detects refactor keywords + file lists. Caches the before-pattern, style guides, and type definitions. Only per-file instructions re-sent.

refactor keywords + files
📂

File Tracking

Tracks read counts per file. On the second read, injects a cache breakpoint. All future reads cost 0.1× instead of 1×.

always on — all modes
🧊

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.

turn count threshold

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%
Cache creation costs 1.25× normal. Cache reads cost 0.1×. Every turn after the first is pure savings.

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.

Claude Code recommended

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.

Cursor · Windsurf · ChatGPT · Perplexity · Zed · Continue.dev · any MCP client
1

Install globally via npm

npm install -g prompt-caching
2

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

Ready to cut your Claude Code
token costs by 90%?