Cc Cache Audit — Security skill for Claude Code
A/B test proving Claude Code's billing header breaks cross-session prompt cache sharing.
How to install Cc Cache Audit
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open motiful/cc-cache-audit and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cc Cache Audit does
A/B test proving Claude Code's billing header breaks cross-session prompt cache sharing. One env var fix saves ~85% on system prompt tokens.
Alternatives in Security
- Octoboss Clean Contexts — You are the Octoboss — a cross-tentacle orchestrator 1.4k ★
- 02 Cross Reference Audit — Cross-Reference Audit 1.1k ★
- Imcodes — The IM for agents 960 ★
README
cc-cache-audit
Claude Code v2.1.69+ injects a dynamic billing header into the system prompt that breaks cross-session prompt cache sharing. This repo contains the A/B test that proves it and the one-line fix.
The Fix
echo 'export CLAUDE_CODE_ATTRIBUTION_HEADER=false' >> ~/.zshrc
source ~/.zshrc
Only affects new sessions. Existing ones keep running fine.
Root Cause
Since v2.1.69, Claude Code prepends an `x-anthropic-billing-header` string to the system prompt:
x-anthropic-billing-header: cc_version=2.1.88.a3f; cc_entrypoint=cli; cch=00000;
That `.a3f` suffix is a 3-char SHA-256 hash computed from the first user message in each conversation:
// Deobfuscated from cli.js
function computeHash(firstUserMessage, version) {
const chars = [4, 7, 20].map(i => firstUserMessage[i] || "0").join("");
return sha256("59cf53e54c78" + chars + version).slice(0, 3);
}
Different conversation → different first message → different hash → different system prompt prefix.
This also affects **subagents within the same conversation**. Each Agent tool call has its own message context, so its first "user message" (the agent prompt) produces a different hash. Verified in a real session — 3 distinct hashes in one conversation:
Main conversation: cc_version=2.1.88.a3f (34 API calls)
Subagent 1: cc_version=2.1.88.e91 (3 API calls)
Subagent 2: cc_version=2.1.88.7c2 (3 API calls)
Anthropic's prompt cache uses [prefix matching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) with no per-session isolation — cache is shared at the Organization/Workspace level. So all Claude Code sessions and subagents *should* share the same cached system prompt. But the billing header makes each one's prefix unique, causing the system prompt (~12K tokens) to get rebuilt from scratch every time.
A/B Test
4 sessions per round, each with a different prompt, sequential with 8-second gaps (within the 5-min ca
Related Skills
AI Spend
Audit Claude Code token efficiency: MCP overhead, session patterns, skill cost, cache hit rate. Add --full for
Claude Memory Kit
Memory for Claude Code that survives the session boundary — install the plugin into any repo: a hot cache inje
Cost Autopsy
Session token-burn autopsy (TCO v1). Reads the TIS telemetry log and reports per-session token spend (input /
Audit Tokens
Analyze audit-log.jsonl for ghost-token-waste patterns across the 6 PLAN-047 detectors. Emits a markdown repor
Cache Audit
A Claude Code skill that audits your setup against the 6 prompt caching rules from Anthropic's engineering tea
Claude Warmline
Makes Claude Code's prompt-cache state visible: HOT/COLD in your statusline from Claude Code's own data, plus
Related Agents
Probe Architect
PLAN-020 Phase 0 item 5 governance probe — verifies that a native subagent dispatched with CEO_ARCHITECT_ACTIV
Docs Boss
Documentation and handoff Boss for Forge. Writes docs, setup instructions, architecture notes, env-var guides,
Documentation Checker
Verify documentation accuracy against the codebase. Checks README content, stale links, code examples, env var