<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
escapeboy/claude-code-kit/cache-inspector
──Details
PublishedOctober 17, 2026 at 05:04 AM
Content Hashsha256:5b2cec4d87336d33...
Git SHA09e25f6e2b9d
──Files
Files (1 file, 4.8 KB)
SKILL.md4.8 KBactive
SKILL.md · 88 lines · 4.8 KB

name: cache-inspector description: Analyze prompt cache hit rates, estimate cost savings from cached system prompts and memories, and recommend improvements to caching strategy. Use when checking cache performance, investigating high token costs, optimizing cache hit rates, or diagnosing slow cache warmup. version: 1.0.0


/cache-inspector — Prompt Cache Monitor

Inspects the Claude prompt caching system to report hit rates, cost savings, and optimization opportunities. Prompt caching saves 90% on re-reads of large content (system prompts, memories, tool definitions).

When to Use This Skill (and When NOT to)

Use this skill forUse a simpler approach for
Investigating why a session's token cost is highA single expensive read you already understand — just cache that content, no analysis needed
Diagnosing a low or slow-warming cache hit rateA fresh session that has simply not warmed yet — wait 2-3 messages before measuring
Deciding which memories/prompts are worth cachingContent you already know is under 1024 tokens — it can't cache; expand or merge it directly
Producing a cost/hit-rate report or tracking trend over sessionsA one-off "is caching on?" check — read ~/.claude/settings/prompt-caching.json

Start simple. Reach for this skill only when cache behaviour is actually costing tokens or you need to measure/optimize it — not to confirm a single obvious cache decision.

Usage

/cache-inspector [action]

Quick Examples

/cache-inspector # Show current status (default)
/cache-inspector status # Detailed cache status
/cache-inspector analyze # Performance analysis with trends
/cache-inspector optimize # Get actionable recommendations
/cache-inspector report # Full report (save to file)
/cache-inspector clear # Clear cache (for testing only)

Actions

Each action's full behaviour, options, and exact output shape are in references/actions.md — read it for the detail behind the summaries below.

ActionPurpose
status (default)Current cache state: active entries, session hits/savings, health verdict.
analyzeDeep performance analysis with hit-rate trend, cost impact, and optimization opportunities.
optimizePrioritized, actionable recommendations to raise the hit rate, with an estimated score delta.
reportFull report (history, cost breakdown, inventory, TTL timeline, score); --save writes to .claude/learnings/cache-performance.md.
clearClears all cached content (testing/stale-cache only). Confirms first; next session re-warms at full cost.

How caching works, config & targets

For how Claude's prompt cache behaves (what's cacheable, the ≥1024-token minimum, TTL tiers and pricing), where it is configured (~/.claude/settings/prompt-caching.json), and the target metrics that define a healthy cache, read references/caching-internals.md.

Troubleshooting

Low hit rate, entries expiring fast, or "no cache data available" — see references/troubleshooting.md.

Boundaries

Always

  • Report real numbers (hit rate, tokens saved, cost) from the session/config — never invent metrics.
  • Point fixes at the actual cause: content below the 1024-token threshold, unwarmed sessions, or bypassed caching.
  • Confirm Serena MCP is connected and prompt-caching.json is configured before claiming "no cache data".

Ask first

  • clear — clearing all cached content forces a full-cost re-warm on the next session; confirm before running.
  • Editing ~/.claude/settings/prompt-caching.json (shared, session-wide config) or moving content into memories via /ctx save.

Never

  • Run clear as a shortcut to "fix" a low hit rate — diagnose the cause first (it only makes warmup cost more).
  • Claim a cost saving the metrics don't support, or mark the cache healthy while hit rate is below target.

See Also

All versions