.claude/skills/cache-analysis/SKILL.md
Analyze Claude Code prompt cache efficiency and costs. Use when user asks about cache performance, token usage, session costs, how much a session cost, wants to optimize prompt caching, when costs seem high, when context window is filling up, or mentions cache-analyzer/cache hits/token costs/session metrics/cost analysis.
npx skillsauth add dmitryprg-ai/cursor-develop-autorules cache-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Measure and optimize prompt cache performance using claude-cache-analyzer. Cache efficiency directly impacts cost — a 95% hit rate saves ~80% vs no caching.
pip install claude-cache-analyzer
# All recent sessions
claude-cache-analyzer "C:\Users\Divan\.claude" --top 10
# Specific project
claude-cache-analyzer "C:\Users\Divan\.claude\projects\PROJECT_DIR" --top 5
# Grouped by project
claude-cache-analyzer "C:\Users\Divan\.claude" -g
# Export to JSON for programmatic analysis
claude-cache-analyzer "C:\Users\Divan\.claude" --export-json metrics.json
# Detailed single session
claude-cache-analyzer -s SESSION_ID
| Metric | What It Means | Good Value | |--------|---------------|------------| | Cache hit rate | % of tokens served from cache | > 80% | | Efficiency score | Overall cache utilization [0..1] | > 0.70 | | Net savings | Money saved minus cache write overhead | Positive | | Savings % | Cost reduction vs no-cache baseline | > 70% |
| Grade | Efficiency Score | Action | |-------|-----------------|--------| | A | >= 0.70 | Excellent — no changes needed | | B | >= 0.50 | Good — minor optimization possible | | C | >= 0.30 | Fair — review instruction structure | | D | >= 0.10 | Poor — rules/skills may be too dynamic | | F | < 0.10 | Critical — architecture needs rework |
If cache efficiency is low, the cause is usually rules or context that change too frequently between turns:
Cache efficiency = cost efficiency. On this project, 95% hit rate saves ~$119 per session. A drop to 50% would triple the cost. Monitoring cache performance catches regressions from rule/skill changes before they become expensive.
development
Scan codebase for technical debt and fix safely with TDD. Use to find oversized files, duplicated code, code smells, and refactor safely. Workflow - SCAN, TEST CASES, REFACTOR, VERIFY. Keywords - techdebt, tech debt, duplicates, code quality audit.
development
Test-Driven Development workflow with strict Red-Green-Refactor cycle. Use when developing features with TDD, writing tests before code, or when test-driven approach is needed. MANDATORY order - test cases table BEFORE code, failing tests BEFORE implementation.
testing
Review work session quality and capture improvements. Use at end of session, after large tasks, after series of errors, or when user asks for session review, retrospective, lessons learned. Records improvements to backlog.
data-ai
Analyze data, investigate datasets, work with CSV/parquet/pandas/dataframes. Use when analyzing data, exploring datasets, running experiments, or when user mentions data, analysis, parquet, csv, pandas, dataframe, statistics, investigation.