AI Briefing
KO

Claude Code: Cache Misses and Billing Issues When Resuming Sub-Agents

·2026.09.16 21:23

Key point

It has been reported that Claude Code fails to reuse the prompt cache for follow-up requests after a sub-agent terminates, resulting in the rewriting of nearly the entire context and incurring charges.

Details

In Claude Code, when sending follow-up requests within the 1-hour cache window after a sub-agent terminates, the existing context is not read from the cache; instead, nearly the entire context is rewritten (cache write), causing a surge in usage.

Problem Symptoms and Cause

Approximately 50 minutes after a sub-agent terminates, follow-up requests result in 243K and 399K tokens being written to the cache, whereas messages sent during agent operations incur costs of only 2K–4K tokens. This is related to the messages_changed indicator in API responses. Specifically, in Claude Code version 2.1.273, the size of resumed requests decreases by the amount of 'thinking' tokens, leading to the conclusion that the absence of sent thinking tokens causes cache misses. Although documentation states that previous tool calls and reasoning should be preserved and the cache reused, actual behavior is inconsistent.

Cost Impact and Mitigation Strategies

The first message of a resumed sub-agent incurs cache write costs equivalent to the entire agent context, becoming a major cause of weekly usage limit consumption. While Anthropic has not disclosed exact weighting, this resembles past cases where changes intended to reduce costs by clearing thinking during idle session resumption were rolled back.

Developers can consider the following mitigation strategies:

  • Send messages during agent operations (low cost)
  • Use a new agent with a briefing for terminated agents
  • Handle tasks that do not require sub-agent context in the main session

Self-Diagnosis Method

Diagnose the issue by comparing cache_creation_input_tokens (paid) and cache_read_input_tokens (nearly free) in logs located at ~/.claude/projects/<project>/<session>/subagents/agent-<id>.jsonl. If a combination of large write volumes, small read volumes, and messages_changed appears, the issue has occurred.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.