Original Reddit post

Following up on u/treetank 's excellent post from a few days ago about two cache bugs in Claude Code — the issues linked there (#34629 and #40524) are now marked as resolved, but we found that the resume cache problem is not fully fixed in 2.1.92. We run a multi-turn agent platform that uses the SDK’s query() with resume for every user follow-up message. After upgrading to SDK 0.2.92 (CLI 2.1.92), we noticed our sessions were still showing partial cache misses on every resume turn. What we found We set up mitmproxy to capture the raw /v1/messages request bodies and compared a fresh session turn vs a resume turn. The first user message ( messages[0] ) has different content: Fresh : 5 content blocks (deferred tools, companion, skills listing , user context, prompt) Resume : 4 content blocks (deferred tools, companion, user context, prompt) — skills listing is missing The skills listing block (~3,900 chars) isn’t gone — it shows up deeper in the conversation at its historical position from the loaded transcript, instead of at the head where it belongs. This means messages[0] differs between fresh and resume, breaking the prompt cache prefix. Impact Turn 1 (fresh): cache_read=0 cache_create=12,528 (cold start) Turn 2 (resume): cache_read=8,760 cache_create=3,790 (partial miss) Turn 3 (resume): cache_read=8,760 cache_create=3,810 (same) ~3,800 tokens wasted per resume turn. For our platform with frequent multi-turn interactions, this adds up. There’s also a minor secondary issue: the companion intro block has a 1-byte difference between fresh and resume (trailing newline from transcript serialization). Doesn’t break caching currently but it’s fragile. What we did We were able to work around it with a pnpm patch on the SDK’s cli.js. We also opened an issue: https://github.com/anthropics/claude-code/issues/44045 How to check if you’re affected If you use the SDK with resume , set up mitmproxy and compare the messages[0].content blocks between a fresh turn and a resume turn. They should have the same number of blocks with the same content. If the skills listing is missing on resume, you’re hitting this. This is the same class of bug as the deferred_tools_delta issue from the original post (#34629) — that one was fixed, but the skills listing attachment has the same structural problem. submitted by /u/bilby91

Originally posted by u/bilby91 on r/ClaudeCode