florianbruniaux/claude-code-plugins/check-cache-bugs
Claude Code and agent skill by florianbruniaux/claude-code-plugins
- community
Checking that the SKILL.md file is still in the repository.
Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5
Install
npx vskill@latest install florianbruniaux/claude-code-plugins/check-cache-bugsSKILL.md
Check cache bugs (CC#40524)
Audit your Claude Code setup for cache and cost bugs discovered in March-April 2026.
Time: ~30 seconds | Scope: version, config files, CLAUDE.md, skills, hooks, shell profiles, all claude binaries
Note on cache contamination: This skill loads content containingcch=strings into the current session's message array. For cleanest results, run this command at the very start of a fresh session, or viaclaude -p "$(cat .claude/commands/check-cache-bugs.md)"as a one-shot print-mode invocation.
Reference: anthropics/claude-code#40524 | Discovered by: @jmarianski + @whiletrue0x | Extended by: @ArkNill (ArkNill/claude-code-cache-analysis, April 2026)
Background
Fix Status (current as of v2.1.92)
| Bug | Versions affected | Status | |
|---|---|---|---|
| Bug 1: cch sentinel (standalone binary) | v2.1.36-v2.1.90 | FIXED in v2.1.91 | |
| Bug 2: deferred_tools_delta on --resume | v2.1.69-v2.1.89 | FIXED in v2.1.90 | |
| Bug 3: attribution header per-session hash | v2.1.69+ | Active (env var workaround) | |
| B4: Microcompact / silent context stripping | all versions through v2.1.92 | Active (GrowthBook controlled) | |
| B5: Tool result budget cap 200K | all versions through v2.1.92 | Active (MCP tools exempted) |
Original three bugs (CC#40524)
- Bug 1 (FIXED v2.1.91): Bun's native HTTP layer did a same-length byte replacement of the
cch=00000 attestation placeholder after JSON.stringify but before TLS. Triggered only if cch=00000 appeared literally in messages[] content. Confirmed closed; npm and standalone binary are now equivalent on v2.1.91+.
- Bug 2 (FIXED v2.1.90): The session JSONL writer stripped
deferred_tools_deltaattachment
records before writing to disk. On --resume, those records were absent; the deferred tools layer had no prior history and re-announced all tools from scratch, shifting every message position and breaking the messages-level cache prefix entirely. Each resume rebuilt 87-118K tokens as cache_creation. Anthropic tracked internally as inc-4747.
- Bug 3 (ACTIVE, v2.1.69+): Claude Code injects a billing header as the first block of the
system prompt. The header contains a 3-character SHA-256 hash derived from characters [4, 7, 20] of the first user message + CC version, unique per session, per subagent, per side-query. Since the cache is prefix-based, this causes a cold miss on ~12K system prompt tokens on every invocation. A session with 5 subagents = 6 cold misses. Empirical: 48% -> 99.98% cache hit with env var workaround.
Additional bugs (ArkNill, April 2026)
- B4: Microcompact (all versions): Three mechanisms silently replace tool results with
[Old tool result content cleared] before sending to the API. Controlled by server-side GrowthBook flags, bypasses DISABLE_AUTO_COMPACT. The /export command shows original context, NOT what the model received. 327 clearing events measured in one session.
- B5: Tool result budget cap (all versions):
applyToolResultBudget()truncates tool results
when aggregate chars exceed 200K. Built-in tools (Read, Bash, Grep, Glob, Edit) are affected. MCP tools can override via _meta["anthropic/maxResultSizeChars"] (v2.1.91+).
Cost impact summary: 2-5x per session start/subagent for Bug 3 in isolation; 10-20x per turn for Bug 2 with 10+ skills and 3-4 resumes (both estimates are correct in their respective context).
Instructions
You are an auditor. Run all phases in order, collect every result, and produce the final report. Do not skip phases or stop early.
Phase 1: Claude Code version and install method
- Version < 2.1.90 -> flag BUG 2 RISK (resume/DTD; fixed in v2.1.90)
- Version < 2.1.91 AND standalone binary -> flag BUG 1 MECHANISM (sentinel; fixed in v2.1.91)
- Version >= 2.1.69 -> flag BUG 3 RISK (attribution header; no fix yet, check Phase 4)
- Binary is Mach-O / ELF executable -> standalone (relevant for Bug 1 on v2.1.36-v2.1.90)
- Binary is a symlink to
node_modulesor containscli.js-> npm/npx
Phase 2: Sentinel scan (Bug 1)
Search for the literal string cch= in all static config files. Exclude .jsonl files (ephemeral conversation history) and this command file itself.
Flag as BUG 1 RISK if any match found outside .jsonl files AND version < v2.1.91. On v2.1.91+: sentinel mechanism is fixed, no risk regardless of config content.
Phase 3: Resume/continue usage (Bug 2)
- Version >= v2.1.90: Bug 2 is FIXED, flag hits as informational only (no active cost risk)
- Version < v2.1.90 AND any hit in hooks/settings -> flag BUG 2 AUTOMATED (constant exposure)
- Version < v2.1.90 AND any hit in commands/skills/scripts -> flag BUG 2 MANUAL (exposure when invoked)
Phase 4: Attribution header check (Bug 3)
Check whether the billing header env var is already disabled.
CLAUDE_CODE_ATTRIBUTION_HEADERnot set tofalseAND version >= 2.1.69 -> flag BUG 3 ACTIVE- Already set to
false-> BUG 3 MITIGATED
Phase 5: Multiple binaries check
Flag any standalone binary < v2.1.91 as at risk for Bug 1. Flag any binary < v2.1.90 as at risk for Bug 2. Flag any binary >= v2.1.69 as at risk for Bug 3 (unless attribution header env var already set). Note stale binaries that could be mistakenly invoked.
Output format
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/code-quality/skills/check-cache-bugs/SKILL.md
Popularity
- Repository stars
- 32
- Repository forks
- 2
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/florianbruniaux/claude-code-plugins/check-cache-bugs)