Tooluck logoTooluck
SKILL.md

cache-efficiency

Agent skill fromhoangsonww/Claude-Code-Agent-Monitor

Analyze prompt-cache effectiveness for Claude Code usage from the Agent Monitor dashboard — cache hit rate (total_cache_read / (total_cache_read + total_input)), cache_write vs cache_read reuse, cache-read vs cache-write spend, and the sessions with the poorest reuse. Pulls token totals from /api/analytics, per-session detail from /api/sessions, and dollar splits from /api/pricing/cost. Use when diagnosing cache spend or deciding whether prompt caching is paying off.

How to install cache-efficiency

install cache-efficiency
# install the Claude-Code-Agent-Monitor pack with the skills CLI
npx skills add hoangsonww/Claude-Code-Agent-Monitor

# or add only this skill to Claude Code: copy the folder

plugins/ccam-analytics/skills/cache-efficiency/

# into

~/.claude/skills/cache-efficiency/ (all projects)

.claude/skills/cache-efficiency/ (one project)

plugins/ccam-analytics/skills/cache-efficiency/SKILL.md

MITFull file
1# Cache Efficiency
2
3Diagnose whether prompt caching is actually saving money, and where it is not.
4
5## Input
6
7The user provides: **$ARGUMENTS**
8
9This may be: empty (analyze the whole fleet), "today" / "this week" / a date range, a session ID to scope the analysis, or a target like "hit rate > 80%". When empty, analyze all data from `/api/analytics`.
10
11## Data Sources
12
13| Endpoint | Returns |
14|----------|---------|
15| `GET /api/analytics` | `tokens.total_input`, `tokens.total_output`, `tokens.total_cache_read`, `tokens.total_cache_write` (baselines pre-summed), plus `daily_sessions` |
16| `GET /api/sessions?limit=200` | Session list — each has model, cwd, started_at, ended_at, inline `cost`, metadata (JSON: usage_extras with cache token detail) |
17| `GET /api/sessions/{id}` | Full session detail with nested agents and events, for drill-down on a flagged session |
18| `GET /api/pricing/cost` | `{ total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] }` — used to price cache read vs write spend |
19
20### How cache economics work
21
22```
23cache_hit_rate = total_cache_read / (total_cache_read + total_input)
24cache_reuse = total_cache_read / total_cache_write
25cache_read_cost = (cache_read_tokens / 1M) × cache_read_per_mtok
26cache_write_cost = (cache_write_tokens / 1M) × cache_write_per_mtok
27```
28…

Excerpt shown under the repository's MIT license.

More skills in Claude-Code-Agent-Monitor

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates