[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F2V6AKMXTCHV4RWHG6ARMJ":3,"skill-same:01M7F2V6AKMXTCHV4RWHG6ARMJ":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":12,"updatedAt":33,"install":34,"resources":46},"01M7F2V6AKMXTCHV4RWHG6ARMJ","check-cache-bugs",null,"Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume\u002F--continue, attribution header + ArkNill B3\u002FB4\u002FB5","313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace","313DEVGRP","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34762848?v=4","01M7F2M535Z5X8XGHYD8TDVAB3","A-RMS by 313DEVGRP","01M7F2M54CR0P3631F4YM0D014",0,"MIT","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fcheck-cache-bugs\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: check-cache-bugs\ndescription: \"Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume\u002F--continue, attribution header + ArkNill B3\u002FB4\u002FB5\"\neffort: low\ndisable-model-invocation: true\n---\n\n# Check cache bugs (CC#40524)\n\nAudit your Claude Code setup for cache and cost bugs discovered in March-April 2026.\n\n**Time**: ~30 seconds | **Scope**: version, config files, CLAUDE.md, skills, hooks, shell profiles, all claude binaries\n\n> **Note on cache contamination**: This skill loads content containing `cch=` strings into the current session's message array. For cleanest results, run this command at the very start of a fresh session, or via `claude -p \"$(cat .claude\u002Fcommands\u002Fcheck-cache-bugs.md)\"` as a one-shot print-mode invocation.\n\n**Reference**: `anthropics\u002Fclaude-code#40524` | **Discovered by**: `@jmarianski` + `@whiletrue0x` | **Extended by**: `@ArkNill` (ArkNill\u002Fclaude-code-cache-analysis, April 2026)\n\n---\n\n## Background\n\n### Fix Status (current as of v2.1.92)\n\n| Bug | Versions affected | Status |\n|-----|------------------|--------|\n| Bug 1: cch sentinel (standalone binary) | v2.1.36-v2.1.90 | **FIXED in v2.1.91** |\n| Bug 2: deferred_tools_delta on --resume | v2.1.69-v2.1.89 | **FIXED in v2.1.90** |\n| Bug 3: attribution header per-session hash | v2.1.69+ | **Active** (env var workaround) |\n| B4: Microcompact \u002F silent context stripping | all versions through v2.1.92 | **Active** (GrowthBook controlled) |\n| B5: Tool result budget cap 200K | all versions through v2.1.92 | **Active** (MCP tools exempted) |\n\n### Original three bugs (CC#40524)\n\n- **Bug 1** (FIXED v2.1.91): Bun's native HTTP layer did a same-length byte replacement of the\n  `cch=00000` attestation placeholder after `JSON.stringify` but before TLS. Triggered only if\n  `cch=00000` appeared literally in `messages[]` content. Confirmed closed; npm and standalone\n  binary are now equivalent on v2.1.91+.\n\n- **Bug 2** (FIXED v2.1.90): The session JSONL writer stripped `deferred_tools_delta` attachment\n  records before writing to disk. On `--resume`, those records were absent; the deferred tools\n  layer had no prior history and re-announced all tools from scratch, shifting every message\n  position and breaking the messages-level cache prefix entirely. Each resume rebuilt 87-118K\n  tokens as `cache_creation`. Anthropic tracked internally as inc-4747.\n\n- **Bug 3** (ACTIVE, v2.1.69+): Claude Code injects a billing header as the first block of the\n  system prompt. The header contains a 3-character SHA-256 hash derived from characters [4, 7, 20]\n  of the first user message + CC version, unique per session, per subagent, per side-query. Since\n  the cache is prefix-based, this causes a cold miss on ~12K system prompt tokens on every\n  invocation. A session with 5 subagents = 6 cold misses. Empirical: 48% -> 99.98% cache hit with\n  env var workaround.\n\n### Additional bugs (ArkNill, April 2026)\n\n- **B4: Microcompact** (all versions): Three mechanisms silently replace tool results with\n  `[Old tool result content cleared]` before sending to the API. Controlled by server-side\n  GrowthBook flags, bypasses `DISABLE_AUTO_COMPACT`. The `\u002Fexport` command shows original\n  context, NOT what the model received. 327 clearing events measured in one session.\n\n- **B5: Tool result budget cap** (all versions): `applyToolResultBudget()` truncates tool results\n  when aggregate chars exceed 200K. Built-in tools (Read, Bash, Grep, Glob, Edit) are affected.\n  MCP tools can override via `_meta[\"anthropic\u002FmaxResultSizeChars\"]` (v2.1.91+).\n\nCost impact summary: 2-5x per session start\u002Fsubagent for Bug 3 in isolation; 10-20x per turn for\nBug 2 with 10+ skills and 3-4 resumes (both estimates are correct in their respective context).\n\n---\n\n## Instructions\n\nYou are an auditor. Run all phases in order, collect every result, and produce the final report. Do not skip phases or stop early.\n\n---\n\n### Phase 1: Claude Code version and install method\n\n```bash\n# Version check\nclaude --version\n\n# All installed claude binaries\nwhich -a claude 2>\u002Fdev\u002Fnull\n\n# Check if active binary is standalone or npm\nfile $(which claude) 2>\u002Fdev\u002Fnull\nls -la $(which claude) 2>\u002Fdev\u002Fnull\n```\n\n- Version \u003C 2.1.90 -> flag **BUG 2 RISK** (resume\u002FDTD; fixed in v2.1.90)\n- Version \u003C 2.1.91 AND standalone binary -> flag **BUG 1 MECHANISM** (sentinel; fixed in v2.1.91)\n- Version >= 2.1.69 -> flag **BUG 3 RISK** (attribution header; no fix yet, check Phase 4)\n- Binary is Mach-O \u002F ELF executable -> standalone (relevant for Bug 1 on v2.1.36-v2.1.90)\n- Binary is a symlink to `node_modules` or contains `cli.js` -> npm\u002Fnpx\n\n---\n\n### Phase 2: Sentinel scan (Bug 1)\n\nSearch for the literal string `cch=` in all static config files. Exclude `.jsonl` files (ephemeral conversation history) and this command file itself.\n\n```bash\n# Global config files\ngrep -r \"cch=\" \\\n  ~\u002F.claude\u002FCLAUDE.md \\\n  ~\u002F.claude\u002FMEMORY.md \\\n  ~\u002F.claude\u002FTONE.md \\\n  ~\u002F.claude\u002FFLAGS.md \\\n  ~\u002F.claude\u002FRULES.md \\\n  ~\u002F.claude\u002FRTK.md \\\n  ~\u002F.claude\u002FANTI_AI.md \\\n  2>\u002Fdev\u002Fnull\n\n# Global skills, commands, agents, hooks (excluding this command file)\ngrep -rl \"cch=\" ~\u002F.claude\u002Fskills\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fcommands\u002F --exclude=\"check-cache-bugs.md\" 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fagents\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Project-level config\ngrep -r \"cch=\" CLAUDE.md .claude\u002FCLAUDE.md .claude\u002FMEMORY.md 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fskills\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fcommands\u002F --exclude=\"check-cache-bugs.md\" 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fagents\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Broader scan: all CLAUDE.md files across projects\nfind ~ -name \"CLAUDE.md\" \\\n  -not -path \"*\u002Fnode_modules\u002F*\" \\\n  -not -path \"*\u002F.git\u002F*\" \\\n  2>\u002Fdev\u002Fnull | xargs grep -l \"cch=\" 2>\u002Fdev\u002Fnull\n```\n\nFlag as **BUG 1 RISK** if any match found outside `.jsonl` files AND version \u003C v2.1.91.\nOn v2.1.91+: sentinel mechanism is fixed, no risk regardless of config content.\n\n---\n\n### Phase 3: Resume\u002Fcontinue usage (Bug 2)\n\n```bash\n# settings.json\ngrep -i -- \"--resume\\|--continue\" ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\ngrep -i -- \"--resume\\|--continue\" .claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Hooks\ngrep -rn -- \"--resume\\|--continue\" ~\u002F.claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\ngrep -rn -- \"--resume\\|--continue\" .claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Commands and skills\ngrep -rn -- \"--resume\\|--continue\" ~\u002F.claude\u002Fcommands\u002F 2>\u002Fdev\u002Fnull\ngrep -rn -- \"--resume\\|--continue\" .claude\u002Fcommands\u002F 2>\u002Fdev\u002Fnull\n\n# Shell profiles (aliases, functions)\ngrep -n -- \"--resume\\|--continue\" ~\u002F.zshrc ~\u002F.bashrc ~\u002F.bash_profile ~\u002F.zprofile 2>\u002Fdev\u002Fnull\n\n# Project scripts\nfind . -name \"*.sh\" -o -name \"Makefile\" 2>\u002Fdev\u002Fnull | \\\n  xargs grep -l -- \"--resume\\|--continue\" 2>\u002Fdev\u002Fnull\n```\n\n- Version >= v2.1.90: Bug 2 is **FIXED**, flag hits as informational only (no active cost risk)\n- Version \u003C v2.1.90 AND any hit in hooks\u002Fsettings -> flag **BUG 2 AUTOMATED** (constant exposure)\n- Version \u003C v2.1.90 AND any hit in commands\u002Fskills\u002Fscripts -> flag **BUG 2 MANUAL** (exposure when invoked)\n\n---\n\n### Phase 4: Attribution header check (Bug 3)\n\nCheck whether the billing header env var is already disabled.\n\n```bash\n# Global settings\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\\|ENABLE_TOOL_SEARCH\" \\\n  ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Project settings\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\\|ENABLE_TOOL_SEARCH\" \\\n  .claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Shell profiles\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\" \\\n  ~\u002F.zshrc ~\u002F.bashrc ~\u002F.bash_profile ~\u002F.zprofile 2>\u002Fdev\u002Fnull\n```\n\n- `CLAUDE_CODE_ATTRIBUTION_HEADER` not set to `false` AND version >= 2.1.69 -> flag **BUG 3 ACTIVE**\n- Already set to `false` -> **BUG 3 MITIGATED**\n\n---\n\n### Phase 5: Multiple binaries check\n\n```bash\nfor b in $(which -a claude 2>\u002Fdev\u002Fnull | sort -u); do\n  echo \"=== $b ===\"\n  $b --version 2>\u002Fdev\u002Fnull || echo \"unavailable\"\n  file $b 2>\u002Fdev\u002Fnull\n  ls -la $b 2>\u002Fdev\u002Fnull\ndone\n```\n\nFlag any standalone binary \u003C v2.1.91 as at risk for Bug 1.\nFlag any binary \u003C v2.1.90 as at risk for Bug 2.\nFlag any binary >= v2.1.69 as at risk for Bug 3 (unless attribution header env var already set).\nNote stale binaries that could be mistakenly invoked.\n\n---\n\n## Output format\n\n```\n## Claude Code Cache Bug Audit: CC#40524\n\n**Date**: [today]\n**Active claude version**: [version]\n**Install method**: [standalone binary | npm\u002Fnpx | mixed]\n\n---\n\n### Bug 1: Sentinel replacement (standalone binary v2.1.36-v2.1.90)\n**Status**: [FIXED (v2.1.91+) \u002F SAFE \u002F AT RISK \u002F NOT APPLICABLE]\n\n**Version >= v2.1.91**: [YES -> FIXED | NO -> check below]\n**Mechanism active (standalone binary, v2.1.36-v2.1.90)**: [YES \u002F NO]\n**Trigger sentinel found in static config**: [YES (locations) | NO]\n\n[If FIXED] Running v2.1.91+. Sentinel mechanism patched; npm and standalone are equivalent. No action needed.\n[If AT RISK (v \u003C 2.1.91 AND standalone AND sentinel found)]\n-> Update to v2.1.91+: `npm install -g @anthropic-ai\u002Fclaude-code@latest`\n-> Temporary: remove `cch=00000` string from the flagged files, or use npm instead.\n[If SAFE] Mechanism present in binary but no trigger in static config. Update to v2.1.91 still recommended.\n[If NOT APPLICABLE] npm\u002Fnpx install: Bug 1 mechanism absent.\n\n---\n\n### Bug 2: Cache prefix mismatch on --resume \u002F --continue (v2.1.69-v2.1.89)\n**Status**: [FIXED (v2.1.90+) \u002F AT RISK (automated) \u002F AT RISK (manual) \u002F NOT APPLICABLE]\n\n**Version >= v2.1.90**: [YES -> FIXED | NO -> check below]\n**Automated usage found (hooks\u002Fsettings)**: [YES (locations) | NO]\n**Manual usage found (commands\u002Fskills\u002Fscripts)**: [YES (locations) | NO]\n\n**Root cause**: JSONL writer stripped `deferred_tools_delta` records before writing to disk. On `--resume`,\nthe deferred tools layer had no announcement history and re-announced all tools from scratch, shifting every\nmessage position and breaking messages-level cache prefix. Each resume rebuilt 87-118K tokens as cache_creation.\nAnthropic tracked as inc-4747. Fixed in v2.1.90.\n\n[If FIXED] Running v2.1.90+. Bug resolved. `--resume` usage found in config is now safe at the cache level.\n[If AT RISK]\n-> Update to v2.1.90+: `npm install -g @anthropic-ai\u002Fclaude-code@latest`\n-> Immediate: avoid `--resume` and `--continue` until updated.\n[If NOT APPLICABLE] Version \u003C 2.1.69: not affected.\n\n---\n\n### Bug 3: Attribution header per-session hash (v2.1.69+, no fix yet)\n**Status**: [ACTIVE \u002F MITIGATED \u002F NOT APPLICABLE]\n\n**Version in affected range (>= v2.1.69)**: [YES \u002F NO]\n**CLAUDE_CODE_ATTRIBUTION_HEADER set to false\u002F0\u002Fno\u002Foff**: [YES -> MITIGATED | NO -> ACTIVE]\n\n[If ACTIVE] Every session start and every subagent call misses the system prompt cache (~12K tokens\nrebuilt at cache_creation rate). A session with 5 subagents = 6 cold misses.\n-> Fix (immediate, no restart needed): add to ~\u002F.claude\u002Fsettings.json:\n  {\n    \"env\": {\n      \"CLAUDE_CODE_ATTRIBUTION_HEADER\": \"false\"\n    }\n  }\n-> Expected impact: cache hit ratio 48% -> ~99.98% (measured, source: @whiletrue0x CC#40524)\n\n[If MITIGATED] Header already disabled. No action needed.\n[If NOT APPLICABLE] Version \u003C 2.1.69: not affected.\n\n---\n\n### B4\u002FB5: Context mutation (informational, all versions)\n\nThese bugs are controlled by server-side GrowthBook flags and cannot be mitigated client-side.\nNo config check is possible; report as informational.\n\n**B4: Microcompact**: Three mechanisms silently replace tool results with `[Old tool result content cleared]`\nbefore sending to the API. The `\u002Fexport` command shows original context, NOT what the model received.\nWorkaround: start fresh sessions periodically to reset the tool result pool.\n\n**B5: Tool result budget cap (200K chars aggregate)**: Built-in tools (Read, Bash, Grep, Glob, Edit)\nhit a 200K character cap on aggregate tool results per session. Results are truncated beyond this threshold.\nMCP tools can partially override via `_meta[\"anthropic\u002FmaxResultSizeChars\"]` (v2.1.91+, up to 500K).\n\n---\n\n### Multiple binaries\n[List each binary found, version, type (standalone\u002Fnpm), and per-bug status]\n\n---\n\n### Summary\n\n| Bug | Versions | Status | Action |\n|-----|----------|--------|--------|\n| Bug 1: sentinel (standalone) | v2.1.36-v2.1.90 | [FIXED \u002F SAFE \u002F AT RISK \u002F N\u002FA] | [update to v2.1.91+ or \"none\"] |\n| Bug 2: --resume\u002F--continue | v2.1.69-v2.1.89 | [FIXED \u002F AT RISK \u002F N\u002FA] | [update to v2.1.90+ or \"none\"] |\n| Bug 3: attribution header | v2.1.69+ | [ACTIVE \u002F MITIGATED \u002F N\u002FA] | [add env var or \"none\"] |\n| B4: microcompact | all versions | INFORMATIONAL | start fresh sessions |\n| B5: tool result budget 200K | all versions | INFORMATIONAL | use MCP tools for large reads |\n| Stale binaries | -- | [CLEAN \u002F PRESENT] | [remove or none] |\n\n[If Bug 3 ACTIVE (always show this)]\nQuick win: add CLAUDE_CODE_ATTRIBUTION_HEADER=false to settings.json, immediate effect, no restart needed.\n\n[If all SAFE\u002FMITIGATED\u002FFIXED\u002FN\u002FA on Bugs 1-3]\nNo active cache exposure on the original CC#40524 bugs. B4\u002FB5 are informational, monitor session length.\n\nTrack: github.com\u002Fanthropics\u002Fclaude-code\u002Fissues\u002F40524 | github.com\u002FArkNill\u002Fclaude-code-cache-analysis\n```\n","# Check cache bugs (CC#40524)\n\nAudit your Claude Code setup for cache and cost bugs discovered in March-April 2026.\n\n**Time**: ~30 seconds | **Scope**: version, config files, CLAUDE.md, skills, hooks, shell profiles, all claude binaries\n\n> **Note on cache contamination**: This skill loads content containing `cch=` strings into the current session's message array. For cleanest results, run this command at the very start of a fresh session, or via `claude -p \"$(cat .claude\u002Fcommands\u002Fcheck-cache-bugs.md)\"` as a one-shot print-mode invocation.\n\n**Reference**: `anthropics\u002Fclaude-code#40524` | **Discovered by**: `@jmarianski` + `@whiletrue0x` | **Extended by**: `@ArkNill` (ArkNill\u002Fclaude-code-cache-analysis, April 2026)\n\n---\n\n## Background\n\n### Fix Status (current as of v2.1.92)\n\n| Bug | Versions affected | Status |\n|-----|------------------|--------|\n| Bug 1: cch sentinel (standalone binary) | v2.1.36-v2.1.90 | **FIXED in v2.1.91** |\n| Bug 2: deferred_tools_delta on --resume | v2.1.69-v2.1.89 | **FIXED in v2.1.90** |\n| Bug 3: attribution header per-session hash | v2.1.69+ | **Active** (env var workaround) |\n| B4: Microcompact \u002F silent context stripping | all versions through v2.1.92 | **Active** (GrowthBook controlled) |\n| B5: Tool result budget cap 200K | all versions through v2.1.92 | **Active** (MCP tools exempted) |\n\n### Original three bugs (CC#40524)\n\n- **Bug 1** (FIXED v2.1.91): Bun's native HTTP layer did a same-length byte replacement of the\n  `cch=00000` attestation placeholder after `JSON.stringify` but before TLS. Triggered only if\n  `cch=00000` appeared literally in `messages[]` content. Confirmed closed; npm and standalone\n  binary are now equivalent on v2.1.91+.\n\n- **Bug 2** (FIXED v2.1.90): The session JSONL writer stripped `deferred_tools_delta` attachment\n  records before writing to disk. On `--resume`, those records were absent; the deferred tools\n  layer had no prior history and re-announced all tools from scratch, shifting every message\n  position and breaking the messages-level cache prefix entirely. Each resume rebuilt 87-118K\n  tokens as `cache_creation`. Anthropic tracked internally as inc-4747.\n\n- **Bug 3** (ACTIVE, v2.1.69+): Claude Code injects a billing header as the first block of the\n  system prompt. The header contains a 3-character SHA-256 hash derived from characters [4, 7, 20]\n  of the first user message + CC version, unique per session, per subagent, per side-query. Since\n  the cache is prefix-based, this causes a cold miss on ~12K system prompt tokens on every\n  invocation. A session with 5 subagents = 6 cold misses. Empirical: 48% -> 99.98% cache hit with\n  env var workaround.\n\n### Additional bugs (ArkNill, April 2026)\n\n- **B4: Microcompact** (all versions): Three mechanisms silently replace tool results with\n  `[Old tool result content cleared]` before sending to the API. Controlled by server-side\n  GrowthBook flags, bypasses `DISABLE_AUTO_COMPACT`. The `\u002Fexport` command shows original\n  context, NOT what the model received. 327 clearing events measured in one session.\n\n- **B5: Tool result budget cap** (all versions): `applyToolResultBudget()` truncates tool results\n  when aggregate chars exceed 200K. Built-in tools (Read, Bash, Grep, Glob, Edit) are affected.\n  MCP tools can override via `_meta[\"anthropic\u002FmaxResultSizeChars\"]` (v2.1.91+).\n\nCost impact summary: 2-5x per session start\u002Fsubagent for Bug 3 in isolation; 10-20x per turn for\nBug 2 with 10+ skills and 3-4 resumes (both estimates are correct in their respective context).\n\n---\n\n## Instructions\n\nYou are an auditor. Run all phases in order, collect every result, and produce the final report. Do not skip phases or stop early.\n\n---\n\n### Phase 1: Claude Code version and install method\n\n```bash\n# Version check\nclaude --version\n\n# All installed claude binaries\nwhich -a claude 2>\u002Fdev\u002Fnull\n\n# Check if active binary is standalone or npm\nfile $(which claude) 2>\u002Fdev\u002Fnull\nls -la $(which claude) 2>\u002Fdev\u002Fnull\n```\n\n- Version \u003C 2.1.90 -> flag **BUG 2 RISK** (resume\u002FDTD; fixed in v2.1.90)\n- Version \u003C 2.1.91 AND standalone binary -> flag **BUG 1 MECHANISM** (sentinel; fixed in v2.1.91)\n- Version >= 2.1.69 -> flag **BUG 3 RISK** (attribution header; no fix yet, check Phase 4)\n- Binary is Mach-O \u002F ELF executable -> standalone (relevant for Bug 1 on v2.1.36-v2.1.90)\n- Binary is a symlink to `node_modules` or contains `cli.js` -> npm\u002Fnpx\n\n---\n\n### Phase 2: Sentinel scan (Bug 1)\n\nSearch for the literal string `cch=` in all static config files. Exclude `.jsonl` files (ephemeral conversation history) and this command file itself.\n\n```bash\n# Global config files\ngrep -r \"cch=\" \\\n  ~\u002F.claude\u002FCLAUDE.md \\\n  ~\u002F.claude\u002FMEMORY.md \\\n  ~\u002F.claude\u002FTONE.md \\\n  ~\u002F.claude\u002FFLAGS.md \\\n  ~\u002F.claude\u002FRULES.md \\\n  ~\u002F.claude\u002FRTK.md \\\n  ~\u002F.claude\u002FANTI_AI.md \\\n  2>\u002Fdev\u002Fnull\n\n# Global skills, commands, agents, hooks (excluding this command file)\ngrep -rl \"cch=\" ~\u002F.claude\u002Fskills\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fcommands\u002F --exclude=\"check-cache-bugs.md\" 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fagents\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" ~\u002F.claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Project-level config\ngrep -r \"cch=\" CLAUDE.md .claude\u002FCLAUDE.md .claude\u002FMEMORY.md 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fskills\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fcommands\u002F --exclude=\"check-cache-bugs.md\" 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fagents\u002F 2>\u002Fdev\u002Fnull\ngrep -rl \"cch=\" .claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Broader scan: all CLAUDE.md files across projects\nfind ~ -name \"CLAUDE.md\" \\\n  -not -path \"*\u002Fnode_modules\u002F*\" \\\n  -not -path \"*\u002F.git\u002F*\" \\\n  2>\u002Fdev\u002Fnull | xargs grep -l \"cch=\" 2>\u002Fdev\u002Fnull\n```\n\nFlag as **BUG 1 RISK** if any match found outside `.jsonl` files AND version \u003C v2.1.91.\nOn v2.1.91+: sentinel mechanism is fixed, no risk regardless of config content.\n\n---\n\n### Phase 3: Resume\u002Fcontinue usage (Bug 2)\n\n```bash\n# settings.json\ngrep -i -- \"--resume\\|--continue\" ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\ngrep -i -- \"--resume\\|--continue\" .claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Hooks\ngrep -rn -- \"--resume\\|--continue\" ~\u002F.claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\ngrep -rn -- \"--resume\\|--continue\" .claude\u002Fhooks\u002F 2>\u002Fdev\u002Fnull\n\n# Commands and skills\ngrep -rn -- \"--resume\\|--continue\" ~\u002F.claude\u002Fcommands\u002F 2>\u002Fdev\u002Fnull\ngrep -rn -- \"--resume\\|--continue\" .claude\u002Fcommands\u002F 2>\u002Fdev\u002Fnull\n\n# Shell profiles (aliases, functions)\ngrep -n -- \"--resume\\|--continue\" ~\u002F.zshrc ~\u002F.bashrc ~\u002F.bash_profile ~\u002F.zprofile 2>\u002Fdev\u002Fnull\n\n# Project scripts\nfind . -name \"*.sh\" -o -name \"Makefile\" 2>\u002Fdev\u002Fnull | \\\n  xargs grep -l -- \"--resume\\|--continue\" 2>\u002Fdev\u002Fnull\n```\n\n- Version >= v2.1.90: Bug 2 is **FIXED**, flag hits as informational only (no active cost risk)\n- Version \u003C v2.1.90 AND any hit in hooks\u002Fsettings -> flag **BUG 2 AUTOMATED** (constant exposure)\n- Version \u003C v2.1.90 AND any hit in commands\u002Fskills\u002Fscripts -> flag **BUG 2 MANUAL** (exposure when invoked)\n\n---\n\n### Phase 4: Attribution header check (Bug 3)\n\nCheck whether the billing header env var is already disabled.\n\n```bash\n# Global settings\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\\|ENABLE_TOOL_SEARCH\" \\\n  ~\u002F.claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Project settings\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\\|ENABLE_TOOL_SEARCH\" \\\n  .claude\u002Fsettings.json 2>\u002Fdev\u002Fnull\n\n# Shell profiles\ngrep -i \"CLAUDE_CODE_ATTRIBUTION_HEADER\" \\\n  ~\u002F.zshrc ~\u002F.bashrc ~\u002F.bash_profile ~\u002F.zprofile 2>\u002Fdev\u002Fnull\n```\n\n- `CLAUDE_CODE_ATTRIBUTION_HEADER` not set to `false` AND version >= 2.1.69 -> flag **BUG 3 ACTIVE**\n- Already set to `false` -> **BUG 3 MITIGATED**\n\n---\n\n### Phase 5: Multiple binaries check\n\n```bash\nfor b in $(which -a claude 2>\u002Fdev\u002Fnull | sort -u); do\n  echo \"=== $b ===\"\n  $b --version 2>\u002Fdev\u002Fnull || echo \"unavailable\"\n  file $b 2>\u002Fdev\u002Fnull\n  ls -la $b 2>\u002Fdev\u002Fnull\ndone\n```\n\nFlag any standalone binary \u003C v2.1.91 as at risk for Bug 1.\nFlag any binary \u003C v2.1.90 as at risk for Bug 2.\nFlag any binary >= v2.1.69 as at risk for Bug 3 (unless attribution header env var already set).\nNote stale binaries that could be mistakenly invoked.\n\n---\n\n## Output format\n\n```\n## Claude Code Cache Bug Audit: CC#40524\n\n**Date**: [today]\n**Active claude version**: [version]\n**Install method**: [standalone binary | npm\u002Fnpx | mixed]\n\n---\n\n### Bug 1: Sentinel replacement (standalone binary v2.1.36-v2.1.90)\n**Status**: [FIXED (v2.1.91+) \u002F SAFE \u002F AT RISK \u002F NOT APPLICABLE]\n\n**Version >= v2.1.91**: [YES -> FIXED | NO -> check below]\n**Mechanism active (standalone binary, v2.1.36-v2.1.90)**: [YES \u002F NO]\n**Trigger sentinel found in static config**: [YES (locations) | NO]\n\n[If FIXED] Running v2.1.91+. Sentinel mechanism patched; npm and standalone are equivalent. No action needed.\n[If AT RISK (v \u003C 2.1.91 AND standalone AND sentinel found)]\n-> Update to v2.1.91+: `npm install -g @anthropic-ai\u002Fclaude-code@latest`\n-> Temporary: remove `cch=00000` string from the flagged files, or use npm instead.\n[If SAFE] Mechanism present in binary but no trigger in static config. Update to v2.1.91 still recommended.\n[If NOT APPLICABLE] npm\u002Fnpx install: Bug 1 mechanism absent.\n\n---\n\n### Bug 2: Cache prefix mismatch on --resume \u002F --continue (v2.1.69-v2.1.89)\n**Status**: [FIXED (v2.1.90+) \u002F AT RISK (automated) \u002F AT RISK (manual) \u002F NOT APPLICABLE]\n\n**Version >= v2.1.90**: [YES -> FIXED | NO -> check below]\n**Automated usage found (hooks\u002Fsettings)**: [YES (locations) | NO]\n**Manual usage found (commands\u002Fskills\u002Fscripts)**: [YES (locations) | NO]\n\n**Root cause**: JSONL writer stripped `deferred_tools_delta` records before writing to disk. On `--resume`,\nthe deferred tools layer had no announcement history and re-announced all tools from scratch, shifting every\nmessage position and breaking messages-level cache prefix. Each resume rebuilt 87-118K tokens as cache_creation.\nAnthropic tracked as inc-4747. Fixed in v2.1.90.\n\n[If FIXED] Running v2.1.90+. Bug resolved. `--resume` usage found in config is now safe at the cache level.\n[If AT RISK]\n-> Update to v2.1.90+: `npm install -g @anthropic-ai\u002Fclaude-code@latest`\n-> Immediate: avoid `--resume` and `--continue` until updated.\n[If NOT APPLICABLE] Version \u003C 2.1.69: not affected.\n\n---\n\n### Bug 3: Attribution header per-session hash (v2.1.69+, no fix yet)\n**Status**: [ACTIVE \u002F MITIGATED \u002F NOT APPLICABLE]\n\n**Version in affected range (>= v2.1.69)**: [YES \u002F NO]\n**CLAUDE_CODE_ATTRIBUTION_HEADER set to false\u002F0\u002Fno\u002Foff**: [YES -> MITIGATED | NO -> ACTIVE]\n\n[If ACTIVE] Every session start and every subagent call misses the system prompt cache (~12K tokens\nrebuilt at cache_creation rate). A session with 5 subagents = 6 cold misses.\n-> Fix (immediate, no restart needed): add to ~\u002F.claude\u002Fsettings.json:\n  {\n    \"env\": {\n      \"CLAUDE_CODE_ATTRIBUTION_HEADER\": \"false\"\n    }\n  }\n-> Expected impact: cache hit ratio 48% -> ~99.98% (measured, source: @whiletrue0x CC#40524)\n\n[If MITIGATED] Header already disabled. No action needed.\n[If NOT APPLICABLE] Version \u003C 2.1.69: not affected.\n\n---\n\n### B4\u002FB5: Context mutation (informational, all versions)\n\nThese bugs are controlled by server-side GrowthBook flags and cannot be mitigated client-side.\nNo config check is possible; report as informational.\n\n**B4: Microcompact**: Three mechanisms silently replace tool results with `[Old tool result content cleared]`\nbefore sending to the API. The `\u002Fexport` command shows original context, NOT what the model received.\nWorkaround: start fresh sessions periodically to reset the tool result pool.\n\n**B5: Tool result budget cap (200K chars aggregate)**: Built-in tools (Read, Bash, Grep, Glob, Edit)\nhit a 200K character cap on aggregate tool results per session. Results are truncated beyond this threshold.\nMCP tools can partially override via `_meta[\"anthropic\u002FmaxResultSizeChars\"]` (v2.1.91+, up to 500K).\n\n---\n\n### Multiple binaries\n[List each binary found, version, type (standalone\u002Fnpm), and per-bug status]\n\n---\n\n### Summary\n\n| Bug | Versions | Status | Action |\n|-----|----------|--------|--------|\n| Bug 1: sentinel (standalone) | v2.1.36-v2.1.90 | [FIXED \u002F SAFE \u002F AT RISK \u002F N\u002FA] | [update to v2.1.91+ or \"none\"] |\n| Bug 2: --resume\u002F--continue | v2.1.69-v2.1.89 | [FIXED \u002F AT RISK \u002F N\u002FA] | [update to v2.1.90+ or \"none\"] |\n| Bug 3: attribution header | v2.1.69+ | [ACTIVE \u002F MITIGATED \u002F N\u002FA] | [add env var or \"none\"] |\n| B4: microcompact | all versions | INFORMATIONAL | start fresh sessions |\n| B5: tool result budget 200K | all versions | INFORMATIONAL | use MCP tools for large reads |\n| Stale binaries | -- | [CLEAN \u002F PRESENT] | [remove or none] |\n\n[If Bug 3 ACTIVE (always show this)]\nQuick win: add CLAUDE_CODE_ATTRIBUTION_HEADER=false to settings.json, immediate effect, no restart needed.\n\n[If all SAFE\u002FMITIGATED\u002FFIXED\u002FN\u002FA on Bugs 1-3]\nNo active cache exposure on the original CC#40524 bugs. B4\u002FB5 are informational, monitor session length.\n\nTrack: github.com\u002Fanthropics\u002Fclaude-code\u002Fissues\u002F40524 | github.com\u002FArkNill\u002Fclaude-code-cache-analysis\n```\n",{"name":5,"effort":24,"description":7,"disable-model-invocation":25},"low",true,"main","f2cc95bc769ca4c3a398965b767dfb41cdf8d698","reference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fcheck-cache-bugs",2,"https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace","https:\u002F\u002Fgithub.com\u002F313DEVGRP","https:\u002F\u002Fwww.a-rms.net","2026-10-18 12:48:10",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":25},[36,39,42],{"tool":37,"command":38},"npx","npx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill check-cache-bugs",{"tool":40,"command":41},"bunx","bunx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill check-cache-bugs",{"tool":43,"command":44},"pnpm","pnpm dlx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill check-cache-bugs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fcheck-cache-bugs\u002FSKILL.md",[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7F343WNVHZWWYJDD77QEJ7J","voice-refine","Transform verbose voice input into structured, token-efficient Claude prompts. Use when cleaning up voice memos, dictation output, or speech-to-text transcriptions that contain filler words, repetitions, and unstructured thoughts.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fvoice-refine\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7F3417SNXASFTDA1B2X4XYZ","validate-changes","Evaluate staged changes using LLM-as-a-Judge before committing","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fvalidate-changes\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7F33YN9QK88H2B81PVHMNG1","update-threat-db","Delegate threat-intelligence research and updates to AgentSec, then validate the guide and landing mirrors.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fupdate-threat-db\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7F33SXQ57G2FVFK094T4584","token-audit","Audit Claude Code configuration to measure fixed-context token overhead and produce a prioritized action plan. Use when hitting rate limits, experiencing early context compression, or after adding significant config files.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftoken-audit\u002Fskill.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7F33NAWXFPHW59CF52EAGGK","talk-stage6-revision","Produces revision sheets with quick navigation by act, a master concept-to-URL table, Q&A cheat-sheet with 6-10 anticipated questions, glossary, and external resources list. Use when preparing for a talk with Q&A, creating shareable reference material for attendees, or building a safety-net glossary for live delivery.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftalk-pipeline\u002Fstage-6-revision\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7F33G9V96HVZKAGZ84J4EBR","talk-stage5-script","Produces a complete 5-act pitch with speaker notes, a slide-by-slide specification, and a ready-to-paste Kimi prompt for AI slide generation. Requires validated angle and title from Stage 4. Use when you have a confirmed talk angle and need the full script, slide spec, and AI-generated presentation prompt.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftalk-pipeline\u002Fstage-5-script\u002FSKILL.md",[],[]]