# prompt-caching > An open-source MCP plugin that automatically places prompt cache breakpoints for Claude API calls, reducing token costs by up to 90% on repeated turns. prompt-caching is an open-source MCP plugin built for Claude Code and any MCP-compatible client that automatically detects stable content — system prompts, tool definitions, and file reads — and inserts Anthropic cache_control breakpoints so you pay 0.1× instead of 1× on repeated turns. It requires zero configuration and starts saving on the very next turn after install. The plugin ships four intelligent session modes and provides observability tools like `get_cache_stats` and `analyze_cacheability` that Claude Code's built-in caching does not expose. - **BugFix Mode** — *Detects stack traces in your messages, caches the buggy file and error context once, so every follow-up only pays for the new question.* - **Refactor Mode** — *Detects refactor keywords and file lists, caches the before-pattern, style guides, and type definitions, sending only per-file instructions fresh.* - **File Tracking** — *Tracks read counts per file; on the second read it injects a cache breakpoint so all future reads cost 0.1× instead of 1×. Always on across all modes.* - **Conversation Freeze** — *After N turns, freezes all messages before turn (N−3) as a cached prefix so only the last 3 turns are sent fresh, compounding savings over long sessions.* - **Zero-config install for Claude Code** — *Run two `/plugin` commands inside Claude Code — no npm, no config file, no restart required.* - **npm install path for other clients** — *Install globally via `npm install -g prompt-caching-mcp` and add a single JSON stanza to your MCP client config (Cursor, Windsurf, Zed, Continue.dev, etc.).* - **Cache observability** — *`get_cache_stats` reports hit rate and cumulative token savings; `analyze_cacheability` dry-runs a prompt to show exactly where breakpoints land.* - **Broad model support** — *Works with Claude Opus 4/4.1/4.5/4.6, Sonnet 3.7/4/4.5/4.6, Haiku 3/3.5/4.5, with cache lifetimes of 5 minutes (ephemeral) or 1 hour.* - **MIT licensed** — *Fully open source with zero vendor lock-in; contributions welcome via the public GitHub repository.* ## Features - Automatic cache breakpoint placement - BugFix Mode - Refactor Mode - File Tracking - Conversation Freeze - get_cache_stats tool - analyze_cacheability dry-run tool - Zero configuration required - Claude Code plugin marketplace support - npm global install for MCP clients - 90% average token cost reduction - MIT open source license ## Integrations Claude Code, Anthropic SDK, Cursor, Windsurf, ChatGPT, Perplexity, Zed, Continue.dev ## Platforms CLI, API, DEVELOPER_SDK ## Pricing Open Source ## Links - Website: https://prompt-caching.ai - Documentation: https://github.com/flightlesstux/prompt-caching - Repository: https://github.com/flightlesstux/prompt-caching - EveryDev.ai: https://www.everydev.ai/tools/prompt-caching