Claude Cache Guard — Security skill for Claude Code
Claude Code skill that stops prompt-cache thrash: -88% token burn in image-heavy agent sessions, with an audit script that shows exactly which calls nuked your cache.
How to install Claude Cache Guard
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open 0x0funky/claude-cache-guard and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Cache Guard does
Claude Code skill that stops prompt-cache thrash: -88% token burn in image-heavy agent sessions, with an audit script that shows exactly which calls nuked your cache.
Alternatives in Security
- Token Scan — Meme coin and token security scan — checks for rug pull vectors (hidden mint, honeypot, fee manipulation, LP l 3.8k ★
- Query Token Audit — Audit token security to detect scams, honeypots, and malicious contracts across BSC, Base, Solana, and Ethereu 483 ★
- Audit Agent Sessions — Analyze all agent sessions from the last 3 days across Claude, Codex, and Gemini 238 ★
README
claude-cache-guard
A Claude Code skill that stops **prompt-cache thrash** — the hidden cost pattern where reading one screenshot inside a long conversation rewrites the entire conversation history at **12.5× the cache-read price**.
Measured results
Real image-heavy production workload, same project / model / day, comparable work batches, before vs after applying the rules:
| Metric | Before | After | Δ |
|---|---|---|---|
| Images read in main context | 40 (across 22 turns) | 1 | |
| Cache writes (billed at 1.25×) | 18.0M tok | 0.74M tok | −96% |
| Output tokens (work produced) | 139k | 164k | +18% |
| Quota-weighted consumption | 27.6M eq-tok | 3.4M eq-tok | −88% |
| Estimated cost | $276.80 | $33.65 | −88% |
| Consumption per unit of output | 199 | 20.5 | ≈10× efficiency |
Same model, same image resolution, same output quality. (Honest caveat: a real-workload before/after, not a variable-controlled A/B; the "after" also starts from a fresh context — which is itself one of the rules, R6.)
What it does
When Claude is about to read images/screenshots in a session with history — visual QA, render checks, UI verification, diagram review — the skill loads rules that make it:
- Batch all image reads into a single message (1 image or 10 = same rewrite cost)
- Write findings to a notes file and never re-read an unchanged image
- Delegate vision checks to a subagent with a tiny isolated context, so the main session's cached prefix is never invalidated
- Keep large tool outputs (build logs, file dumps, base64) out of context
- Avoid TTL-expiry wakes and mid-session model/tool changes that nuke the cache
Plus a read-only **audit script** that ranks your recent sessions by estimated cost and flags exactly which calls thrashed the cache and why.
Install
# macOS / Linux
git clone https://github.com/0x0funky/claude-cache-guard ~/.claude/skills/cache-guard
# Windows (PowerShell)
git clone http
Related Skills
Cost Autopsy
Session token-burn autopsy (TCO v1). Reads the TIS telemetry log and reports per-session token spend (input /
Claude Warmline
Makes Claude Code's prompt-cache state visible: HOT/COLD in your statusline from Claude Code's own data, plus
Find Wasted Code
Run the find-wasted-code audit — the code-per-friction sibling of /token-waste-audit and /find-wasted-effort.
AI Spend
Audit Claude Code token efficiency: MCP overhead, session patterns, skill cost, cache hit rate. Add --full for
Redstamp
own your agent security — a deterministic, offline firewall for AI agent tool calls. Blocks secret exfil, prom
Cache Audit
A Claude Code skill that audits your setup against the 6 prompt caching rules from Anthropic's engineering tea
Related Agents
LLM FinOps Architect
LLM FinOps Architect specializing in model-tier routing, cost-envelope governance, burn-rate monitoring, per-p
Release Coordinator
Owns the framework release lifecycle from /release invocation through Gate 5 verification. Coordinates release
App Tester
Builds and exercises Heron end-to-end on this machine — starts the dev app, starts and stops real claude CLI s