Cache Audit banner
ussumant ussumant

Cache Audit

Security community

Description

A Claude Code skill that audits your setup against the 6 prompt caching rules from Anthropic's engineering team. Returns a scored report with specific fixes.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

cache-audit — Prompt Caching Skill for Claude Code

A Claude Code skill that audits your setup against the 6 prompt caching rules from Anthropic's engineering team. Returns a scored report with specific fixes.

Why This Exists

Prompt caching is what makes Claude Code affordable at scale. A high cache hit rate reduces costs and latency dramatically — but it's surprisingly easy to break without knowing it.

The Anthropic team runs alerts on cache hit rates and treats drops as incidents. This skill brings the same discipline to your personal setup.

What It Checks

Rule What breaks it
1. Ordering Dynamic data (timestamps, git status) in the system prompt
2. Message injection Editing the system prompt mid-session instead of using tags
3. Tool stability Adding/removing tools mid-conversation
4. Model switching Switching models in the same conversation thread
5. Dynamic content size Injecting thousands of tokens of dynamic data per session
6. Fork safety Compaction/subagent calls that don't share the parent's prefix

Installation

Global (applies to all projects)

mkdir -p ~/.claude/skills/cache-audit
curl -o ~/.claude/skills/cache-audit/SKILL.md https://raw.githubusercontent.com/ussumant/cache-audit/main/cache-audit/SKILL.md

Per-project

mkdir -p .claude/skills/cache-audit
curl -o .claude/skills/cache-audit/SKILL.md https://raw.githubusercontent.com/ussumant/cache-audit/main/cache-audit/SKILL.md

Then restart your Claude Code session for the skill to register.

Usage

/cache-audit

or say: `"audit my caching"` / `"check my cache setup"`

Example Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  PROMPT CACHE AUDIT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Score: 5/6

✅  Rule 1 — Ordering: PASS
✅  Rule 2 — Message injection: PASS
✅  Rule 3 — Tool stability: PASS
✅  Rule 4 — Model switching: PASS
⚠️  Rule 5 — Dynamic content size: W